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+時掛掉。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章