Greetings and thanks for having me!
I have two systems running debian 8.6, my working machine and a server. The server is used as backup for my machine.
The server ist located in a datacenter, the working machine is with me.
The server has a 100Mbit/s up and down connection and a 10Gbit NIC.
The connection used by my working machine changes (I travel a lot) using a 1Gbit NIC.
I backup all my files once a week using sshfs to connect to the server and rsync to copy the files.
The transfer speed gets extremly slow while transfering small files. The smaller the files, the slower the transfer speed.
If I backup some bigger files I cap the available uplink connection, if I backup small files I just partially use it.
I know that it´s common for smaller files to take longer to transfer due to overheading.
It doesn´t matter if I use a faster or slower uplink connection (see example below)
If I transfer 200 files of 1KiB each using a
- 1 Mbit/s uplink connection it takes ~37s
- 10 Mbit/s uplink connection it takes ~46s
to complete the transfer.
The files were created by looping dd if=/dev/random
For comparison, backing up a 200 KiB file takes less than a second.
The 1 Mbit/s uplink connection should be slower than the 10Mbit/s uplink connection, but their RTTs (measured by ping) differ.
The 1 Mbit/s uplink connection has a ~20ms RTT, the 10Mbit/s a ~31ms RTT.
According to my research increasing the TCP window size might speed up the transfer.
I increased the TCP window size on server and client, but nothing changed.
Next I tried to play around with the options of sshfs - kernel_cache, cache, compression and cipher - without an increase in transfer speed.
I also tried using cp instead of rsync, without a difference in transfer speed.
Client and server are both bored during the transfer, load <1, RAM utilization <10%, HDDs IO is fine as well.
The network utilization is fine as well, I copy files with ~5KB/s and the Utilization shows ~40Kbit/s.
I wasn´t to sure if this is a sshfs or a networking issue, so I installed two VMs on my local machine and transfered 10000 1KiB files using sshfs.. in less than 3 seconds.
After all the above I´m pretty sure this is a tcp networking issue, but I´m not too sure what else to test/change to get a better transfer speed for my small files.
My question is pretty simple to ask and probably a lot harder to answer:
Is there anything that I can change to increase my transfer speed for smaller files or am I fighting a lost battle against the downsides of tcp and wan connections?