静态页面响应速度测试用例分析,本地访问平均0.2ms每个请求
静态页面响应速度测试用例分析,本地访问平均0.2ms每个请求
测试用例一:1个并发量发送100个请求,test.html页面为一个字符a,本地访问,服务器cpu,内存等硬件资源充足。
[root@iZ25ja2kaemZ ~]# ab -c 1 -n 100 http://testlocals.bestbeijing.top/test/test.html
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 testlocals.bestbeijing.top (be patient).....done
Server Software: Apache/2.2.15
Server Hostname: testlocals.bestbeijing.top
Server Port: 80
Document Path: /test/test.html
Document Length: 304 bytes
Concurrency Level: 1
Time taken for tests: 0.022 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Non-2xx responses: 100
Total transferred: 48400 bytes
HTML transferred: 30400 bytes
Requests per second: 4645.33 [#/sec] (mean)
Time per request: 0.215 [ms] (mean)
Time per request: 0.215 [ms] (mean, across all concurrent requests)
Transfer rate: 2195.64 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 0 0 0.0 0 0
Waiting: 0 0 0.0 0 0
Total: 0 0 0.0 0 0
Percentage of the requests served within a certain time (ms)
50% 0
66% 0
75% 0
80% 0
90% 0
95% 0
98% 0
99% 0
100% 0 (longest request)
测试用例二:5000个并发量发送5000个请求,test.html页面为一个字符a,平均每个请求耗时0.693ms。本地访问,可见耗时比1个并发量增长到大概3倍,说明服务器cpu,内存资源或web服务器apache配置等达到了瓶颈,需要优化web服务器配置,因为本地测试,一定不是带宽的问题,且配置了hosts,本地带宽很大。
[root@iZ25ja2kaemZ ~]# ab -c 5000 -n 5000 http://testlocals.bestbeijing.top/test/test.html
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 testlocals.bestbeijing.top (be patient)
Completed 500 requests
Completed 1000 requests
Completed 1500 requests
Completed 2000 requests
Completed 2500 requests
Completed 3000 requests
Completed 3500 requests
Completed 4000 requests
Completed 4500 requests
Completed 5000 requests
Finished 5000 requests
Server Software: Apache/2.2.15
Server Hostname: testlocals.bestbeijing.top
Server Port: 80
Document Path: /test/test.html
Document Length: 1 bytes
Concurrency Level: 5000
Time taken for tests: 3.193 seconds
Complete requests: 5000
Failed requests: 0
Write errors: 0
Total transferred: 1341438 bytes
HTML transferred: 5043 bytes
Requests per second: 1565.75 [#/sec] (mean)
Time per request: 3193.356 [ms] (mean)
Time per request: 0.639 [ms] (mean, across all concurrent requests)
Transfer rate: 410.23 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 339 750.9 65 3072
Processing: 0 207 459.8 66 1778
Waiting: 0 193 459.9 56 1776
Total: 79 546 992.1 130 3144
Percentage of the requests served within a certain time (ms)
50% 130
66% 137
75% 150
80% 169
90% 2821
95% 3129
98% 3140
99% 3141
100% 3144 (longest request)