Red Hat Bugzilla – Bug 998263
"throttle" option does not work
Last modified: 2013-08-19 07:56:33 EDT
Description of problem:
It works with max_connections=1 but that is neither documented nor useful.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
echo throttle=200k >>/etc/yum.conf
250KB/s (physical limit of my link).
With throttle=20k one gets 20KB * number of concurrent downloads speed.
Yes, throttle translates to per-connection speed limits. I'll update the documentation. Package downloads are mostly independent, there's no other way to throttle the total speed than using "thorttle" and "max_connections" simultaneously. What's wrong with max_connections=1? It solves your problem, I assume.
It is a bug, it can be only WONTFIXed if you wish so.
User really does not care about limit per connection when the number of connections is random. User cares about the total data rate of all the connections together.
max_connections=1 is a poor workaround as I get commonly only for example 50KB/s from a single site.
I'm curious how you'd want to "fix" this.. Yes, the code that estimates the total data rate is there (it does not run when progress display is off, but that's not the biggest problem here). The interface between downloaders and the parent process is now mostly one-directional (progress updates to the parent process). Assume we'll make it duplex, and send the scale factor down when the total data rate exceeds the throttle option. Assume that curl does not break when the MAX_RECV_SPEED_LARGE option changes randomly during a transfer, and the feedback loop will be stable.
THEN it will work. But there are too many assumptions, and the effort/gain factor seems too hight to me. Using a properly tuned traffic contol script is so much easier, and more appropriate.
It may have implementation problems but with the current state of code it may be for example best to enforce max_connections=1 when throttle is set, with some warning (if max_connections=1 was not set explicitly).
IMO, explicit is better than implicit.. Eg one might want to allow 1-2 connections, each throttled at 100kbps, and this change would render that setup impossible.