Is there a way in Linux to give a specific application more/less priority for network bandwidth? Something like how nice
does for CPU priority.
Context: I'm currently on a very low bandwidth connection (3G dongle). While I'm performing a quite large upgrade using aptitude
, it becomes virtually impossible to browse the web since the upgrade download is hogging my Internet connection.
So what I would like to do is somehow decrease the network bandwidth priority of the aptitude
process (and all its children) so that it won't use too much bandwidth while another process is using it.
Best Answer
You can use force_bind to set a priority for all sockets of an application, and then, using Linux QoS (tc command), you can assign applications to a priority band. Check the README file for an example.
Disclaimer: I am the author.
Example:
Of course, you may use htb or any other qdisc.