Poor performance in serving of static files

Jürg Lehni lists at scratchdisk.com
Mon Jul 18 09:22:05 UTC 2011

Hi, and thanks for offering more tips.

I just did that, here the version I am running now, with 32 workers. Still nothing improves a bit.


nginx: nginx version: nginx/1.0.4
nginx: built by gcc 4.4.5 (Debian 4.4.5-8) 
nginx: TLS SNI support enabled
nginx: configure arguments: --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --http-log-path=/var/log/nginx/access.log --with-http_dav_module --http-client-body-temp-path=/var/lib/nginx/body --with-http_ssl_module --http-proxy-temp-path=/var/lib/nginx/proxy --with-http_stub_status_module --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --with-debug --with-http_flv_module --with-file-aio

On 18 Jul 2011, at 10:12, Maxim Dounin wrote:

> Hello!
> On Mon, Jul 18, 2011 at 09:45:22AM +0100, Jürg Lehni wrote:
>> I just did that, with no measurable improvement.
>> I am aware that delays happen on both URLs sometimes, but 
>> reloading the full site with an emptied browser cache for 
>> example takes about one second on Apache, and double on Nginx. 
>> And without having done any proper benchmarking, hitting any of 
>> these rendered type pages after that just feels much slower and 
>> less fluid on Nginx. I am really surprised!
>> And I am still wondering: Could it be that for a low traffic 
>> site, Apache could actually outperform Nginx noticeably?
> Most likely you are disk bound, thus with relatively low number of 
> connections having only 2 nginx workers to block on disks is much 
> worse than having process/thread per connection as in Apache case.  
> Adding more workers may help.
> You may also want to try file AIO[1].  But it may actually degrade 
> performance as it looks like you are using Linux and under Linux 
> it's not possible to use AIO without directio (i.e. filesystem cache 
> won't work as a result).
> [1] http://wiki.nginx.org/HttpCoreModule#aio
> Note that you may need to recompile nginx with file AIO support, 
> i.e. use "./configure --with-file-aio".
> Maxim Dounin
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx

More information about the nginx mailing list