Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

%D field in Apache access logs - first or last byte?

The Apache Httpd manual has a section on custom access log formats. One of these options is the %D field, which is documented as

The time taken to serve the request, in microseconds.

Can anyone tell me what exactly this is measuring? Is it time-to-first-byte, or time-to-last-byte, for example, or something more complex than that?

I need this is demonstrate compliance to performance requirements, and I want to know exactly what's being measured here.

like image 817
skaffman Avatar asked Jan 19 '11 12:01

skaffman


People also ask

How do I read Apache log files?

Using Terminal Commands to Display Local Access Logs By default, you can find the Apache access log file at the following path: /var/log/apache/access. log. /var/log/apache2/access.

How do I change the Apache access log format?

Log Format In Linux, Apache commonly writes logs to the /var/log/apache2 or /var/log/httpd directories depending on your OS and Virtual Host overrides. You can also define a LogFormat string after the filename, which will only apply the format string to this file.

Which of the following parameters in the common log format of Apache represents the client's IP address?

%h – Remote host (client IP address) %l – User identity, or dash, if none (often not used) %u – Username, via HTTP authentication, or dash if not used. %t – Timestamp of when Apache received the HTTP request.

What are the two types of log files Apache keeps?

Types of Apache Log There are two types of logs produced by Apache: Access logs and Error logs. The access log keeps track of the requests that come into the webserver. This data could include what pages visitors are looking at, the status of requests, and how long it took the server to respond.


1 Answers

It's the last byte or rather, apr_time_now() - request_rec->request_time which is worked out during the logging phase. That phase happens last in the processing cycle, after the response has been sent.

like image 92
noodl Avatar answered Oct 21 '22 11:10

noodl