Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Why does curl's "Time Spent" vary?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Fog_Watch
Apprentice
Apprentice


Joined: 24 Jul 2006
Posts: 190
Location: Utility Muffin Research Kitchen

PostPosted: Sat Sep 16, 2017 1:53 am    Post subject: Why does curl's "Time Spent" vary? Reply with quote

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
View user's profile Send private message
LIsLinuxIsSogood
Guru
Guru


Joined: 13 Feb 2016
Posts: 458

PostPosted: Sat Sep 16, 2017 6:34 am    Post subject: Reply with quote

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
View user's profile Send private message
Ant P.
Advocate
Advocate


Joined: 18 Apr 2009
Posts: 4528

PostPosted: Sat Sep 16, 2017 6:43 pm    Post subject: Reply with quote

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.
_________________
*.ebuild // /etc/service/*
Back to top
View user's profile Send private message
Fog_Watch
Apprentice
Apprentice


Joined: 24 Jul 2006
Posts: 190
Location: Utility Muffin Research Kitchen

PostPosted: Sun Sep 17, 2017 9:18 am    Post subject: Reply with quote

Ant P. wrote:
I think it's worth filing a bug.

Enquired
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum