正在加载...

tornado-2 性能测试

老规矩,直接 10进程 1000 访问

命令

ab -c 10 -n 1000 http://192.168.95.222:4322/

结果

This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.95.222 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        TornadoServer/2.1.1
Server Hostname:        192.168.95.222
Server Port:            4322

Document Path:          /
Document Length:        16 bytes

Concurrency Level:      10
Time taken for tests:   0.693 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      174000 bytes
HTML transferred:       16000 bytes
Requests per second:    1443.30 [#/sec] (mean)
Time per request:       6.929 [ms] (mean)
Time per request:       0.693 [ms] (mean, across all concurrent requests)
Transfer rate:          245.25 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        1    1   1.0      1      13
Processing:     1    6   1.9      5      18
Waiting:        1    5   1.8      5      18
Total:          3    7   1.8      6      19

Percentage of the requests served within a certain time (ms)
  50%      6
  66%      7
  75%      7
  80%      7
  90%      8
  95%     10
  98%     13
  99%     17
 100%     19 (longest request)

每秒将近是1443,接近webpy的10倍

再看100并发,2000请求

ab -c 100 -n 2000 http://192.168.95.222:4322/

结果

This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.95.222 (be patient)
Completed 200 requests
Completed 400 requests
Completed 600 requests
Completed 800 requests
Completed 1000 requests
Completed 1200 requests
Completed 1400 requests
Completed 1600 requests
Completed 1800 requests
Completed 2000 requests
Finished 2000 requests


Server Software:        TornadoServer/2.1.1
Server Hostname:        192.168.95.222
Server Port:            4322

Document Path:          /
Document Length:        16 bytes

Concurrency Level:      100
Time taken for tests:   1.075 seconds
Complete requests:      2000
Failed requests:        0
Write errors:           0
Total transferred:      348000 bytes
HTML transferred:       32000 bytes
Requests per second:    1860.06 [#/sec] (mean)
Time per request:       53.762 [ms] (mean)
Time per request:       0.538 [ms] (mean, across all concurrent requests)
Transfer rate:          316.06 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        1    1   1.0      1       8
Processing:     4   51  13.0     46      76
Waiting:        4   51  13.0     46      75
Total:          8   53  12.8     48      77

Percentage of the requests served within a certain time (ms)
  50%     48
  66%     65
  75%     65
  80%     65
  90%     66
  95%     70
  98%     73
  99%     73
 100%     77 (longest request)

每秒1800个请求,响应为53.8ms,很强大啊

就它了