Slow scp transfer speed over wan
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 videos on Youtube
Roberto Sha
Updated on September 18, 2022Comments
-
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 almost 8 yearsWhat if you try with some speed limit like
scp -l 200000
? Check if this helps. -
Silvio Silva almost 8 yearsIs 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 almost 8 yearsYou 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 almost 8 yearsISTR that today's OpenSSH uses sftp under the covers for the
scp
command. -
Jakuje almost 8 years@slim, no, it does not. Check the source.
-
slim almost 8 yearsI'm certain I've seen systems where
/usr/bin/scp
is a symlink to/usr/bin/sftp
(andsftp
handles parmams differently if argv[0] isscp
). 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 almost 8 yearsI 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 almost 8 yearsNot sure what you mean there.
ls
andcat
have different synopsis, but on some systems both are symlinks tobusybox
and most users don't even notice.