$request_time meaning

Francis Daly francis at daoine.org
Tue Nov 22 22:44:41 UTC 2011

> > On Mon, Nov 21, 2011 at 08:41:15PM +0200, Calin Don wrote:
> On Mon, Nov 21, 2011 at 20:55, Maxim Dounin <mdounin at mdounin.ru> wrote:
On Tue, Nov 22, 2011 at 11:52:29PM +0200, Calin Don wrote:

Hi there,

> > > How is the $request_time calculated in the case of a proxied request. I'm
> > > interested especially in the case where the resource is stale in cache.
> >
> > $request_time is always time since start of the request (when
> > first bytes are read from client) till end of the request (when
> > last bytes are sent to client and logging happens).

> So the time spent doing a post_action is added to $request_time or not?

It seems straightforward enough to test.

Define a post_action in a location of (for example) a php script which
does sleep(3), then see if $request_time is 3 seconds bigger in that
location than elsewhere.

When I try it in a location which just serves static files, I do see
$request_time = 3.002 in access.log.

You can do the same in your stale-in-cache location.

Good luck,

Francis Daly        francis at daoine.org

More information about the nginx mailing list