Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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".

share|improve this question

2 Answers 2

up vote 16 down vote accepted

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

share|improve this answer
    
Okay, that definitely sounds better than mine... Deleting and +1 for you. –  balpha Aug 18 '09 at 11:24

For other applications with no auto bandwidth control option, you can use trickle

Example for APT with upload rate of 20 KB/s and download rate of 50 KB/s (you need sudo trickle):

sudo trickle -u 20 -d 50 aptitude dist-upgrade

Example for wget with download rate of 30 KB/s:

trickle -d 30 wget http://...

From trickle's man page:

trickle is a userspace bandwidth manager. Currently, trickle supports the shaping of any SOCK_STREAM (see socket(2)) connection established via the socket(2) interface. Furthermore, trickle will not work with statically linked executables, nor with setuid(2) executables. trickle is highly configurable; download and upload rates can be set separately, or in an aggregate fashion.

share|improve this answer
    
I don't know what to do... Your post answer my question, but previous post do solve my problem. I think I'll vote for the other, but vote up your answer =] –  Igoru Aug 19 '09 at 3:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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