controlling the download transfer rate while updating a system
NoOp
glgxg at sbcglobal.net
Fri Feb 13 20:54:46 UTC 2009
On 02/12/2009 01:32 PM, H.S. wrote:
> NoOp wrote:
>> On 02/11/2009 07:50 AM, H.S. wrote:
>>> Hello,
>>>
>>> There have been times where I have wished that I could control the
>>> download rate while the system was being updated and updates were being
>>> downloaded. Well, I discovered this on Debian user mailing list and
>>> tried it with success so I wanted to share the experience.
>>>
>>> To control the default download rate while the updates are being
>>> downloaded, make the change in /etc/apt/apt.conf (using sudo). I
>>> inserted the following lines in a machine to cap the download rate
>>> //-------------------------------------------------------------
>>> // Options for the downloading routines
>>> Acquire
>>> {
>>> // HTTP method configuration
>>> http
>>> {
>>> Dl-Limit "20"; // maximum download rate in KB/s
>>> };
>>>
>>> };
>>> //-------------------------------------------------------------
>>>
>>> Note the Dl-Limit number has units of Kilo Bytes per second.
>>
>> I think that you will need to add the queue-mode option:
>>
>> http://mirror.atrpms.net/ccrma/man/man5/apt.conf.5.html
>> <quote>
>> THE ACQUIRE GROUP
>>
>> The Acquire group of options controls the download of packages
>> and the URI handlers.
>>
>> Queue-Mode
>> Queuing mode; Queue-Mode can be one of host or access which
>> determines how APT parallelizes outgoing connections. host
>> means that one connection per target host will be opened, access
>> means that one connection per URI type will be opened.
>> </quote>
>>
>> So perhaps:
>>
>> Acquire
>> {
>> Queue-mode "access"; // host|access
>> http
>> {
>> Dl-Limit "20"; // maximum download rate in KB/s
>> };
>> };
>>
>> per suggestion:
>> http://ubuntuforums.org/showthread.php?t=20342
>>
>> I've also created a /etc/apt/apt.conf.d/76download file with that in
>> it.. now to test I'll fire up a machine that I haven't had on for a week
>> or two and see what happens.
>>
>>
>>
>
> er ... could you try with and then without the queue-mode options? You
> can use "-d" with aptitude (or apt-get) to only download and not install
> the updates. Then do "aptitude clean" to get rid of the downloads,
> toggle queue-mode option, and download the updates again and if there is
> any difference in the download bandwidth cap.
>
> Thanks.
>
Both work when used in /etc/apt/apt.conf
"Fetched 677kB in 33s (20.2kB/s)"
I can't recall where I read about using "Queue-Mode "access";" (beyond
the ubuntu forum post), I'll try to dig it up. It was something to do
with limiting the connections so that Dl-Limit didn't spawn other
connections and saturate the link.
More information about the ubuntu-users
mailing list