# does anybody know why FreeBSD scp ignores  -l limit ?



## cwf-ml (Aug 26, 2017)

Subject says it all. scp has a nifty bandwidth limiting feature.

I needed to copy a bunch of really big files via a 10Mbit link, without impacting that one for others.  So.... I tried `scp -l 2000 source-files me@targethost:`

I first tried on my windows box with cygwin. worked like a charm.

But the files are on the bsd box. BSD scp also supports the -l option - but it keeps using up the full 10Mbit, showing 1.1MByte/sec transfer.  I waited for ~10 minutes for this to adapt, but no change (cygwin scp needed about a minute to scale down to the 2 Mbit/s = 250 kbyte/s), but the error is stable.

Yes - I could use rsync as workaround -`rsync --bwlimit` actually works. But still - is this a known limitation or a bug or what?


----------



## ShelLuser (Aug 26, 2017)

The value is in Kbit/s. You specified 2000 which would boil down to 2Mbit/s. Tried using lower values?


----------



## cwf-ml (Aug 26, 2017)

Yes I tried lower values (no use either). 
And 2 Mbit/s is exactly what I wanted the limit to be.


----------



## ShelLuser (Aug 26, 2017)

cwf-ml said:


> And 2 Mbit/s is exactly what I wanted the limit to be.


This I don't understand, because earlier you said that 1.1Mbit/s was gobbling up the full bandwith.

I can't help think that you might be confusing the speed indications and therefor need to use lower values. Because I can assure you (from personal experience) that -l definitely works.


----------



## Chris236 (Aug 29, 2017)

ShelLuser said:


> This I don't understand, because earlier you said that 1.1Mbit/s was gobbling up the full bandwith.
> 
> I can't help think that you might be confusing the speed indications and therefor need to use lower values. Because I can assure you (from personal experience) that -l definitely works.



See the first post: it says " but it keeps using up the full 10Mbit, showing 1.1MByte/sec transfer"
Which is, give or take some overhead, the equiavlent of 10Mbit.  Bit != Byte. 

The question is still open.


----------



## usdmatt (Aug 29, 2017)

```
# scp -l 1000 Db1 matt@192.168.100.10:~/
Password for matt@192.168.100.10:
Db1           27%   11MB 122.5KB/s   04:02 ETA
```

Hmm, just tried it on a 10.3-RELEASE machine and it definitely seems to be restricting bandwidth for me...


----------



## ShelLuser (Aug 30, 2017)

Chris236 said:


> See the first post: it says " but it keeps using up the full 10Mbit, showing 1.1MByte/sec transfer"
> Which is, give or take some overhead, the equiavlent of 10Mbit.  Bit != Byte.


I know. That's why I don't understand the OPs problem.

Re-read the first post and you'll notice that the OP used 2000 as value, and as you mentioned that accounts for around 20Mbit. Twice the bandwith the OP has, yet they concluded that -l doesn't work. That's what I don't understand.


----------



## phoenix (Aug 30, 2017)

2000 kbits/s is approx 2 Mbits/s which is approx 0.2 Mbytes/s.

If the limit was specified in kbytes/s, then you'd be correct, as 2000 kbytes/s is approx 2 Mbytes/s which is approx 20 Mbits/s.

However, the man page lists it as kbits/s.


----------



## ShelLuser (Aug 30, 2017)

I obviously need more coffee


----------

