sending a large file with SCP to a certain server stalls at exactly 2112 kB
There is a certain ubuntu 10.04 server where if I ssh a file onto it from any server that is outside the office where this server is (meaning any of use scp-ing onto this server through LAN from within this server always works for some reason), then scp-ing fails for any file over 2112 kB in size, and is stuck at 2112 kB. So
scp -vvv /home/attila-szeremi/aszeremi.tar.gz [email protected]:~/aszeremi.tar.gz
shows something like 1% 2112KB 909.2KB/s - stalled -
dynamically at the end, where the KB/s becomes lower and lower.
Does anyone know what may be causing this and how I can fix it?
What I have tried so far:
- Limiting the speed with scp -l 2000. It just made the file sending slower, and at 2112 kB it got stuck again.
- Enabling compresison with -C. It was still stalled at the same size.
Solution 1:
The only way I managed to get rid of this problem was by disabling TCP SACK:
$ sudo sysctl -w net.ipv4.tcp_sack=0
Solution 2:
I seemed to have found the fix. I had to set the LAN card's mtu setting to 1492 by:
# ifconfig eth0 mtu 1492
Solution 3:
On newer Linux systems the ifconfig command may have been replaced by ip
The command to set the mtu becomes:
# ip link set dev eth0 mtu 1492