Linux – ny way to limit the Internet connection to a per program basis

aptitudedebianinternetlinuxUbuntu

My Linux connection is REALLY free.

I live in Brazil, so where I live I can only have 1 Mbit/s. Yes I know it's sad, but it's not the point.

Everytime I'm updating my Ubuntu 9.04 or downloading something, it does eat all my bandwidth. Like, while update-manager is downloading the packages, I can see by netspeed applet in my panel that the incoming traffic goes to 110 kB/s. And then, my Emesene suddenly goes disconnected, and I can't navigate.

As you can imagine, I can't use my Internet connection again until the packages are all downloaded or I cancel the update in the middle.

As I said, same thing happens when I'm dowloading something, but less intrusive and immediate.


The question is: is there any way to limit that APT/downloads traffic to some way I can still use my other Internet services, or to reserve some bandwidth for common navigation tasks (like we have on Windows, but I forgot this thing's name, it's like "something packages".

Best Answer

You can configure apt to restrict its download speed by setting a configuration file in /etc/apt/apt.conf.d/, as detailed in this post

Specifically, create a file:

/etc/apt/apt.conf.d/76download

that contains the text:

Acquire { Queue-mode "access"; http { Dl-Limit "65"; }; };

where "65" is the speed in kb/s

Related Question