1、执行安装
sudo apt-get install apache2
2、 执行命令
ab -n 1000 -c 10 http://www.baidu.com/
-n表示1000次,-c表示开10线程
wq@ubuntu:~/code/src/tcpclient$ ab -n 100 -c 10 http://www.baidu.com/
This is ApacheBench, Version 2.3 <$Revision: 1807734 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking www.baidu.com (be patient).....done
Server Software: BWS/1.1
Server Hostname: www.baidu.com
Server Port: 80
Document Path: /
Document Length: 355232 bytes
Concurrency Level: 10
Time taken for tests: 11.815 seconds
Complete requests: 100
Failed requests: 98
(Connect: 0, Receive: 0, Length: 98, Exceptions: 0)
Total transferred: 35851105 bytes
HTML transferred: 35728707 bytes
Requests per second: 8.46 [#/sec] (mean)
Time per request: 1181.488 [ms] (mean)
Time per request: 118.149 [ms] (mean, across all concurrent requests)
Transfer rate: 2963.28 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 26 72 29.9 68 225
Processing: 299 865 794.7 630 4469
Waiting: 36 86 31.6 80 188
Total: 342 937 798.0 705 4555
Percentage of the requests served within a certain time (ms)
50% 705
66% 948
75% 1119
80% 1159
90% 1430
95% 1942
98% 4400
99% 4555
100% 4555 (longest request)