Ubuntu scp stall resolved
Posted 09-24-2008 at 06:34 AM by Vermind
I had been troubled for long by my Ubuntu server not uploading files with scp or rsync properly. The transfers would hang at a little bit over 2MB, and never proceed from there. I asked on the Ubuntu forums about this, and yesterday received a fix suggestion that worked for me. The fix entails adding lines to /etc/sysctl.conf that change the default net and IPv4 behaviour, like so:
(sudo gedit /etc/sysctl.conf to edit the file to add the lines)
and then, if one does not like rebooting, reloading the config with.
net.core.rmem_default = 524288 net.core.rmem_max = 524288 net.core.wmem_default = 524288 net.core.wmem_max = 524288 net.ipv4.tcp_wmem = 4096 87380 524288 net.ipv4.tcp_rmem = 4096 87380 524288 net.ipv4.tcp_mem = 524288 524288 524288 net.ipv4.tcp_rfc1337 = 1 net.ipv4.ip_no_pmtu_disc = 0 net.ipv4.tcp_sack = 1 net.ipv4.tcp_fack = 1 net.ipv4.tcp_window_scaling = 1 net.ipv4.tcp_timestamps = 1 net.ipv4.tcp_ecn = 0 net.ipv4.route.flush = 1
and then, if one does not like rebooting, reloading the config with
sudo sysctl -p