4

Is it possible to reserve (at least so much bandwidth) or limit (no more than so much bandwidth) the network usage of certain processes or applications. Alternatively, reserve/limit the network usage of an/some user(s) and or groups?

I'm interested in...: Limiting the bandwidth of specific process (PID). Limiting the bandwidth of each process by a certain name (e.g. each instance of rtorrent could not use more than 20kb/s, but five instances could thus use 100kb/s). Limiting the usage of all instances of program (e.g. all instances of rtrorrent could use no more than 50kb/s). Limiting the usage of groups of programs - either for each and/or collectively (e.g. any - or all - web-browsers (obviously they'd be listed somewhere) could use no more than 100kb/s).

Bonus: Is it possible to place a per-computer limit? I have two coumputers sharing on Internet-connection, and sometimes one takes all the bandwidth. On the other hand, sometimes one computer uses non or very little bandwidth, so then the other obviously should be able to take all there is. I would be satisfied by setting a hard limit of about half for each; but a more dynamically approach that allowed one to take all when the other was not used, would be desirable.

I have no idea what is possible or how it may be done, which is why I'm asking.

I plagued by the web-browser timing-out, while I use wget or bittorrent-clients to download files, so I'd like to impose some limits to ensure the ability to browse.

2 Answers 2

3

There is a software called trickle that does exactly that; it is a userspace bandwidth manager/shaper.

Try

trickle -d 20 rtorrent
1

It is possible but it's very complex. For full control you need to use qdisc and iptables to 'shape' the network traffic. This 'network shaping' is one of the most advanced that it's possible to learn how to do. This website explains quite a bit of the process: http://laddumishra.wordpress.com/2011/12/27/traffic-control-using-tc-in-linuxubuntu/

For an easier time you can use Wondershaper, but it offers no options on which processes get priority and has trouble running on some versions of Ubuntu. http://lartc.org/

In conclusion, it looks like this particular functionality needs serious investment if it is ever going to become easier for users to control their network traffic in a simple way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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