nginx 测试(四)

1. 测试环境同(三)

2. 第一种参数配置

    同 测试(三) 即sendfile方式

[root@x ~]# ab -c 1000 -n 10000 http://172.20.127.202/a.zip
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 {1}gt; 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 172.20.127.202 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Finished 10000 requests


Server Software:        nginx/1.0.9
Server Hostname:        172.20.127.202
Server Port:            80

Document Path:          /a.zip
Document Length:        18200898 bytes

Concurrency Level:      1000
Time taken for tests:   1561.173296 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Total transferred:      182043261752 bytes
HTML transferred:       182041051310 bytes
Requests per second:    6.41 [#/sec] (mean)
Time per request:       156117.344 [ms] (mean)
Time per request:       156.117 [ms] (mean, across all concurrent requests)
Transfer rate:          113873.73 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0  266 897.3     47   12638
Processing: 36258 153087 24817.4 156360  229712
Waiting:       20   81 224.6     47   16936
Total:      36283 153353 24863.9 156537  230436

Percentage of the requests served within a certain time (ms)
  50%  156537
  66%  165214
  75%  170149
  80%  173557
  90%  181831
  95%  188172
  98%  194900
  99%  200211
 100%  230436 (longest request)
1000并发、10000次请求、182GB+数据、90+%的网卡利用率,性能不错。

3. 第二种参数配置

   同 测试(三) 即AIO方式

[root@x ~]# ab -c 1000 -n 10000 http://172.20.127.202/a.zip
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 {1}gt; 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 172.20.127.202 (be patient)
Completed 1000 requests
Completed 2000 requests
apr_socket_recv: Connection timed out (110)
Total of 2003 requests completed
[root@x ~]# 
[root@x ~]# 
[root@x ~]# ab -c 1000 -n 10000 http://172.20.127.202/a.zip
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 {1}gt; 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 172.20.127.202 (be patient)
Completed 1000 requests
Completed 2000 requests
apr_socket_recv: Connection timed out (110)
Total of 2101 requests completed
跑了两次,到2000+时都挂掉。

4. 为了使nginx更好的与os结合,所以下载了1.0.9的源码,在另一台主机上编译安装,编译时指定启用AIO。

5. 第一种参数配置

[root@y html]# ab -c 1000 -n 10000 http://172.20.127.206/a.zip
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 {1}gt; 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 172.20.127.206 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Finished 10000 requests


Server Software:        nginx/1.0.9
Server Hostname:        172.20.127.206
Server Port:            80

Document Path:          /a.zip
Document Length:        18200898 bytes

Concurrency Level:      1000
Time taken for tests:   1561.385336 seconds
Complete requests:      10000
Failed requests:        2
   (Connect: 0, Length: 2, Exceptions: 0)
Write errors:           0
Total transferred:      182041712874 bytes
HTML transferred:       182039502211 bytes
Requests per second:    6.40 [#/sec] (mean)
Time per request:       156138.531 [ms] (mean)
Time per request:       156.139 [ms] (mean, across all concurrent requests)
Transfer rate:          113857.29 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0  195 688.4     47    9560
Processing: 44555 153208 24341.9 156540  226285
Waiting:        2   93 221.4     48    6443
Total:      44580 153403 24362.5 156690  229246

Percentage of the requests served within a certain time (ms)
  50%  156690
  66%  165216
  75%  170067
  80%  172983
  90%  180717
  95%  186974
  98%  194298
  99%  199464
 100%  229246 (longest request)

6. 第二种参数配置

[root@x html]# ab -c 1000 -n 10000 http://172.20.127.206/a.zip
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 {1}gt; 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 172.20.127.206 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
apr_poll: The timeout specified has expired (70007)
Total of 9003 requests completed

跑9000+时挂掉。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值