View previous topic :: View next topic |
Author |
Message |
Fog_Watch Apprentice
Joined: 24 Jul 2006 Posts: 267 Location: Utility Muffin Research Kitchen
|
Posted: Sat Sep 16, 2017 1:53 am Post subject: Why does curl's "Time Spent" vary? |
|
|
The output of the following code:
Code: | #!/bin/bash
for i in 1 2 3 4 5
do
date && curl -o test http://mirror.exetel.com.au/pub/gentoo/distfiles/shominst-0409.zip
done
|
is
Code: | Sat Sep 16 11:45:20 AEST 2017
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9743k 100 9743k 0 0 2321 0 1:11:38 1:11:38 --:--:-- 2695k
Sat Sep 16 11:45:24 AEST 2017
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9743k 100 9743k 0 0 2321 0 1:11:38 1:11:38 --:--:-- 2670k
Sat Sep 16 11:45:28 AEST 2017
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9743k 100 9743k 0 0 3247k 0 0:00:03 0:00:03 --:--:-- 2646k
Sat Sep 16 11:45:31 AEST 2017
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9743k 100 9743k 0 0 2321 0 1:11:38 1:11:38 --:--:-- 2662k
Sat Sep 16 11:45:35 AEST 2017
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9743k 100 9743k 0 0 2321 0 1:11:38 1:11:38 --:--:-- 2662k
|
Note how the "Time Spent" varies apparently randomly from a factual 3 seconds to 1:11:38. Anyone know why?
Fog_Watch |
|
Back to top |
|
|
LIsLinuxIsSogood Veteran
Joined: 13 Feb 2016 Posts: 1179
|
Posted: Sat Sep 16, 2017 6:34 am Post subject: |
|
|
It's just a guess, not for sure but i think the times start large in order to provide an estimated download time. Could that be a factor? Of course that isn't going to explain the Time Spent! How much time would you guess, and did you happen to look in the output file to see if any signs of something going on with the calculations of number of files or something like that.
Edit/Addition:
Could you try adding a sleep 5 seconds in your script....I just ran a few tests and it does seem to make some difference in the responsiveness perhaps due to the routing and opening/closing of IP ports even. I will continue to test and research, but that is really kinda strange, and you noticed it! |
|
Back to top |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Sat Sep 16, 2017 6:43 pm Post subject: |
|
|
1:11:38 works out pretty close to exactly 2^32 microseconds + 3 seconds. Could be an overflow problem, I think it's worth filing a bug. |
|
Back to top |
|
|
Fog_Watch Apprentice
Joined: 24 Jul 2006 Posts: 267 Location: Utility Muffin Research Kitchen
|
Posted: Sun Sep 17, 2017 9:18 am Post subject: |
|
|
Ant P. wrote: | I think it's worth filing a bug. |
Enquired |
|
Back to top |
|
|
|