My Network Interface card r/w rate is 1000MB/S, but when I scp one file it shows the copy speed is 120MB/S. such as: scp test.gz localhost:/data/test.gz

  • 8
    Aren't you confusing Mb/s (megabit per second, see the lowercase 'b') with MB/s (megabyte per second)? 1000 Mb/s would be about 125MB/s which is quite compatible with the speed you see. – Renan Jun 19 '16 at 1:54
  • 2
    I'd like to add that I don't believe there are many 8Gb NIC's out there... – DigitalDesignDj Jun 19 '16 at 2:01
  • scp is simple and has small buffers. The speed differs with the latency of the link. If you want performance, use sftp – Jakuje Jun 19 '16 at 7:45

Looks like you're confusing Mb/s (megabit per second) with MB/s (megabyte per second).

1000 Mb/s becomes a theoretical 125 MB/s, and 120 MB/s looks like good performance (since you don't give more information, I take that it is a standard desktop PC with SATA hard disks).

Besides, I don't really think you can reach 1 GB/s (which would mean 8 Gb/s) without special equipment (10 Gb ethernet, a high-end NAS or a SAN etc...).

| improve this answer | |

Instead of scp, sometimes scp will fail if the file size is huge due to connection timeout issues. Then You can try rsync command with bandwidth limit. (Here bwlimit=2048 refers to 2GB/second transfer speed, you can change the limit as per your from source to destination limit)

rsync -varP --bwlimit=2048 /tmp/localfile username@172.X.X.X
| improve this answer | |
  • --bwlimit is a value in kilobytes per second, not megabytes, so 2048 would be 2MBps. Besides, this does not seem to answer the question. – dhag Jan 24 '18 at 17:46
  • @tomasz -- Yes typo, it's kilobytes per second. rsync is a suggestion instead of scp, in scp do we have bandwith limit. so I suggested to use rsync with 1gb bandwidth limit as per the above question – bala4rtraining Jan 25 '18 at 6:33

scp is limited not just by your network interface speed (and indeed if you're using localhost, you're not even touching your network card), but also by disk I/O speed, CPU speed, and other mitigating factors.

| improve this answer | |
  • I tried copy to other server instead of localhost, but two server in the same switch, the speed is still about 120MB/S. I don't think the disk I/O limited the speed. – Jack Jun 19 '16 at 1:09
  • A better test of raw network throughput is to a test that doesn't also do compression encryption, and a whole host of other things. For example, you can run nc -l 22222 on one host, and cat /dev/random | pv | nc host.example.com 22222 on the other. – DopeGhoti Jun 19 '16 at 1:27
  • @Jack if localhost is limited to 120mb/s, why would a remote host go faster? In other words, lets say your disk goes 10kbps, why would scp to a remote host go faster than 10kbps? Also DopeGhoti mentioned that the bottleneck could be something other than disk, such as CPU. – Patrick Jun 19 '16 at 1:42
  • @DopeGhoti /dev/random is a bad source of data when you're trying to measure speed. /dev/random is abysmally slow. – Patrick Jun 19 '16 at 1:44
  • /dev/zero would do nicely. urandom is what I meant (which does not wait for more entropy), but the edit timer froze my comment before I could correct the error. – DopeGhoti Jun 19 '16 at 2:52

Not the answer you're looking for? Browse other questions tagged or ask your own question.