cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Making sense of CURLINFO_*_TIME values

From: Peter Schwartz <peter+curl-library_at_spotfront.com>
Date: Thu, 1 Aug 2013 19:58:17 -0400

I've started logging all of the CURLINFO_*_TIME values, and so far,
the data doesn't contradict my assumptions (excerpted from my original
email below). That said, I'm merely a user of libcurl and know nothing
of its inner workings, so I'm hoping someone more knowledgeable can
confirm or correct these assumptions, which I based primarily on my
reading of the official documentation.

Thank you,

Peter

> 1. CURLINFO_NAMELOOKUP_TIME is the time it takes from the start of a
> transaction until the client has resolved the DNS for the remote host,
> but has not yet opened a TCP connection.
>
> 2. CURLINFO_CONNECT_TIME is the time it takes from the start of a
> transaction until the client has opened a TCP connection, but has not
> yet sent its HTTP request.
>
> 3. CURLINFO_APPCONNECT_TIME is the time it takes from the start of a
> transaction until the client has completed any SSL
> handshaking/negotiation, but has not yet sent its HTTP request.
>
> 4. CURLINFO_APPCONNECT_TIME is 0 for any plain HTTP--as opposed to
> HTTPS--transactions.
>
> 5. CURLINFO_PRETRANSFER_TIME is the time it takes from the start of a
> transaction until the client has finished sending its HTTP request,
> but has not yet received the first byte of the response.
>
> 6. CURLINFO_STARTTRANSFER_TIME is the time it takes from the start of
> a transaction until the client has received the first byte of the
> response.
>
> 7. The result of (CURLINFO_TOTAL_TIME - CURLINFO_REDIRECT_TIME) is
> the time the transaction providing a non-redirect response ultimately
> took.
>
> 8. The result of (CURLINFO_STARTTRANSFER_TIME -
> CURLINFO_PRETRANSFER_TIME) is the time it takes for the remote host to
> prepare and send at least the first byte of the response, and for the
> client to receive the first byte.
>
> 9. The result of (CURLINFO_STARTTRANSFER_TIME -
> CURLINFO_PRETRANSFER_TIME) is the best approximation a client can get
> of latency in the server's response, but as Daniel Stenberg points out
> in http://curl.haxx.se/mail/archive-2002-12/0066.html, there are a lot
> of factors at play, many of which aren't under the remote host's
> control.
>
> 10. If there are any HTTP redirects, the entire time that it takes for
> those redirects to be processed (the loop of DNS resolved, TCP
> connection opened, HTTP request transferred, and HTTP response
> received) is included in CURLINFO_REDIRECT_TIME, which is added to
> CURLINFO_TOTAL_TIME. All of the other times keyed to the beginning of
> the transaction (NAMELOOKUP, CONNECT, APPCONNECT, PRETRANSFER,
> STARTTRANSFER) are reset to 0 when all the redirects have been
> followed.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-08-02