|
[root@www ~]# ab [-dSk] [-c number] [-n number] 網頁檔名
選項與參數:
-d :不要顯示 saved table 的百分比資料;通常不要那個資料,所以會加 -d
-k :還記得上面的 KeepAlive 吧!加入 -k 才會以這樣的功能測試;
-S :不顯示長訊息,僅顯示類似 min/avg/max 的簡短易懂訊息!
-c :同時有多少個『同時連線』的設定(可想成同時連線的 IP )
-n :同一個連線建立幾個要求通道!(可想成同一個 IP 要求的幾條連線)
更多的訊息請自行 man ab 喔!
# 針對我們剛剛測試時的 phpinfo.php 這個檔案來測試!
[root@www ~]# ab -dSk -c100 -n100 http://localhost/phpinfo.php
This is ApacheBench, Version 2.3
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
....中間省略....
Document Path: /phpinfo.php
Document Length: 54204 bytes
....中間省略....
Total transferred: 5436100 bytes
HTML transferred: 5420400 bytes
Requests per second: 39.97 [#/sec] (mean)
Time per request: 2501.731 [ms] (mean)
Time per request: 25.017 [ms] (mean, across all concurrent requests)
Transfer rate: 2122.01 [Kbytes/sec] received
....底下省略....
|
|
|