Is there a way to limit the speed of scp (or rsync)? I couldn't find any information in the man page, nor on the internet.
Asked
Active
Viewed 3.6k times
3 Answers
14
From the man page: -l limit Limits the used bandwidth, specified in Kbit/s.

Leo
- 1,038
- 1
- 8
- 13
-
1Plus is you want to do it with rsync, you need to specify/add the -e "ssh -l xxx" on the command – Leo Oct 21 '10 at 13:46
-
2`ssh -l xxx` means login as user xxx. – Cristian Ciupitu Oct 21 '10 at 14:06
-
I'm very sorry. I did not check my work (I hate when people do that here!!) rsync uses this according to the man page: --bwlimit=KBPS limit I/O bandwidth; KBytes per second. I've not tested it, but it does say that this is for daemon mode. – Leo Oct 21 '10 at 14:16
-
everybody says they have great success with the -l option in scp, but I'm trying it on my raspberry pi and it seems to be ignored. No matter what I set it to, it maxes out my bandwidth. – Stu Dec 25 '12 at 01:21
-
@Stu I tested it on a Raspberry Pi with the default software installed. And the `-l` option works as advertised in the man page. The transfer speed fluctuates a bit, but it appears to keep the right speed on average. – kasperd Nov 24 '16 at 22:25
-
@Stu scp will appear to be using as much bandwidth as possible, but note that the indicated speed will gradually reduce until it meets your target. Also, if you watch the amount transferred value, it will increase at the desired speed, so you can tell that the transfer is only going as fast as you specified. It's just the way it's calculated for the user to see. – Bert Nov 15 '18 at 15:59
9
I'm not convinced the -l setting works properly with big values: On my RHEL6 system if see:
-l not specified
- Expected: Whatever the wan can handle
- Actual: 20 Megabytes per second
-l 8000
- Expected: 1 Megabyte per second
- Actual: 1 Megabyte per second
-l 80000
- Expected: 10 Megabytes per second
- Actual: 150 Kilobytes per second

David Castell
- 99
- 1
- 1
0
Using the "-l" switch on scp works very well. Its wise to set this switch with lower values than your maximum upload speed.
About higher values, if scp not attending the defined speed this question is related at your ISP that delimitated your upload speed after some seconds.