Slow scp transfer speed over wan

networkingperformancescp

I have got a 300mbit symmetrical fiberoptic line, and I have got to transfer a 51MBYTE tar file from HOST A (fiberoptic 300mbit) to HOST B (digitalocean machine with more than gigabit bandwith).

On both side I have got nice speedtests results (300mbit on A, 700 on B) but when I scp from A to B I have got this:

assets.tar            100%   51MB 220.3KB/s   03:55

only 220kbit of maximium speed.

But if I do from HOST B to A I have got a really nice result:

assets.tar            100%   51MB   8.4MB/s   00:06    ***REALLY GOOD SPEED***

What can be the issue?

Best Answer

SCP is very simple tool to simple copy files back and forth. It was not designed to super-fast speeds and it has really small buffers on both sides.

If you aim for performance, you should use sftp or rsync.

About the speed measures, lets draw some diagram:

[host A]   --- ??? mbit  ---    [host B]
        \                      /
         \ 300 mbit           / 700 mbit
          \                  /
           [speedtest server]

The data between two hosts does not have to go through the speedtest server you measured the speed against (and they probably don't go) so these measures are irrelevant for your case. If you want to measure speed between these two hosts, you really need to measure traffic between these two and not anything else. There might be some line that is assymetric or different way limited.

Related Question