I don't know how --retry-max-time
calculated. If I download a file file.txt
:
curl --max-time 10 --retry 3 --retry-delay 5 --retry-max-time 32 'http://www.site.com/download/file.txt'
[ 0- 2]
It takes 2s
to download 50%
of the file, and no speed any more.[ 2-10]
It waits for another 8s
, still no speed, timeout, will retry[10-15]
It waits for 5s
before retry #1[15-25]
Still no speed, will retry[25-30]
It waits for 5s
before retry #2[30-34]
It takes 4s
to download 33%
of the file, and no speed any more.[34-40]
It waits for another 6s
, still no speed, timeoutWill curl
stop retry at this point(40s
)?
When was the retry timer
started and stopped?
--retry-max-time <seconds> The retry timer is reset before the first transfer attempt. Retries will be done as usual (see --retry) as long as the timer hasn't reached this given limit. Notice that if the timer hasn't reached the limit, the request will be made and while performing, it may take longer than this given time period. To limit a single request´s maximum time, use -m, --max-time. Set this option to zero to not timeout retries. (Added in 7.12.3)
Using the --retry option you can tell curl to retry certain failed transfers. If a transient error is returned when curl tries to perform a transfer, it will retry this number of times before giving up. Setting the number to 0 makes curl do no retries (which is the default).
When curl is about to retry a transfer, it will first wait one second and then for all forthcoming retries it will double the waiting time until it reaches 10 minutes which then will be the delay between the rest of the retries. By using --retry-delay you disable this exponential backoff algorithm.
curl --connect-timeout 5 \ --max-time 10 \ --retry 5 \ --retry-delay 0 \ --retry-max-time 60 \ 'http://www.site.com/download/file.txt'
|<---0---->| {<---1---->| |<---2---->| |<---3---->| |<---4---->| } |<---5---->| |....== | {...== | |....== | |.....| |..=== = | } { }
===== downloading... (file size is 5) ..... --connect-timeout 5 |<->| --max-time 10 <-5-> --retry 5 >| |< --retry-delay 0 ([default] exp backoff algo) { } --retry-max-time 60 (GAME OVER)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With