TrueNAS Scale: Improving SFTP transfer speeds over high-latency connection?

Hey folks, I’m backing up the contents of my TrueNAS SCALE system via SFTP across the Atlantic ocean on a 400 Mbps uplink, with around 180 ms ping. I’m currently getting anywhere between 150 Mbps–250 Mbps maximum uploads, far below the theoretical maximum. Are there any settings I can tweak to make this better?

One thing that comes immediately to mind is the TCP buffer to prevent ACK losses. What is the default TCP buffer size? Would it be beneficial to increase it?

The problem is that SFTP is not a streaming protocol. In other words, there is a lot of chit-chat between the server and client and with a 1/5s ping time that slows everything down.

Some rules of thumb for maxing out your bandwidth:

  1. Only send stuff that is updated.
  2. Send it compressed.
  3. Send it using multiple streams.
  4. Establish what needs to be sent up front rather than on a file by file basis; so that you can…
  5. Send it using a streaming protocol.
  6. If you have to send it as individual files, try zipping multiple files into a single file to help (and you can get compression at the same time).

If the server at the other end is also running ZFS, then do a ZFS replication instead because it literally ticks all (or most) of the above boxes.

1 Like