curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: CURLOPT_LOW_SPEED_TIME and CURLOPT_LOW_SPEED_LIMIT

From: James Read via curl-library <curl-library_at_cool.haxx.se>
Date: Wed, 10 Jun 2020 13:31:30 +0100

On Wed, Jun 10, 2020 at 9:01 AM Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Wed, 10 Jun 2020, James Read via curl-library wrote:
>
> > /* abort if slower than 30 bytes/sec during 60 seconds */
> > curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 60L);
> > curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 30L);
> >
> > What does abort if slower than 30 bytes/sec during 60 seconds mean?
>
> If the transfer speed as measure by libcurl stays below 30 bytes per
> second
> for a duration of 60 seconds, the transfer is aborted.
>
> > Is this an average speed over any given 60 second period?
>
> The transfer speed this logic uses as input is the "momentary" transfer
> speed
> - which is based on a moving average over the last 5 seconds.
>
> > I want it to abort after a given time period. Are these the options for
> me?
>
> If you want it to be a fixed time where it should stop, then
> CURLOPT_TIMEOUT
> is more suitable.
>
>
From https://curl.haxx.se/libcurl/c/CURLOPT_TIMEOUT.html :

Since this option puts a hard limit on how long time a request is allowed
to take, it has limited use in dynamic use cases with varying transfer
times. That is especially apparent when using the multi interface, which
may queue the transfer, and that time is included. You are advised to
explore CURLOPT_LOW_SPEED_LIMIT
<https://curl.haxx.se/libcurl/c/CURLOPT_LOW_SPEED_LIMIT.html>,
CURLOPT_LOW_SPEED_TIME
<https://curl.haxx.se/libcurl/c/CURLOPT_LOW_SPEED_TIME.html> or using
CURLOPT_PROGRESSFUNCTION
<https://curl.haxx.se/libcurl/c/CURLOPT_PROGRESSFUNCTION.html> to implement
your own timeout logic.

I don't want to include the queue time in the count. That's why I started
looking at CURLOPT_LOW_SPEED_LIMIT and CURLOPT_LOW_SPEED_TIME.

James Read

> --
>
> / daniel.haxx.se | Commercial curl support up to 24x7 is available!
> | Private help, bug fixes, support, ports, new features
> | https://www.wolfssl.com/contact/
>

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-06-10