HTTP性能测试

时间:2022-11-30 18:43:44

HTTP性能测试
.note-content {font-family: "Helvetica Neue",Arial,"Hiragino Sans GB","STHeiti","Microsoft YaHei","WenQuanYi Micro Hei",SimSun,Song,sans-serif;}

.note-content h2 {line-height: 1.6; color: #0AA89E;}
.note-content {background: #FFFFFF;}
.note-content h1 {color: #7AB3A7;}
.note-content h3 {color: #147A67;}

HTTP性能测试

1.[KANO@kelvin ~]$ ab -n1000 -c10 http://www.qq.com/
2.This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
3.Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
4.Licensed to The Apache Software Foundation, http://www.apache.org/
5.
6.Benchmarking www.qq.com (be patient)
7.Completed 100 requests
8.Completed 200 requests
9.Completed 300 requests
10.Completed 400 requests
11.Completed 500 requests
12.Completed 600 requests
13.Completed 700 requests
14.Completed 800 requests
15.Completed 900 requests
16.Completed 1000 requests
17.Finished 1000 requests
18.
19.
20.Server Software: squid/3.4.1
21.Server Hostname: www.qq.com
22.Server Port: 80
23.
24.Document Path: /
25.Document Length: 622054 bytes
26.
27.Concurrency Level: 10
28.Time taken for tests: 218.070 seconds
29.Complete requests: 1000
30.Failed requests: 4
31. (Connect: 0, Receive: 0, Length: 4, Exceptions: 0)
32.Total transferred: 622390629 bytes
33.HTML transferred: 622059464 bytes
34.Requests per second: 4.59 [#/sec] (mean)
35.Time per request: 2180.704 [ms] (mean)
36.Time per request: 218.070 [ms] (mean, across all concurrent requests)
37.Transfer rate: 2787.19 [Kbytes/sec] received
38.
39.Connection Times (ms)
40. min mean[+/-sd] median max
41.Connect: 28 144 742.0 33 18703
42.Processing: 205 2025 850.7 1977 6864
43.Waiting: 28 167 379.9 34 3213
44.Total: 235 2170 1145.3 2026 20756
45.
46.Percentage of the requests served within a certain time (ms)
47. 50% 2026
48. 66% 2219
49. 75% 2539
50. 80% 2695
51. 90% 3215
52. 95% 3808
53. 98% 5243
54. 99% 6136
55. 100% 20756 (longest request)

讲解:

1.ab -n1000 -c10 http://www.qq.com/

-n1000表示总的请求数是1000个,默认为1

-c10表示并发数是10,默认值是1

http://www.qq.com/web地址,注意后面加上/

1.Server Software:        squid/3.4.1 #被测试服务器的软件的名称
2.Server Hostname: www.qq.com #请求URL的主机名
3.Server Port: 80 #监听端口
1.Document Path:          / #请求URL的根绝对路径
2.Document Length: 622054 bytes #被请求的HTTP响应正文的长度
1.Concurrency Level:      10 #并发数
2.Time taken for tests: 218.070 seconds #所有的请求被处理完成的时间
3.Complete requests: 1000 #完成的请求数量
4.Failed requests: 4 #失败的总请求数
5. (Connect: 0, Receive: 0, Length: 4, Exceptions: 0)
6.Total transferred: 622390629 bytes #整个过程中的网络传输量
7.HTML transferred: 622059464 bytes #过程中HTML的传输量
8.Requests per second: 4.59 [#/sec] (mean) #服务器的吞吐率
9.Time per request: 2180.704 [ms] (mean) #用户平均请求的等待时间
10.Time per request: 218.070 [ms] (mean, across all concurrent requests) #每个连接请求实际运行时间的平均值
11.Transfer rate: 2787.19 [Kbytes/sec] received #请求单位时间在网络上的流量
12.
13.Connection Times (ms) #网络上消耗时间的分解
14. min mean[+/-sd] median max
15.Connect: #连接 28 144 742.0 33 18703
16.Processing: #处理 205 2025 850.7 1977 6864
17.Waiting: #等待 28 167 379.9 34 3213
18.Total: 235 2170 1145.3 2026 20756
19.
20.Percentage of the requests served within a certain time (ms)
21. 50% 2026
22. 66% 2219
23. 75% 2539
24. 80% 2695
25. 90% 3215 #90%的用户平均响应时间
26. 95% 3808
27. 98% 5243
28. 99% 6136
29. 100% 20756 (longest request)