SFTP is periodically extremely slow for no reason

file-transferlinux-networkingsftp

I am transferring a bunch of gigabyte-sized files using SFTP over a fairly fast connection, between two servers running Ubuntu linux, with not much CPU load.

I am usually able to reach 5.0 MB transfer speeds (around 40 megabit/sec), though we have 90 megabit of bandwidth available and it doesn't seem to want to go any higher.

Running at 5.0 MB:

  • The source machine has a CPU load of no more than 2.7% for ssh
  • The target machine has a CPU load of no more than 13.3% for sshd and 3.0% for sftp-server

I can't get it to go any faster. If I open a second SFTP session, the two never exceed 5.0 MB combined.

 

And now for the actual question. Occasionally SFTP will transfer incredibly slowly for no apparent reason. Both machines are not busy, and the Internet connection is empty, yet the transfer plods along at around 120 KB/s.

  • Interrupt SFTP, reconnect. Still 120 or so KB/s
  • Interrupt SFTP, reconnect. Still 120 or so KB/s
  • Interrupt SFTP, reconnect. Still 120 or so KB/s
  • Interrupt SFTP, reconnect. This time it starts out slow but works its way back up to 5.0 MB/s

What the heck is going on?

I know there is some sort of mechanism to keep SFTP from overloading a slow SSH connection, but that mechanism appears to be broken and unreliable.

Best Answer

Most likely is a bandwidth issue ; Most hosting providers will restrict your bandwidth after certain amount of used bandwidth. Explain to your providers what issues are you facing so they can help you out.