Adding asynchronous logging

Shawn J. Goff shawgoff at
Mon Apr 27 19:19:09 UTC 2015

I have been doing some load tests against Nginx and have found 
significant client-side latency outliers at the 99.9th percentile. 
During the load test, I'm looking at iostat and it's showing me mostly 
zero utilization. When I log to a tmpfs instead, the outliers go away. 
When I use buffer=32M, the outliers come much less frequently. This 
leads me to believe that the synchronous write in the 
ngx_http_log_module is contributing to the latency as the worker threads 
can't accept until they're done writing.

I'm considering adding asynchronous logging to the module and wanted 
input. So far, I planning on using aio and would like to know if this is 
a bad idea or not. I saw recently that the aio module was deprecated, 
but I'm not sure why.

Shawn J. Goff

More information about the nginx-devel mailing list