LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How can i limit the bandwidth of application? (like CURL) (https://www.linuxquestions.org/questions/linux-networking-3/how-can-i-limit-the-bandwidth-of-application-like-curl-520067/)

sharon179 01-17-2007 03:27 AM

How can i limit the bandwidth of application? (like CURL)
 
HI!

WHat is the best way (and easy :-) to limit the bandwidth of linux application?

For example:

I want that, when using FTP (with "curl" client) , and using a Gbit card, to limit the bandwidth just to 300 Mbit.

???

unSpawn 01-17-2007 05:38 AM

Hello and welcome to LQ.

First of all, "best" and "easy" are terms relative to your experience so YMMV(VM). Secondly (expectation-wise) AFAIK there is no "good" way to limit inbound traffic (but do check the LARTC site) since you have no direct control over what is sent to you. And apps that support "rate limiting" like 'wget' do this in (IIRC) a "crude" way by using 'usleep' ('man wget'). In short you can *try* to shape inbound by shaping outbound traffic since you control that. In short you set up your ehternet device with a longer queue length, set up iptables rules to divide traffic any way you want (modules for network, owner, sid, whatever is available to you) and mark them, and then use 'tc' (iproute2 package) to add some rules which take the marks as dividers. I'm pretty sure this topic has been beaten to death and way beyond so a wee search of LQ should unearth interesting threads and possibly (pointers to) scripts. Else there's shaper scripts at the LARTC site, SourceForge.net or Freshmeat.net.


All times are GMT -5. The time now is 10:16 PM.