<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d4684235500622716427\x26blogName\x3dCaiwangqin\x27s+blog\x26publishMode\x3dPUBLISH_MODE_HOSTED\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttp://blog.caiwangqin.com/search\x26blogLocale\x3dzh_CN\x26v\x3d2\x26homepageUrl\x3dhttp://blog.caiwangqin.com/\x26vt\x3d3393395200455623441', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Caiwangqin's blog

Focus on Cloud Service, Smart Hardware, Architecture, Technic and beyond…

Apache+Mongrel cluster vs Nginx+Mongrel cluster

2007年12月31日星期一

以下是相同服务器(PC)下,相同配置的Mongrel cluster测试后的结果。

Apache:






debian:~# httperf –port 80 –server 192.168.1.7 –num-conns 30 –uri /
httperf –client=0/1 –server=192.168.1.7 –port=80 –uri=/ –send-buffer=4096
–recv-buffer=16384 –num-conns=30 –num-calls=1
Maximum connect burst length: 1

Total: connections 30 requests 30 replies 30 test-duration 2.085 s

Connection rate: 14.4 conn/s (69.5 ms/conn, <=1 concurrent connections)
Connection time [ms]: min 42.9 avg 69.5 max 189.5 median 45.5 stddev 47.5
Connection time [ms]: connect 0.1
Connection length [replies/conn]: 1.000

Request rate: 14.4 req/s (69.5 ms/req)
Request size [B]: 64.0

Reply rate [replies/s]: min 0.0 avg 0.0 max 0.0 stddev 0.0 (0 samples)
Reply time [ms]: response 69.2 transfer 0.2
Reply size [B]: header 284.0 content 16728.0 footer 0.0 (total 17012.0)
Reply status: 1xx=0 2xx=30 3xx=0 4xx=0 5xx=0

CPU time [s]: user 0.19 system 1.75 (user 9.2% system 84.0% total 93.2%)
Net I/O: 239.9 KB/s (2.0*10^6 bps)

Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0
Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0





Nginx:






debian:~# httperf –port 81 –server 192.168.1.7 –num-conns 30 –uri /
httperf –client=0/1 –server=192.168.1.7 –port=81 –uri=/ –send-buffer=4096
–recv-buffer=16384 –num-conns=30 –num-calls=1
Maximum connect burst length: 1

Total: connections 30 requests 30 replies 30 test-duration 2.030 s

Connection rate: 14.8 conn/s (67.7 ms/conn, <=1 concurrent connections)
Connection time [ms]: min 42.4 avg 67.7 max 160.1 median 44.5 stddev 45.2
Connection time [ms]: connect 0.1
Connection length [replies/conn]: 1.000

Request rate: 14.8 req/s (67.7 ms/req)
Request size [B]: 64.0

Reply rate [replies/s]: min 0.0 avg 0.0 max 0.0 stddev 0.0 (0 samples)
Reply time [ms]: response 67.5 transfer 0.1
Reply size [B]: header 282.0 content 16728.0 footer 0.0 (total 17010.0)
Reply status: 1xx=0 2xx=30 3xx=0 4xx=0 5xx=0

CPU time [s]: user 0.21 system 1.77 (user 10.2% system 87.3% total 97.5%)
Net I/O: 246.4 KB/s (2.0*10^6 bps)

Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0
Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0






可以看到 Nginx 比 Apache 快 0.4 req/s , 感觉这个可以忽略不计,但从浏览器上打开看,一个有较多图片的页面,明显感觉Nginx要比Apache, 可能在静态文件的处理上,Nginx比Apache要快。


标签:

posted by Jesse Cai, 上午3:25

0 Comments:

发表评论

订阅 帖子评论 [Atom]

<< 主页