Thanks for the feedback guys.<br><br>Apart from turning gzip_static, I did what you guys suggested and I'm up to consistently 3900 Requests/Second in benchmarking.<br>Possibly with gzip_static, I can break the 4000 mark. Thanks guys !<br>
<br><div class="gmail_quote">On Sat, Apr 5, 2008 at 4:51 AM, Igor Sysoev <<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">On Sat, Apr 05, 2008 at 03:55:47AM +0000, Amer wrote:<br>
<br>
> I wanted to run a particular configuration by you guys to get your thoughts. I'm<br>
> moving from lighttpd to nginx.<br>
><br>
> First a little bit of background. The site is a single server running FreeBsd.<br>
> It's a Dual Processor Quad Core Xeon 5310 1.60GHz (Clovertown) with a 2 x 8MB<br>
> cache and 4 GB RAM. The site serves only static content. There is absolutely<br>
> zero dynamic content. No databases involved. Each static file is about 50 kb.<br>
><br>
> I get about 3000-3500 requests/second with lightpd and with my initial setup of<br>
> nginx I get about the same. While I'm happy with this I used a very simple<br>
> config file and just wanted to see if the experienced folks over here could<br>
> point out some things that might be able to boost that up even further. It's<br>
> very simple and short (just about 20 lines) and I hope some of you could give me<br>
> some advise to get more performance (if possible).<br>
><br>
> ----------------------------------------------<br>
><br>
> worker_processes 4;<br>
><br>
> events {<br>
> worker_connections 1024;<br>
> }<br>
><br>
> http {<br>
> include mime.types;<br>
> default_type application/octet-stream;<br>
><br>
> sendfile on;<br>
> tcp_nopush on;<br>
><br>
> keepalive_timeout 65;<br>
><br>
> gzip on;<br>
> gzip_types text/plain text/html text/css application/x-javascript<br>
> text/xml application/xml application/xml+rss ext/javascript;<br>
><br>
> server {<br>
> listen 80;<br>
> server_name localhost;<br>
><br>
> location / {<br>
> root /usr/local/www/data;<br>
> index indexd12.html;<br>
> }<br>
><br>
> error_page 404 /404.html;<br>
><br>
> }<br>
> }<br>
<br>
</div></div>As it was suggested, try to use gzip_static.<br>
<br>
Also, remove unused MIME types from gzip_types.<br>
There is no application/xml, application/xml+rss, and ext/javascript<br>
in default miem.types. The gzip modules tests Content-Type sequentially,<br>
so the shorter list is the better.<br>
<br>
You may need to increase worker_connections, 1024 mean that you are<br>
able to handle 4*1024 connections only. You also need to increase<br>
number of files, sockets, etc in kernel.<br>
<br>
If you do not need access_log, you may set it off.<br>
Or, you may use buffered log:<br>
<br>
http {<br>
<br>
access_log /path/to/log buffer=32k;<br>
<br>
Also you may marginally decrease number of syscalls using:<br>
<br>
timer_resolution 100ms;<br>
<br>
And finally use open file descriptor cache to decrease number of<br>
open()/stat()/close() syscalls:<br>
<br>
http {<br>
<br>
open_file_cache max=10000 inactive=20s;<br>
open_file_cache_valid 30s;<br>
open_file_cache_min_uses 2;<br>
open_file_cache_errors on;<br>
<br>
<br>
However, I do not think that all these settings will result in more<br>
requests/seconds in your environment.<br>
<font color="#888888"><br>
<br>
--<br>
Igor Sysoev<br>
<a href="http://sysoev.ru/en/" target="_blank">http://sysoev.ru/en/</a><br>
<br>
</font></blockquote></div><br>