summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorOlivier Brunel <jjk@jjacky.com>2016-08-16 20:32:02 +0200
committerDaniel Stenberg <daniel@haxx.se>2016-09-04 13:11:23 +0200
commit4b86113f5ed66270364738a351ebb5bb23cd0882 (patch)
tree46e47059805dc88774d9a29e5210c6496e031c37 /docs
parent85e5ebe75f8432333a53832d7acd0ebd65ae2506 (diff)
downloadcurl-4b86113f5ed66270364738a351ebb5bb23cd0882.tar.gz
speed caps: not based on average speeds anymore
Speed limits (from CURLOPT_MAX_RECV_SPEED_LARGE & CURLOPT_MAX_SEND_SPEED_LARGE) were applied simply by comparing limits with the cumulative average speed of the entire transfer; While this might work at times with good/constant connections, in other cases it can result to the limits simply being "ignored" for more than "short bursts" (as told in man page). Consider a download that goes on much slower than the limit for some time (because bandwidth is used elsewhere, server is slow, whatever the reason), then once things get better, curl would simply ignore the limit up until the average speed (since the beginning of the transfer) reached the limit. This could prove the limit useless to effectively avoid using the entire bandwidth (at least for quite some time). So instead, we now use a "moving starting point" as reference, and every time at least as much as the limit as been transferred, we can reset this starting point to the current position. This gets a good limiting effect that applies to the "current speed" with instant reactivity (in case of sudden speed burst). Closes #971
Diffstat (limited to 'docs')
-rw-r--r--docs/curl.14
-rw-r--r--docs/libcurl/opts/CURLOPT_MAX_RECV_SPEED_LARGE.35
-rw-r--r--docs/libcurl/opts/CURLOPT_MAX_SEND_SPEED_LARGE.36
3 files changed, 5 insertions, 10 deletions
diff --git a/docs/curl.1 b/docs/curl.1
index f0ce3a791..7a6cbbd5a 100644
--- a/docs/curl.1
+++ b/docs/curl.1
@@ -1024,10 +1024,6 @@ The given speed is measured in bytes/second, unless a suffix is appended.
Appending 'k' or 'K' will count the number as kilobytes, 'm' or M' makes it
megabytes, while 'g' or 'G' makes it gigabytes. Examples: 200K, 3m and 1G.
-The given rate is the average speed counted during the entire transfer. It
-means that curl might use higher transfer speeds in short bursts, but over
-time it uses no more than the given rate.
-
If you also use the \fI-Y, --speed-limit\fP option, that option will take
precedence and might cripple the rate-limiting slightly, to help keeping the
speed-limit logic working.
diff --git a/docs/libcurl/opts/CURLOPT_MAX_RECV_SPEED_LARGE.3 b/docs/libcurl/opts/CURLOPT_MAX_RECV_SPEED_LARGE.3
index 031f2cd39..c99ff61e3 100644
--- a/docs/libcurl/opts/CURLOPT_MAX_RECV_SPEED_LARGE.3
+++ b/docs/libcurl/opts/CURLOPT_MAX_RECV_SPEED_LARGE.3
@@ -31,9 +31,8 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_MAX_RECV_SPEED_LARGE,
curl_off_t speed);
.SH DESCRIPTION
Pass a curl_off_t as parameter. If a download exceeds this \fIspeed\fP
-(counted in bytes per second) on cumulative average during the transfer, the
-transfer will pause to keep the average rate less than or equal to the
-parameter value. Defaults to unlimited speed.
+(counted in bytes per second) the transfer will pause to keep the speed less
+than or equal to the parameter value. Defaults to unlimited speed.
This option doesn't affect transfer speeds done with FILE:// URLs.
.SH DEFAULT
diff --git a/docs/libcurl/opts/CURLOPT_MAX_SEND_SPEED_LARGE.3 b/docs/libcurl/opts/CURLOPT_MAX_SEND_SPEED_LARGE.3
index c2c6336f1..7f3efe57c 100644
--- a/docs/libcurl/opts/CURLOPT_MAX_SEND_SPEED_LARGE.3
+++ b/docs/libcurl/opts/CURLOPT_MAX_SEND_SPEED_LARGE.3
@@ -31,9 +31,9 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_MAX_SEND_SPEED_LARGE,
curl_off_t maxspeed);
.SH DESCRIPTION
Pass a curl_off_t as parameter with the \fImaxspeed\fP. If an upload exceeds
-this speed (counted in bytes per second) on cumulative average during the
-transfer, the transfer will pause to keep the average rate less than or equal
-to the parameter value. Defaults to unlimited speed.
+this speed (counted in bytes per second) the transfer will pause to keep the
+speed less than or equal to the parameter value. Defaults to unlimited
+speed.
This option doesn't affect transfer speeds done with FILE:// URLs.
.SH DEFAULT