Wednesday, August 07, 2013

SCP - get stalled?

Sometimes when you attempt to copy a file (of size, ) over the network using scp you might get a error <file> stalled. This can be frustrated. You can solve this stalled problem by adding a "-l" parameter.

The cause:
The reason for scp to stall, is because scp greedily grabs as much bandwith of the network as possible when it transfers files, any delay caused by the network switch of the firewall can easily make the TCP connection stalled.


Solution:

There’s a solution to this problem: Add “-l 8192″ to the scp command. Or depends on your upload bandwidth, you can set the number yourself. 8192 means (1Mbps).

$ scp -l 2048 foo.bar tony@10.38.12.200:~/


Don't be too greedy :)




No comments: