controlling the download transfer rate while updating a system

H.S. hs.samix at gmail.com
Fri Feb 13 22:18:48 UTC 2009


NoOp wrote:
> 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.
> 
> 
> 
> 


Thanks a ton for your feedback. Much appreciated.
->HS

-- 

Please reply to this list only. I read this list on its corresponding
newsgroup on gmane.org. Replies sent to my email address are just
filtered to a folder in my mailbox and get periodically deleted without
ever having been read.





More information about the ubuntu-users mailing list