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.php | win7 | -c10 -n1000 time out | nginx | 1.346 | 742/sec |
localhost apache hello.php | win7 | -c10 -n1000 | apache | 0.918 | 1089 /sec |
1)本地yii2 + nginx | win7 | 本地 | nginx 1.6.2 | 33.955 sec | 2.95/sec |
2)本地yii2 + apache | win7 | 本地 | apache 2.4.9 | 18.741 sec | 5.34/sec |
3)远程yii2 + nginx (2G内存单核) | centos7 | 深圳阿里云ECS | nginx 1.6.3 | 24.60 sec | 4.09/sec |
4)远程yii2 + nginx(1G内存单核) | centos7 | 美国 Fremont linode机房 | nginx 1.8 | 77.50 sec | 1.29 /sec |
5)广州妈妈网 www.gzmama.com | 广州 电信 | nginx 1.6.0 | 108.323 sec | 0.92/sec | |
6)pt手游 PC官网 thinkphp+nginx | centos 6 | 佛山机房 | nginx 1.5.7 | 17.264 sec | 5.79/sec |
7)pt手游 WAP官网 thinkphp +nginx | centos 6 | 佛山机房 | nginx 1.5.7 | 22.279 sec | 4.49/sec |
8)淘宝官网 www.taobao.com | 深圳/佛山机房 | Tengine | 15.04 sec | 6.65/sec | |
9)百度首页 www.baidu.com | 江苏机房 | BWS/1.1 | 18.508 sec | 5.40/sec | |
10)4399 PC官网首页 www.4399.com | 广东电信(测试被屏蔽 ?apr_socket_recv) | ||||
11)CSDN PC官网首页 www.csdn.net | 北京阿里云 | ngx_openresty | 103.sec | 0.97/sec | |
12)segft 官网首页 | 北京阿里云 | 未标注 | 52.525 sec | 1.90/sec | |
13)37玩 PC官网 www.37.com | 北京阿里云 | nginx | 20.983 sec | 4.77 /sec | |
14)腾讯PC 首页 www.qq.com | 深圳电信 | squid 3.4.1 | 174.545 sec | 0.57/sec |
为什么有的大型网站,吞吐量反而很低?