| 您的当前位置:首页 --> CentOS入门 |
| CentOS下Apache与Nginx性能测试对比 |
| 浏览次数:2895 关键词 ( 性能测试 CentOS Apache Nginx ) |
|
apache2.4.1放出后据说性能目标直指nginx,所以自己编译安装了两个版本进行静态页的压力测试。 测试服务器为虚拟机 2颗CPU 2G内存。 编译选项: apache: ./configure –prefix=/usr/local/apache –enable-proxy-http –enable-proxy-fcgi –enable-proxy nginx: ./configure –prefix=/usr/local/nginx 相邻机ab压同一静态页 [root@localhost ~]# curl http://192.168.2.129/index.html test for apache 2.4 数据: apache: [root@localhost ~]# ab -n 1000000 -c 100 http://192.168.2.129/index.html This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0 Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Copyright 2006 The Apache Software Foundation, http://www.apache.org/ Benchmarking 192.168.2.129 (be patient) Completed 100000 requests Completed 200000 requests Completed 300000 requests Completed 400000 requests Completed 500000 requests Completed 600000 requests Completed 700000 requests Completed 800000 requests Completed 900000 requests Finished 1000000 requests Server Software: Server Hostname: Server Port: Document Path: Document Length: Concurrency Level: Time taken for tests: Complete requests: Failed requests: Write errors: Total transferred: HTML transferred: Requests per second: Time per request: Time per request: Transfer rate: Connection Times (ms) Connect: Processing: Waiting: Total: Percentage of the requests served within a certain time (ms) nginx: [root@localhost ~]# ab -n 1000000 -c 100 http://192.168.2.129/index.html This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0 Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Copyright 2006 The Apache Software Foundation, http://www.apache.org/ Benchmarking 192.168.2.129 (be patient) Completed 100000 requests Completed 200000 requests Completed 300000 requests Completed 400000 requests Completed 500000 requests Completed 600000 requests Completed 700000 requests Completed 800000 requests Completed 900000 requests Finished 1000000 requests Server Software: Server Hostname: Server Port: Document Path: Document Length: Concurrency Level: Time taken for tests: Complete requests: Failed requests: Write errors: Total transferred: HTML transferred: Requests per second: Time per request: Time per request: Transfer rate: Connection Times (ms) Connect: Processing: Waiting: Total: Percentage of the requests served within a certain time (ms) apache的Requests per second达到了7546.16 [#/sec] 而nginx则更胜一筹有9080.85 [#/sec] 其中在apache跑的过程中服务器的负载load 1分钟一度达到了load average: 83.66左右,而nginx则持续在1.5左右,httpd仍然不能算是能和nginx媲美 |
| 下载次数:4 |
| 下载地址:点击下载 |
| 本资源为程序自动采集,如有侵权请联系我们移除 admin#80vps.com 来信请将#替换为@ |
| 下一条 centos系统中网络配置相关 上一条 CentOS服务器下HTTP性能能测试nginx与Apache对比 |