nginx access logs, timestamps "jump back"

Maxim Dounin mdounin at mdounin.ru
Wed Mar 16 17:25:19 MSK 2011


Hello!

On Tue, Mar 15, 2011 at 10:26:16PM -0400, assistlydavid wrote:

> Hi Maxim,
> 
> Thanks for the response.
> 
> How are the workers allocated work?  I'm still curious as to why 
> I'd see a large block of ELB-only traffic flushed to the log at 
> the same time, rather than a mix.  Any thoughts on that?

Workers accept() connections and process requests on accepted 
connections.

Depending on settings (notably accept_mutex) and number of already 
accepted connections conditions on which workers call accept() 
vary.  With accept_mutex turned on (default) it's likely that on 
underloaded servers all/most of new connections will be accepted by 
the same worker.

> Presumably, the chance of multiple workers flushing the same 
> type of log messages (ELB-only) at the same time is very low, 
> especially when we're seeing constant traffic from end-users 
> more frequently than ELB health checks.  Am I perhaps seeing all 
> ELB-only traffic flushed from the buffer of a single worker?  

Most likely health checks use single keepalive connection, and 
that's why all health checks go to the same worker.

And new client connections are currently accepted by another 
worker.

> Are workers chosen based on server/location directives?

No.

Maxim Dounin



More information about the nginx mailing list