Welcome! Log In Create A New Profile

Advanced

Definition of $request_time

Posted by mef193 
Definition of $request_time
June 08, 2015 08:16PM
Hi,

Can you someone please clarify the time that is being measured as part of $request_time?

Documentation states the following:
request processing time in seconds with a milliseconds resolution; time elapsed between the first bytes were read from the client and the log write after the last bytes were sent to the client

Does this imply that it is the full round trip time which also includes network time?
Depending on speed of client/server network or network issues, could this affect the request_time?

Thanks
Re: Definition of $request_time
September 22, 2015 04:53PM
Keep in mind there are 2 variables called $request_time, one in ngx_http_core_module and another in ngx_http_log_module.

Without having looked at the code or tested it, I believe that these variables only represent elapsed time from when the first byte from the client request is read by NGINX, and stops when the request has been processed, or been processed+logged.

While I don't interpret these as including the "network round-trip time" (e.g. client in California, server in NY, RTT = ~80 msec), it may take some time for the entire blob to come in off the wire and into the NIC, be fully read by NGINX (or the kernel if sendfile is being used), and then be processed by the server application (which could be busy doing something else).

The speed of the network can definitely affect the result if the request is large, or the network is slow, or the connection suffers from loss or congestion causing TCP to re-transmit or slow down - which could be further exacerbated by the RTT.

All things being equal, the way I read it, the value is not a direct measure of the RTT, but it can be affected by crappy network conditions, the TCP stack overreacting to said conditions, as well as the application response time.

--
SuperTCP for NGINX
www.supertcp.com
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 158
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready