Okay I&#39;ve crossed 4000 (consistently between 4100 and 4200) now but I had a couple of questions.<br><br>First of all, I&#39;m using <a href="http://sysoev.ru/nginx/nginx-0.6.29.tar.gz">nginx-0.6.29.tar.gz</a> from <a href="http://sysoev.ru/nginx/download.html">http://sysoev.ru/nginx/download.html</a> .. I build it from source. I don&#39;t understand the Russian on that site but it seems to me<br>
that this is a developement version? Is this stable to use in production?<br><br>Secondly I noticed something strange with gzip_static on. If I have this in my conf and I have a file indexd12.htm as well as indexd12.htm.gz in the root then even though I have<br>
indexd12.htm.gz it still picks up indexd12.htm .. However when I delete indexd12.htm , then the server rightly sends back indexdh1.htm.gz .. According to <a href="http://wiki.codemongers.com/NginxHttpGzipStaticModule">http://wiki.codemongers.com/NginxHttpGzipStaticModule</a>,<br>
the server should be sending back indexd12.htm.gz even if there is an indexd12.htm in the directory. Any thoughts?<br><br>rkmr.em, this is my final config file (I also bumped up max allowed file descriptors in freebsd kernel):<br>
<br>worker_processes&nbsp; 5;<br>timer_resolution 100ms;<br><br><br>events {<br>&nbsp;&nbsp;&nbsp; worker_connections&nbsp; 1500;<br>}<br><br><br>http {<br>&nbsp;&nbsp;&nbsp; include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mime.types;<br>&nbsp;&nbsp;&nbsp; default_type&nbsp; application/octet-stream;<br><br>&nbsp;&nbsp;&nbsp; sendfile&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on;<br>
&nbsp;&nbsp;&nbsp; tcp_nopush&nbsp;&nbsp;&nbsp;&nbsp; on;<br><br>&nbsp;&nbsp;&nbsp; keepalive_timeout&nbsp; 65;<br><br>&nbsp;&nbsp;&nbsp; gzip_static on;<br><br>&nbsp;&nbsp;&nbsp; gzip_http_version&nbsp;&nbsp; 1.1;<br>&nbsp;&nbsp;&nbsp; gzip_proxied&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; expired no-cache no-store private auth;<br>&nbsp;&nbsp;&nbsp; gzip_disable&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;MSIE [1-6]\.&quot;;<br>
&nbsp;&nbsp;&nbsp; gzip_vary&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on;<br><br>&nbsp;&nbsp; open_file_cache&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; max=10000&nbsp; inactive=20s;<br>&nbsp;&nbsp; open_file_cache_valid&nbsp;&nbsp;&nbsp; 30s;<br>&nbsp;&nbsp; open_file_cache_min_uses 2;<br>&nbsp;&nbsp; open_file_cache_errors&nbsp;&nbsp; on;<br><br>&nbsp;&nbsp;&nbsp;&nbsp; server {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; listen&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8080;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; server_name&nbsp; localhost;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; location / {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; root&nbsp;&nbsp; /usr/local/www/data;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; index&nbsp; indexd12.htm;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>}<br><br><br><br><br><br><div class="gmail_quote">On Sat, Apr 5, 2008 at 5:47 PM, <a href="mailto:rkmr.em@gmail.com">rkmr.em@gmail.com</a> &lt;<a href="mailto:rkmr.em@gmail.com">rkmr.em@gmail.com</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;">Aamer,<br>
Can you post final config that gave you 3900 reqs/second?<br>
thanks<br>
<div><div></div><div class="Wj3C7c"><br>
On Sat, Apr 5, 2008 at 1:21 PM, Amer Shah &lt;<a href="mailto:amerrahman@gmail.com">amerrahman@gmail.com</a>&gt; wrote:<br>
&gt; Thanks for the feedback guys.<br>
&gt;<br>
&gt; Apart from turning gzip_static, I did what you guys suggested and I&#39;m up to<br>
&gt; consistently 3900 Requests/Second in benchmarking.<br>
&gt; Possibly with gzip_static, I can break the 4000 mark. Thanks guys !<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; 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>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; On Sat, Apr 05, 2008 at 03:55:47AM +0000, Amer wrote:<br>
&gt; &gt;<br>
&gt; &gt; &gt; I wanted to run a particular configuration by you guys to get your<br>
&gt; thoughts. I&#39;m<br>
&gt; &gt; &gt; moving from lighttpd to nginx.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; First a little bit of background. The site is a single server running<br>
&gt; FreeBsd.<br>
&gt; &gt; &gt; It&#39;s a Dual Processor Quad Core Xeon 5310 1.60GHz (Clovertown) with a 2<br>
&gt; x 8MB<br>
&gt; &gt; &gt; cache and 4 GB RAM. The site serves only static content. There is<br>
&gt; absolutely<br>
&gt; &gt; &gt; zero dynamic content. No databases involved. Each static file is about<br>
&gt; 50 kb.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I get about 3000-3500 requests/second with lightpd and with my initial<br>
&gt; setup of<br>
&gt; &gt; &gt; nginx I get about the same. While I&#39;m happy with this I used a very<br>
&gt; simple<br>
&gt; &gt; &gt; config file and just wanted to see if the experienced folks over here<br>
&gt; could<br>
&gt; &gt; &gt; point out some things that might be able to boost that up even further.<br>
&gt; It&#39;s<br>
&gt; &gt; &gt; very simple and short (just about 20 lines) and I hope some of you could<br>
&gt; give me<br>
&gt; &gt; &gt; some advise to get more performance (if possible).<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; ----------------------------------------------<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; worker_processes &nbsp;4;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; events {<br>
&gt; &gt; &gt; &nbsp; &nbsp; worker_connections &nbsp;1024;<br>
&gt; &gt; &gt; }<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; http {<br>
&gt; &gt; &gt; &nbsp; &nbsp; include &nbsp; &nbsp; &nbsp; mime.types;<br>
&gt; &gt; &gt; &nbsp; &nbsp; default_type &nbsp;application/octet-stream;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &nbsp; &nbsp; sendfile &nbsp; &nbsp; &nbsp; &nbsp;on;<br>
&gt; &gt; &gt; &nbsp; &nbsp; tcp_nopush &nbsp; &nbsp; on;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &nbsp; &nbsp; keepalive_timeout &nbsp;65;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &nbsp; &nbsp; gzip &nbsp;on;<br>
&gt; &gt; &gt; &nbsp; &nbsp; gzip_types &nbsp; &nbsp; &nbsp;text/plain text/html text/css<br>
&gt; application/x-javascript<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text/xml application/xml application/xml+rss<br>
&gt; ext/javascript;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &nbsp; &nbsp; server {<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; listen &nbsp; &nbsp; &nbsp; 80;<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; server_name &nbsp;localhost;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; location / {<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; root &nbsp; /usr/local/www/data;<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; index &nbsp;indexd12.html;<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; error_page &nbsp;404 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/404.html;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &nbsp; &nbsp; }<br>
&gt; &gt; &gt; }<br>
&gt; &gt;<br>
&gt; &gt; As it was suggested, try to use gzip_static.<br>
&gt; &gt;<br>
&gt; &gt; Also, remove unused MIME types from gzip_types.<br>
&gt; &gt; There is no application/xml, application/xml+rss, and ext/javascript<br>
&gt; &gt; in default miem.types. The gzip modules tests Content-Type sequentially,<br>
&gt; &gt; so the shorter list is the better.<br>
&gt; &gt;<br>
&gt; &gt; You may need to increase worker_connections, 1024 mean that you are<br>
&gt; &gt; able to handle 4*1024 connections only. You also need to increase<br>
&gt; &gt; number of files, sockets, etc in kernel.<br>
&gt; &gt;<br>
&gt; &gt; If you do not need access_log, you may set it off.<br>
&gt; &gt; Or, you may use buffered log:<br>
&gt; &gt;<br>
&gt; &gt; http {<br>
&gt; &gt;<br>
&gt; &gt; &nbsp; &nbsp;access_log &nbsp; /path/to/log &nbsp;buffer=32k;<br>
&gt; &gt;<br>
&gt; &gt; Also you may marginally decrease number of syscalls using:<br>
&gt; &gt;<br>
&gt; &gt; timer_resolution &nbsp;100ms;<br>
&gt; &gt;<br>
&gt; &gt; And finally use open file descriptor cache to decrease number of<br>
&gt; &gt; open()/stat()/close() syscalls:<br>
&gt; &gt;<br>
&gt; &gt; http {<br>
&gt; &gt;<br>
&gt; &gt; &nbsp; &nbsp;open_file_cache &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;max=10000 &nbsp;inactive=20s;<br>
&gt; &gt; &nbsp; &nbsp;open_file_cache_valid &nbsp; &nbsp;30s;<br>
&gt; &gt; &nbsp; &nbsp;open_file_cache_min_uses 2;<br>
&gt; &gt; &nbsp; &nbsp;open_file_cache_errors &nbsp; on;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; However, I do not think that all these settings will result in more<br>
&gt; &gt; requests/seconds in your environment.<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; --<br>
&gt; &gt; Igor Sysoev<br>
&gt; &gt; <a href="http://sysoev.ru/en/" target="_blank">http://sysoev.ru/en/</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt;<br>
&gt;<br>
<br>
</div></div></blockquote></div><br>