Aptitude - The devourer of worlds...Er, bandwidth
April 5, 2010 - 5:18pm EDT
I've recently started work in an office where there's no terrestrial ethernet, and as a matter of necessity we all use the same pair of wireless routers. As one might expect, bandwidth quickly becomes an issue, and in the course of setting up various VMs (ie: my development environments) I noticed that Ubuntu's aptitude package manager loves it's self some downstream. Om nom nom.
In an effort to make nice with my new co-workers and not constantly kill the office's wifi, I scoured the internet and found a simple method to limit apt's consumption of downstream bandwidth.
Get thee back
Like many *nix technologies, Aptitude loads all its config files from a specific directory. So all we need to do to globally limit downstream is to create the following file:
sudo vi /etc/apt/apt.conf.d/76download
And in that file, we put the following:
Acquire
{
Queue-mode "access";
http
{
Dl-Limit "30";
};
};
This will limit its downstream usage to roughly 30 kilobytes/s across the board.
Exceptions to the rule
But what if we're working after-hours and no one else is here to care if we use up all the downstream? Then we just override the Acquire::http::Dl-Limit option for a specific instance:
sudo apt-get -o Acquire::http::Dl-Limit=9000 upgrade