[root@db02 application]# ab -n 3000 -c 100 http://10.0.0.111/test_info.php
# 3000次会话请求、100并发数
Server Software: nginx/1.6.3
Server Hostname: 10.0.0.111
Server Port: 80
Document Path: /test_info.php #测试页面
Document Length: 83921 bytes #页面大小
Concurrency Level: 100 #100并发数
Time taken for tests: 7.973 seconds #整个测试持续时间
Complete requests: 3000 #完成的请求总数
Failed requests: 302 #失败的请求次数
(Connect: 0, Receive: 0, Length: 302, Exceptions: 0)
Write errors: 0
Total transferred: 252203675 bytes #整个过程的网络传输量
HTML transferred: 251762675 bytes #HTML内容传输量
Requests per second: 376.25 [#/sec] (mean) #吞吐量,每秒能够处理的并发数
Time per request: 265.779 [ms] (mean) #平均事务响应时间
Time per request: 2.658 [ms] (mean, across all concurrent requests)
#每个连接请求实际运行时间
Transfer rate: 30889.42 [Kbytes/sec] received
#平均每秒网络上的流量,可以帮助排除是否存在网络流量大导致响应时间延长的问题
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 3.2 0 21
Processing: 14 261 32.2 261 331
Waiting: 2 260 32.4 260 331
Total: 29 261 29.9 261 331
Percentage of the requests served within a certain time (ms)
50% 261
66% 268
75% 273
80% 276
90% 287 #90%的请求任务在287ms内完成
95% 303
98% 315
99% 322
100% 331 (longest request)
2)配置xache之后
[root@db02 application]# ab -n 3000 -c 100 http://10.0.0.111/test_info.php
Server Software: nginx/1.6.3
Server Hostname: 10.0.0.111
Server Port: 80
Document Path: /test_info.php
Document Length: 172 bytes
Concurrency Level: 100
Time taken for tests: 0.516 seconds
Complete requests: 3000
Failed requests: 0
Write errors: 0
Non-2xx responses: 3000
Total transferred: 969000 bytes
HTML transferred: 516000 bytes
Requests per second: 5819.42 [#/sec] (mean) #并发数上升为5000+
Time per request: 17.184 [ms] (mean)
Time per request: 0.172 [ms] (mean, across all concurrent requests)
Transfer rate: 1835.62 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.3 0 9
Processing: 6 17 2.1 16 21
Waiting: 0 17 2.2 16 21
Total: 7 17 1.6 16 21
Percentage of the requests served within a certain time (ms)
50% 16
66% 17
75% 18
80% 19
90% 19
95% 19
98% 20
99% 21
100% 21 (longest request)由于是虚机测试环境,不一定十分准确,未安装xcache并发数在400-500,安装后并发数在5000左右,缓存效果提升10倍以上...