3

When I copy a large file (100+mb) to a remote server using scp it slows down from 2.7 mb/s to 100 kb/s and downward and then stalls.

The problem is that I can't seem to isolate the problem. I've tried 2 different remote servers, using 2 local machines (1 osx, 1 windows/cygwin), using 2 different networks/isps and 2 different scp clients. All combinations give the problem except when I copy between the two remote servers (scp). Using wireshark I could not detect any traffic volume that would congest the network (although about 7 packets/sec with NBNS requests from the osx machine).

What in the world could be going on? Given the combinations I've used there doesn't seem to be any overlap in the thing that could be causing the trouble.

Rolf
  • 31
  • 1
  • 1
  • 2
  • Does this happen with other file transfers, http or ftp ? Have you asked your hosting provider if they are limiting your transfers. I have seen a similar effect with a firewall interrupting communication causing transfers to fail. Try using rsync with ssh if possible, does it help? – daxroc Oct 16 '12 at 20:44
  • I have the same problem and the symptoms are exactly the ones described here: https://raim.codingfarm.de/blog/2012/05/31/the-mysterious-stalled-scp-connections/ --- but I suppose that OpenSSH should not have that problem. – Rmano Nov 18 '14 at 12:35

2 Answers2

4

This could be caused by the MTU being incorrectly set.

Update

This is a possible duplicate of reliable-file-transfer-over-slow-or-flaky-network-link

You can get debug output from scp by adding -v argument - scp man page

My suggestion would be to use rsync over ssh

rsync -avz --progress --partial /path/to/copy ssh user@host:~/upload

~/upload would be in your users home directory

daxroc
  • 274
  • 1
  • 7
  • I've tried changing the mtu but that doesn't seem to do anything. Could it be a provider issue? I just remembered that the two locations had the same isp. Could it be something to do with them? – Rolf Oct 16 '12 at 21:31
  • It's possible it's a provider issue. You generally need to tune the MTU. Try and use a download manager and test over http. Do you have any other problems with downloads ? – daxroc Oct 16 '12 at 21:36
  • That's the strange thing, any other download works fine. Just scp does this. – Rolf Oct 16 '12 at 23:58
  • rsync works great. I've added it as a drop in replacement for scp. Thanks for your help daxroc! – Rolf Oct 19 '12 at 00:10
0

Another possible explanation, not related to MTU, could be the HPN ssh patch Bug.

kriss
  • 121
  • 4