Apache documentation says %D can be used in log formats to show:

The time taken to serve the request, in microseconds.

However it's not clear to me what this means. Does it include duration of request and/or duration of response?

I'm trying to work out how long it takes to deliver a page, not dependant on network latency or bandwidth.


Several questions here - and rather confused terminology.

how long it takes to deliver a page, not dependant on network latency or bandwidth

But how long it takes to deliver a page is all about network latency and bandwidth. Also, the webserver has no concept of "pages" - only URLs - typically a page as view in a browser will be composed from multiple URLs, hopefully some of them will be cached. While there are some very expensive tools which try to derive page load times serverside, I've yet to see one which works well with caching and/or PRG.

%D logs the time between Apache starting to process a request (i.e. I believe it omits the handshake) and offloading it completely onto the local TCP stack.

You cannot measure just the time it takes to process the request and compose the response.

There is an Apache module which allows you to record when the response started - but that's only an indicator of when the complete response was available.

OTOH, if you use a reverse proxy close to the webserver, the network overhead will be minimal.

But this is still talking about URLs - not pages.

If you want to measure page response times, then take a look at episodes / yahoo boomerang / HTML5's webtiming API

Note that these are all about measuring end user experience - so the metrics are affected by the network. Boomerang incorporates functionality to measure baseline network perfromance.

  • "how long it takes to deliver a page" - wording from ancient times, when many pages consisted of single HTTP request. This is now true only in cr.yp.to domain. – filiprem Jul 21 '14 at 21:10

«The time taken to serve the request» means the following: if Apache handles the request for a 1 second, and the client will download the answer 10 seconds, it will write to log "10 seconds". if nginx put in front of apache, then «The time taken to serve the request» just to be equal to the time of processing the request because the nginx very quickly picks up the response from apache, and then gives himself hurrying to the client.

  • I have had a play with this just now, and cannot reproduce this behaviour. Are you sure? – SuperBOB Jun 29 '11 at 14:37
  • 1
    I checked. My version is really correct. Apache writes to the log time of the request by the client. – Aleksandr Makhov Jun 29 '11 at 20:59
  • So its including the length of time it takes to transmit the page to the client as described in your original answer? To test this use a machine outside the LAN and perhaps saturate the connection to increase the length of time this process takes. – SuperBOB Jun 30 '11 at 9:49

I think its what your after, its the time it takes apache to generate the page not to serve it to a client.

  • Just simply not the case. – covener Jul 3 '11 at 17:32
  • It is the case. I even went to the trouble of testing it. Its the time it takes apache to pass the page to the local network stack, it is not affected by latency between client and server. – SuperBOB Jul 4 '11 at 12:48
  • Your test might not have accounted for it, but the amount of time it takes Apache to be able to pass the complete response to the stack is a function of how fast the client reads it. There aren't unbounded TCP buffers. – covener Jul 4 '11 at 17:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.