Thanks for the feedback guys.<br><br>Apart from turning gzip_static, I did what you guys suggested and I&#39;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 &lt;<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>&gt; 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>
&gt; I wanted to run a particular configuration by you guys to get your thoughts. I&#39;m<br>
&gt; moving from lighttpd to nginx.<br>
&gt;<br>
&gt; First a little bit of background. The site is a single server running FreeBsd.<br>
&gt; It&#39;s a Dual Processor Quad Core Xeon 5310 1.60GHz (Clovertown) with a 2 x 8MB<br>
&gt; cache and 4 GB RAM. The site serves only static content. There is absolutely<br>
&gt; zero dynamic content. No databases involved. Each static file is about 50 kb.<br>
&gt;<br>
&gt; I get about 3000-3500 requests/second with lightpd and with my initial setup of<br>
&gt; nginx I get about the same. While I&#39;m happy with this I used a very simple<br>
&gt; config file and just wanted to see if the experienced folks over here could<br>
&gt; point out some things that might be able to boost that up even further. It&#39;s<br>
&gt; very simple and short (just about 20 lines) and I hope some of you could give me<br>
&gt; some advise to get more performance (if possible).<br>
&gt;<br>
&gt; ----------------------------------------------<br>
&gt;<br>
&gt; worker_processes &nbsp;4;<br>
&gt;<br>
&gt; events {<br>
&gt; &nbsp; &nbsp; worker_connections &nbsp;1024;<br>
&gt; }<br>
&gt;<br>
&gt; http {<br>
&gt; &nbsp; &nbsp; include &nbsp; &nbsp; &nbsp; mime.types;<br>
&gt; &nbsp; &nbsp; default_type &nbsp;application/octet-stream;<br>
&gt;<br>
&gt; &nbsp; &nbsp; sendfile &nbsp; &nbsp; &nbsp; &nbsp;on;<br>
&gt; &nbsp; &nbsp; tcp_nopush &nbsp; &nbsp; on;<br>
&gt;<br>
&gt; &nbsp; &nbsp; keepalive_timeout &nbsp;65;<br>
&gt;<br>
&gt; &nbsp; &nbsp; gzip &nbsp;on;<br>
&gt; &nbsp; &nbsp; gzip_types &nbsp; &nbsp; &nbsp;text/plain text/html text/css application/x-javascript<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text/xml application/xml application/xml+rss ext/javascript;<br>
&gt;<br>
&gt; &nbsp; &nbsp; server {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; listen &nbsp; &nbsp; &nbsp; 80;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; server_name &nbsp;localhost;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; location / {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; root &nbsp; /usr/local/www/data;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; index &nbsp;indexd12.html;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; error_page &nbsp;404 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/404.html;<br>
&gt;<br>
&gt; &nbsp; &nbsp; }<br>
&gt; }<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>
 &nbsp; &nbsp;access_log &nbsp; /path/to/log &nbsp;buffer=32k;<br>
<br>
Also you may marginally decrease number of syscalls using:<br>
<br>
timer_resolution &nbsp;100ms;<br>
<br>
And finally use open file descriptor cache to decrease number of<br>
open()/stat()/close() syscalls:<br>
<br>
http {<br>
<br>
 &nbsp; &nbsp;open_file_cache &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;max=10000 &nbsp;inactive=20s;<br>
 &nbsp; &nbsp;open_file_cache_valid &nbsp; &nbsp;30s;<br>
 &nbsp; &nbsp;open_file_cache_min_uses 2;<br>
 &nbsp; &nbsp;open_file_cache_errors &nbsp; 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>