摘要:ApacheBeanch - 做壓力測試
使用Apache 內建立的ab來這壓力測試
下語法如下
ab -n 100 -c 5 https://localhost/
-n 100 ,是總數有100個request
-c 5 , 是同時連線的使用者數
後面接序是要測的網頁
再來會列出結果如下
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 localhost (be patient).....done
Server Software: Apache/2.2.14
Server Hostname: localhost
Server Port: 443
SSL/TLS Protocol: TLSv1/SSLv3,DHE-RSA-AES256-SHA,2048,256
Document Path: /
Document Length: 765 bytes
Concurrency Level: 5
Time taken for tests: 1.467 seconds
Complete requests: 100
Failed requests: 8
(Connect: 0, Receive: 0, Length: 8, Exceptions: 0)
Write errors: 0
Total transferred: 127492 bytes
HTML transferred: 76492 bytes
Requests per second: 68.17 [#/sec] (mean)
Time per request: 73.351 [ms] (mean)
Time per request: 14.670 [ms] (mean, across all concurrent requests)
Transfer rate: 84.87 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 12 18 4.3 17 31
Processing: 29 54 76.5 36 395
Waiting: 29 54 76.5 36 394
Total: 46 72 78.7 53 414
Percentage of the requests served within a certain time (ms)
50% 53
66% 55
75% 57
80% 58
90% 66
95% 411
98% 412
99% 414
100% 414 (longest request)
失敗數是8
Failed requests: 8
每秒可以服務68條Request
Requests per second: 68.17 [#/sec] (mean)
連線時間平均值為18ms