Bug 1047758

Summary: throttling the download speeds
Product: [Fedora] Fedora Reporter: Ales Kozumplik <akozumpl>
Component: librepoAssignee: Tomas Mlcoch <tmlcoch>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: jzeleny, tmlcoch
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: librepo-1.6.0-1.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-06 08:19:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1045737    

Description Ales Kozumplik 2014-01-02 07:40:22 UTC
we have a report against DNF to support throttling the download speeds (by specifying maximum data amount/second). Would it be possible to add a support for this in librepo? It's obviously a low prio.

Comment 1 Tomas Mlcoch 2014-01-03 13:58:26 UTC
Hi Ales,
no problem. In fact, the support is already implemented (the LRO_MAXSPEED option).

But I've just done a little modification:

Before the version 1.5.1 this limitation was applied per download.
  For example: If you set LRO_MAXSPEED to 600 000 byte/sec and had 4 simultaneous downloads permitted (LRO_MAXPARALLELDOWNLOADS), each was limited to 600 000  byte/sec (2 400 000 byte/sec in total).

Since 1.5.1 (currently in rawhide and f20-testing), Librepo considers LRO_MAXSPEED as the accumulated speed of all downloads in a related call (lr_perform()/lr_download_packages()/...).
  For example: If you set LRO_MAXSPEED to 600 000 byte/sec and have 4 simultaneous downloads permitted, each is limited to 150 000 byte/sec (in case that all 4 download slots are used), if only one is used, it has granted the whole capacity (600 000 byte/sec), etc. <- IMHO this approach is much better

Comment 2 Ales Kozumplik 2014-01-03 14:40:39 UTC
yes, that's what makes more sense. Thanks!

Comment 3 Fedora Update System 2014-02-25 08:39:07 UTC
librepo-1.6.0-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/librepo-1.6.0-1.fc20

Comment 4 Fedora Update System 2014-02-26 14:00:40 UTC
Package librepo-1.6.0-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing librepo-1.6.0-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-3120/librepo-1.6.0-1.fc20
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2014-03-06 08:19:16 UTC
librepo-1.6.0-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.