scp performance over 1Gbit LAN
It does seem slow from a theoretical stand point although I've not seen any transfers much quicker practically on home hardware.
Some experiments you might like to try to rule out possible limiting factors:
- Assess your raw SSH speed by copying from
/dev/zero
to/dev/null
. This rules out a HD bottle neck.ssh remote_host cat /dev/zero | pv > /dev/null
- Check other unencrypted protocols such as HTTP. HTTP actually sends files as with nothing but a header. Sending large files over HTTP is a reasonable measure of TCP speeds.
- Check that you are not forcing traffic through the router but only it's ethernet switch. For example if your machine has a public IP and local IP, then scp to/from the local IP. This is because home routers often have to process WAN traffic through their CPU which creates a bottle neck. Even if both machines are on the LAN, using the public IP can force packets through the CPU as if it was going to the WAN.
- Similarly I would use IPv4. Some home routers have a weird behaviour with IPv6 where they ask all local traffic to be forwarded to the router.
- If at all possible try with a gigabit crossover cable instead of a router. This should rule out router.
In addition to the other answers:
- check that your wired connections are all full duplex (from the first machine until the destination machine),
- and ensure that nothing else is using the 1gps link other than : your scp, and the negotiating and return packets (acks, etc)
- and that the encryption you use for the scp is not overwhelming either ends CPU capabilities
- that you have large tcp windows (and everything else your hops can handle) to allow more data packets and less tcp overhead paquets
- you may try compressing on the fly, if the file isn't compressed yet and if, again, it doesn't overwhelm either CPUs
If everything is completely in your favor you should approach 70-80pct of 1gbps (ie, 80 pct of 1024 megabit per seconds, ie 0.8*1024/8 megabytes per seconds) , but it could be at the detriment of other types of connections connections (low packet sizes, or needing more responsivness and less latency)
Lastly, never underestimate the bandwidth of carrying a USB key (or drive) over... (by foot, which is also a health bonus)