执行命令
ab -c5 -n500 -p x.txt -T 'application/xml' 'http://192.168.0.8/xxx'
测试结果
This is ApacheBench, Version 2.3 <$Revision: 1901567 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 192.168.0.8 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Finished 500 requests
Server Software: nginx/1.22.0
Server Hostname: 192.168.0.8
Server Port: 80
Document Path: /xxx
Document Length: 138 bytes
Concurrency Level: 5
Time taken for tests: 5.129 seconds
Complete requests: 500
Failed requests: 1
(Connect: 0, Receive: 0, Length: 1, Exceptions: 0)
Non-2xx responses: 1
Total transferred: 201850 bytes
Total body sent: 578500
HTML transferred: 68961 bytes
Requests per second: 97.48 [#/sec] (mean)
Time per request: 51.293 [ms] (mean)
Time per request: 10.259 [ms] (mean, across all concurrent requests)
Transfer rate: 38.43 [Kbytes/sec] received
110.14 kb/s sent
148.57 kb/s total
Connection Times (ms)
min mean[+/-sd] median max
Connect: 11 21 6.4 21 43
Processing: 19 29 8.6 28 88
Waiting: 18 29 8.3 27 88
Total: 30 50 10.6 49 106
Percentage of the requests served within a certain time (ms)
50% 49
66% 52
75% 55
80% 57
90% 62
95% 69
98% 83
99% 100
100% 106 (longest request)