File transfer over SFTP is slow


Having trouble with moving files between my office workstation and my home for some reason using sftp.
I connect to the office machine using sftp (cli), start downloading and the speed maxes out at 32Kbps… Never goes any higher just lower. Considering that I have a 100/50 Mbps connection in the office this seems way too low. On the home side I have a slower connection at 20/5 Mbps.
Tried to use FileZilla too, got the same speed so pretty sure that something is wrong with the server side.

Had issues as such previously, but adding the “UseDNS no” option to sshd to on the server side always solved this issue. Until now at least.
My sshd_conf is available here:

Any help/advice would be welcome folks. Also open for other solutions until it can be done from cli.

Ok so just to make sure that the problem is on the office side I spinned up a VPN on Digital Ocean. Sftp in to the office and tried a get on the same 358MB file. Was running at ~2Mbps…
Then I tried to sftp in to the VPN and get the file from there, but - surprise, surprise - couldn’t get more than 32KB/s out of the download again. :confused:

In conclusion the problem is on the home end in the client or the network…

Is your home network a wired network, or are you connected via wifi? If the latter, you’ll need to investigate possible bandwidth issues arising from contention, interference, and received signal level (which can impact modulation).

SFTP (which utilizes SSH2) is susceptible to network latency, and there are significant overheads involved including the client/server handshaking with every packet sent, and decoding. You could try investigating latency and throughput from your home network to your VPN server using iperf for example.

What kind of rrt figures do you get when you ping your gateway and public IP address assigned to your home router?


Sorry for getting back so late…

Connected via wired network, but tried over wifi as well getting the same results. Never higher than 32Kbps…

Iperf is showing better values. Slow, but better at least for single connection:

 ~  iperf3 -c -p 2555 -P 1 
Connecting to host, port 2555
  4] local port 41430 connected to port 2555
 ID] Interval           Transfer     Bandwidth       Retr  Cwnd
  4]   0.00-1.00   sec  85.4 KBytes   699 Kbits/sec    4   1.36 KBytes       
  4]   1.00-2.00   sec  27.1 KBytes   222 Kbits/sec   21   10.8 KBytes       
  4]   2.00-3.00   sec  0.00 Bytes  0.00 bits/sec    0   10.8 KBytes       
  4]   3.00-4.00   sec  27.1 KBytes   222 Kbits/sec   10   12.2 KBytes       
  4]   4.00-5.00   sec  0.00 Bytes  0.00 bits/sec    0   12.2 KBytes       
  4]   5.00-6.00   sec  27.1 KBytes   222 Kbits/sec   13   5.42 KBytes       
  4]   6.00-7.00   sec  0.00 Bytes  0.00 bits/sec    1   6.78 KBytes       
  4]   7.00-8.00   sec  28.5 KBytes   233 Kbits/sec    3   13.6 KBytes       
  4]   8.00-9.00   sec  0.00 Bytes  0.00 bits/sec    6   5.42 KBytes       
  4]   9.00-10.00  sec  27.1 KBytes   222 Kbits/sec    2   13.6 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
 ID] Interval           Transfer     Bandwidth       Retr
  4]   0.00-10.00  sec   222 KBytes   182 Kbits/sec   60             sender
  4]   0.00-10.00  sec   146 KBytes   120 Kbits/sec                  receiver

iperf Done.

Ping round-trip is fairly acceptable too…

PING ( 56 data bytes
64 bytes from icmp_seq=0 ttl=52 time=115.356 ms
64 bytes from icmp_seq=1 ttl=52 time=117.647 ms
64 bytes from icmp_seq=2 ttl=52 time=97.414 ms
64 bytes from icmp_seq=3 ttl=52 time=51.770 ms
64 bytes from icmp_seq=4 ttl=52 time=92.267 ms
64 bytes from icmp_seq=5 ttl=52 time=49.635 ms
64 bytes from icmp_seq=6 ttl=52 time=51.069 ms
64 bytes from icmp_seq=7 ttl=52 time=59.997 ms
64 bytes from icmp_seq=8 ttl=52 time=57.098 ms
64 bytes from icmp_seq=9 ttl=52 time=48.135 ms
64 bytes from icmp_seq=10 ttl=52 time=59.539 ms
^C--- ping statistics ---
11 packets transmitted, 11 packets received, 0% packet loss
round-trip min/avg/max/stddev = 48.135/72.721/117.647/26.029 ms

Honestly, at this stage I was thinking that my ISP is doing something nasty, but again over VPN connection I get the same speed from home to office. Can this be a client side ssh issue? Maybe something in the config? Or potentially the ISP?
Might be a wise idea to test with vsftp or some other file transfer solution like Syncthing?

Had this connection between home and office and this is the first time it went really bad :confused:

Based on the iperf results, I think you might need to have a word with your service provider. What do typical internet speed test results look like?

Yes you are not wrong… Speedtest by Ookla - The Global Broadband Speed Test
Noticed that the speed has been dropped recently, but other services - such as general browsing - are not affected so drastically.
Going to give them a call/visit, but as I’m now in Indonesia I’m not expecting much :confused:
In the meanwhile just use syncthing to move over stuff what I might need. Annoying AF…

Was hoping that it is something else to be honest. Thank you for your help!