Slow scp transfer speed over wan

6,971

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.

Share:
6,971

Related videos on Youtube

Roberto Sha
Author by

Roberto Sha

Updated on September 18, 2022

Comments

  • Roberto Sha
    Roberto Sha over 1 year

    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?

    • tuzion
      tuzion almost 8 years
      What if you try with some speed limit like scp -l 200000 ? Check if this helps.
    • Silvio Silva
      Silvio Silva almost 8 years
      Is A your home box? in this case 300 mbit/s is download speed only. To save some money many internet providers limit upload speed.
    • roaima
      roaima almost 8 years
      You are muddling your Bytes ("B") and bits ("b"). For example, "when I scp from A to B i have got [...] only 220kbit of maximium speed". The 220KB/s is 2.2Mbit/s.
  • slim
    slim almost 8 years
    ISTR that today's OpenSSH uses sftp under the covers for the scp command.
  • Jakuje
    Jakuje almost 8 years
    @slim, no, it does not. Check the source.
  • slim
    slim almost 8 years
    I'm certain I've seen systems where /usr/bin/scp is a symlink to /usr/bin/sftp (and sftp handles parmams differently if argv[0] is scp). However the source you've linked doesn't confirm that, and nor does the Raspbian system that is the only Linux I can reach right now.
  • Jakuje
    Jakuje almost 8 years
    I have never seen such system. They have different synopsis, so you can't symlink them without confusing a lot of users. Also they use different way to handle the server side (subsystem x just command).
  • slim
    slim almost 8 years
    Not sure what you mean there. ls and cat have different synopsis, but on some systems both are symlinks to busybox and most users don't even notice.