$request_time meaning

Maxim Dounin mdounin at mdounin.ru
Wed Nov 23 12:39:51 UTC 2011


Hello!

On Wed, Nov 23, 2011 at 01:25:46PM +0200, Calin Don wrote:

> So it is safe to use post_action then?
> I'm relying on it to serve cached response for users and update cache entry
> in background if needed, so that users get most of the time a cache hit.

It's not expected to cause crashes and/or protocol violations.  It 
may have unexpected side effects though (e.g. it delays processing 
of further requests in the connection, as I alredy outlined 
below).

> Is there a cleaner way to do this?

The way I would recommend is to use "tail -F /path/to/log | 
<script which does HEAD requests to update needed cache entries>".

Maxim Dounin

> 
> On Wed, Nov 23, 2011 at 11:57, Maxim Dounin <mdounin at mdounin.ru> wrote:
> 
> > Hello!
> >
> > On Tue, Nov 22, 2011 at 11:52:29PM +0200, Calin Don wrote:
> >
> > > So the time spent doing a post_action is added to $request_time or not?
> >
> > Added.
> >
> > In general, post_action is a dirty hack which works in context of
> > a request.  It delays all processing of the request (i.e. logging)
> > as well as processing of furhter requests in the connection in
> > question (if any).  This is one of the reasons why post_action
> > isn't documented, BTW.
> >
> > Maxim Dounin
> >
> > >
> > > On Mon, Nov 21, 2011 at 20:55, Maxim Dounin <mdounin at mdounin.ru> wrote:
> > >
> > > > Hello!
> > > >
> > > > On Mon, Nov 21, 2011 at 08:41:15PM +0200, Calin Don wrote:
> > > >
> > > > > Hi,
> > > > > 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).
> > > >
> > > > Maxim Dounin
> > > >
> > > > _______________________________________________
> > > > nginx mailing list
> > > > nginx at nginx.org
> > > > http://mailman.nginx.org/mailman/listinfo/nginx
> > > >
> >
> > > _______________________________________________
> > > nginx mailing list
> > > nginx at nginx.org
> > > http://mailman.nginx.org/mailman/listinfo/nginx
> >
> > _______________________________________________
> > nginx mailing list
> > nginx at nginx.org
> > http://mailman.nginx.org/mailman/listinfo/nginx
> >

> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx



More information about the nginx mailing list