您的位置:首页 > 运维架构 > Nginx

Apache ab测试 Apache优于 nginx

2015-08-20 23:09 786 查看
Administrator@USER-20140115FZ /cygdrive/d/wamp/bin/apache/apache2.4.9/bin
$ ./ab -c10 -n100 http://flxx2/
This is ApacheBench, Version 2.3 <$Revision: 1554214 $>

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking flxx2 (be patient).....done

Server Software:        nginx/1.6.2

Server Hostname:        flxx2

Server Port:            80

Document Path:          /

Document Length:        34726 bytes

Concurrency Level:      10

Time taken for tests:   33.955 seconds

Complete requests:      100

Failed requests:        0

Total transferred:      3518500 bytes

HTML transferred:       3472600 bytes

Requests per second:    2.95 [#/sec] (mean)

Time per request:       3395.494 [ms] (mean)

Time per request:       339.549 [ms] (mean, across all concurrent requests)

Transfer rate:          101.19 [Kbytes/sec] received

Connection Times (ms)

              min  mean[+/-sd] median   max

Connect:        0    0   0.5      0       1

Processing:  2638 3255 922.6   2976    7310

Waiting:     2619 3231 920.3   2952    7277

Total:       2639 3256 922.5   2976    7310

Percentage of the requests served within a certain time (ms)

  50%   2976

  66%   3103

  75%   3157

  80%   3206

  90%   4350

  95%   6034

  98%   6933

  99%   7310

 100%   7310 (longest request)

Administrator@USER-20140115FZ /cygdrive/d/wamp/bin/apache/apache2.4.9/bin

$ ./ab -c10 -n100 http://flxx2/
This is ApacheBench, Version 2.3 <$Revision: 1554214 $>

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking flxx2 (be patient).....done

Server Software:        Apache/2.4.9

Server Hostname:        flxx2

Server Port:            80

Document Path:          /

Document Length:        34726 bytes

Concurrency Level:      10

Time taken for tests:   18.741 seconds

Complete requests:      100

Failed requests:        0

Total transferred:      3520500 bytes

HTML transferred:       3472600 bytes

Requests per second:    5.34 [#/sec] (mean)

Time per request:       1874.107 [ms] (mean)

Time per request:       187.411 [ms] (mean, across all concurrent requests)

Transfer rate:          183.45 [Kbytes/sec] received

Connection Times (ms)

              min  mean[+/-sd] median   max

Connect:        0    0   0.5      0       1

Processing:   668 1832 562.5   1781    3659

Waiting:      649 1787 560.3   1721    3619

Total:        668 1832 562.6   1782    3660

Percentage of the requests served within a certain time (ms)

  50%   1782

  66%   2001

  75%   2150

  80%   2195

  90%   2487

  95%   2978

  98%   3387

  99%   3660

 100%   3660 (longest request)

Administrator@USER-20140115FZ /cygdrive/d/wamp/bin/apache/apache2.4.9/bin
$

测试条件:./ab -c10 -n100


测试地址:广州电信,带宽 10M


结果对比:

网站
操作系统服务器地址
服务器
TimeTake
吞吐量
localhost nginx hello.phpwin7-c10 -n1000 time outnginx1.346742/sec
localhost apache hello.phpwin7-c10 -n1000apache
0.918
1089 /sec
1)本地yii2 + nginxwin7本地nginx 1.6.233.955 sec2.95/sec
2)本地yii2 + apachewin7本地apache 2.4.918.741 sec5.34/sec
3)远程yii2 + nginx (2G内存单核)centos7深圳阿里云ECSnginx 1.6.324.60 sec4.09/sec
4)远程yii2 + nginx(1G内存单核)centos7美国 Fremont linode机房nginx 1.877.50 sec1.29 /sec
5)广州妈妈网 www.gzmama.com 广州 电信nginx 1.6.0108.323 sec0.92/sec
6)pt手游 PC官网 thinkphp+nginxcentos 6佛山机房nginx 1.5.717.264 sec5.79/sec
7)pt手游 WAP官网 thinkphp +nginxcentos 6佛山机房nginx 1.5.722.279 sec4.49/sec
8)淘宝官网 www.taobao.com 深圳/佛山机房Tengine15.04 sec6.65/sec
9)百度首页 www.baidu.com 江苏机房BWS/1.118.508 sec5.40/sec
10)4399 PC官网首页 www.4399.com 广东电信(测试被屏蔽 ?apr_socket_recv   
11)CSDN PC官网首页 www.csdn.net 北京阿里云ngx_openresty103.sec0.97/sec
12)segft 官网首页 北京阿里云未标注52.525 sec1.90/sec
13)37玩 PC官网 www.37.com 北京阿里云nginx20.983 sec4.77 /sec
14)腾讯PC 首页 www.qq.com 深圳电信squid 3.4.1174.545 sec0.57/sec
为什么有的大型网站,吞吐量反而很低?

还是说ab测试根本就不准确?期待交流 default.fu@foxmail.com 。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  并发量 ab测试