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.