其实之前http 2.4.1刚出来的时候就很多做对比的了。 大部分分测试表明对于静态文件而已,nginx的性能还是会稍微好些,但是event模式下的httpd比之前的性能是提升得太多太多了。httpd安装起来比较麻烦,尤其是在老掉牙的机器上。

httpd 2.4.4在RHEL 4.8的安装过程大概这样的:
  1. 下载最新的httpd 2.4.4解压,然后再下载apr-1.4.6.tar.bz2和apr-util-1.5.1.tar.bz2放到httpd目录下的srclib,解压后把文件夹更名为apr和apr-util.2.安装新版的pcre,我直接在sourceforge.net上下载的.然后编译安装pcre./configure –prefix=/opt/install/pcre-8.32 –enable-pcre32 –enable-jit –enable-utf –enable-pcre16
[sourceforge.net]( http://downloads.sourceforge.net/project/pcre/pcre/8.32/pcre-8.32.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.32%2F&ts=1362923206&use_mirror=nchc)
3.配置httpd编译./configure –prefix=/opt/install/httpd-2.4.4   –enable-rewrite    –enable-cache   –enable-ssl    –enable-static-ab    –enable-ssl   –with-included-apr  –with-pcre=/opt/install/pcre-8.32/–with-mpm=event

安装好后简单做了一个测试,0.6k的小页面。

nginx 10 25858.43 0.387httpd 10 14952.54 0.669nginx 20 27045.38 0.739httpd 20 14793.54 1.352nginx 30 28513.76 1.052httpd 30 13755.20 2.181nginx 40 26083.62 1.534httpd 40 14023.01 2.852nginx 50 27685.62 1.806httpd 50 14813.10 3.375nginx 60 26779.80 2.240httpd 60 14539.48 4.127nginx 70 26792.31 2.613httpd 70 15989.91 4.378nginx 80 28039.97 2.853httpd 80 16502.71 4.848nginx 90 26900.55 3.346httpd 90 15947.58 5.643nginx 100 38173.08 2.620httpd 100 16635.71 6.011nginx 110 28921.72 3.803httpd 110 16162.35 6.806nginx 120 25804.12 4.650httpd 120 16637.97 7.212nginx 130 26505.68 4.905httpd 130 18882.23 6.885nginx 140 29669.50 4.719httpd 140 19844.80 7.055nginx 150 28969.08 5.178httpd 150 19787.36 7.581nginx 160 27424.76 5.834httpd 160 19325.51 8.279nginx 170 28747.23 5.914httpd 170 21197.41 8.020nginx 180 27160.77 6.627httpd 180 23673.76 7.603nginx 190 27627.75 6.877httpd 190 21609.25 8.793nginx 200 24602.16 8.129httpd 200 21169.24 9.448nginx 210 26838.70 7.825httpd 210 21666.67 9.692nginx 220 31374.85 7.012httpd 220 21994.93 10.002nginx 230 27740.35 8.291httpd 230 22525.72 10.211nginx 240 27235.49 8.812httpd 240 21815.80 11.001nginx 250 26522.97 9.426httpd 250 22031.17 11.348nginx 260 25099.80 10.359httpd 260 22568.75 11.520nginx 270 26291.50 10.269httpd 270 22478.80 12.011nginx 280 25170.07 11.124httpd 280 21437.80 13.061nginx 290 24715.85 11.733httpd 290 21608.02 13.421nginx 300 24808.90 12.092httpd 300 21850.39 13.730nginx 310 27543.54 11.255httpd 310 23166.22 13.382nginx 320 26233.97 12.198httpd 320 23188.51 13.800nginx 330 25436.90 12.973httpd 330 23033.17 14.327nginx 340 26146.07 13.004httpd 340 23096.69 14.721nginx 350 25621.51 13.660httpd 350 23384.09 14.967nginx 360 26820.90 13.422httpd 360 22797.59 15.791nginx 370 25497.89 14.511httpd 370 22911.63 16.149nginx 380 25046.86 15.172httpd 380 22242.29 17.085nginx 390 26514.52 14.709httpd 390 22806.97 17.100nginx 400 24104.89 16.594httpd 400 22924.32 17.449nginx 410 26306.69 15.585httpd 410 22585.88 18.153nginx 420 26518.78 15.838httpd 420 22691.66 18.509nginx 430 27305.07 15.748httpd 430 23292.43 18.461nginx 440 27557.12 15.967httpd 440 22258.63 19.768nginx 450 26536.61 16.958httpd 450 22237.17 20.236nginx 460 25901.85 17.759httpd 460 22664.55 20.296nginx 470 24743.76 18.995httpd 470 22935.42 20.492nginx 480 26813.46 17.901httpd 480 23693.59 20.259nginx 490 25869.61 18.941httpd 490 23374.27 20.963nginx 500 24618.19 20.310httpd 500 22318.36 22.403

从图可以看出httpd 2.4.4在高并发的还是略逊于nginx。

nginx_httpd0 (3)