<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On 16 Aug 2007, at 11:16, somebody nobody wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite">i have tested nginx and apache with the "ab" tool. This is my results:<BR><BR>Apache:<BR> Requests per second: 6058.62 [#/sec]<BR><BR><BR>Nginx:<BR> Requests per second: 1170.02 [#/sec] <BR></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Umm, what kind of request profile did you send from ab? What kinds of resources are being requested?</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I find nginx to be noticeably faster than apache on static files with serial requests, and many times faster using high levels of concurrency. For dynamic requests to PHP over FastCGI/tcp, it's also faster, has better concurrency and uses very significantly less system resources. </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>On a dual-core 2ghz xeon with 4GB RAM nginx served nearly 500k PIs of a site with a ~1mb home page weight (yes, i know ;-) - designers ...) in one day without ever swapping and without system load going above 2. Just trying to mimic that load using ab against Apache brought the machine to its knees in minutes. Turning up the concurrency on ab causes Apache to starting eating RAM and CPU like nobody's business, whereas nginx handles it smoothly and quietly.</DIV><BR><BLOCKQUOTE type="cite">this is my nginx.conf:<BR><BR>@@@@@<BR><BR>user nobody nogroup;<BR>worker_processes 10;<BR class="khtml-block-placeholder"></BLOCKQUOTE><BLOCKQUOTE type="cite"><BR></BLOCKQUOTE><BLOCKQUOTE type="cite">error_log logs/error.log;<BR>pid logs/nginx.pid;<BR><BR>events {<BR> worker_connections 512;<BR> use eventport; #sol 10+ <BR>}<BR></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I'm relatively new to nginx but on the site mentioned above I run 2 worker processes with 8192 worker_connections.</DIV><BR><BLOCKQUOTE type="cite">http {<BR> include conf/mime.types;<BR> default_type application/octet-stream;<BR><BR> log_format main '$remote_addr - $remote_user [$time_local] $request '<BR> '"$status" $body_bytes_sent "$http_referer" ' <BR> '"$http_user_agent" "$http_x_forwarded_for"';<BR><BR> access_log logs/access.log main;<BR><BR> sendfile off;<BR> tcp_nopush on;<BR> tcp_nodelay on; <BR> keepalive_timeout 65;<BR></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>This is interesting ... I use keepalive_timeout of 4 or 5 seconds</DIV><BR><BLOCKQUOTE type="cite"> #gzip on;<BR> <BR> root /home/mywebsite;<BR> index index.php;<BR> <BR> client_max_body_size 128k;<BR> client_body_buffer_size 128k;<BR><BR> server {<BR> listen 80;<BR> server_name <A href="http://www.mywebsite.com">www.mywebsite.com</A>;<BR><BR> #access_log off;<BR><BR> #<BR> # PHP<BR> # <BR> <BR> location / { <BR> client_max_body_size 128k;<BR> client_body_buffer_size 128k;<BR><BR> root /home/mywebsite;<BR> index index.php index.html;<BR> }<BR><BR> location ~ \.php$ { <BR> include /nginx/conf/fcgi.conf; <BR> fastcgi_pass unix:/tmp/fastcgi.socket;<BR> fastcgi_index index.php;<BR> } <BR><BR><BR> error_page 404 /404.html; <BR> <BR> location /404.html {<BR> root /home/mywebsite;<BR> charset on;<BR> }<BR><BR>What can i do more to make it faster ??<BR></BLOCKQUOTE></DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>--</DIV><DIV>Igor Clark // POKE // 10 Redchurch Street // E2 7DD // +44 (0)20 7749 5355 // <A href="http://www.pokelondon.com">www.pokelondon.com</A></DIV></SPAN></SPAN></SPAN><DIV><BR class="khtml-block-placeholder"></DIV></SPAN><DIV>We've gone sub-zero with the TopGear Cool Wall: <A href="http://www.topgear.com/coolwall/">http://www.topgear.com/coolwall/</A></DIV><BR class="Apple-interchange-newline"></SPAN></SPAN></SPAN> </DIV><BR></BODY></HTML>