Windows下的Apache服務器測試方法
2024-08-27 18:29:32
供稿:網友
通過對服務器壓力測試可以大概了解一個服務器的負載能力,下面是Windows下的Apache服務器測試方法。
在Apache服務器自帶了一個測試程序Ab.exe可以很方便的使用 。。
命令是 ab -c 請求數 -n 線程數 網址(建議輸入目標網頁)。。
線程數不宜過大 按照你電腦的承受能力 。。。
請求數有限制 防止有人亂Ddos別人 。。
例:ab -n 10 -c 10 http://192.168.1.3/index.html
結果如下 。。
D:/Apache/bin>ab -n 10 -c 10 http://192.168.1.3/index.html
?。ㄒ陨鲜禽斎氲拿睿?br />
Benchmarking 192.168.1.3 (be patient).....done
Server Software: Apache/2.0.63
?。繕朔掌鰽pache版本號)
Server Hostname: 192.168.1.3
?。繕朔掌髦鳈C頭名稱)
Server Port: 80
(目標服務器Apache端口)
Document Path: /index.html
?。繕司W頁相對地址)
Document Length: 292 bytes
?。繕司W頁大?。?br />
Concurrency Level: 10
?。úl線程數)
Time taken for tests: 0.140625 seconds
?。ㄊ褂脮r間)
Complete requests: 10
?。ǔ晒Φ恼埱髷盗浚?br />
Failed requests: 0
(失敗的請求數量)
Write errors: 0
?。òl生錯誤數量)
Total transferred: 5750 bytes
?。ㄈ渴褂玫牧髁浚?br />
HTML transferred: 2920 bytes
?。℉tml文件使用的流量)
Requests per second: 71.11 [#/sec] (mean)
?。ㄖ笜艘?平均每秒請求數)
Time per request: 140.625 [ms] (mean)
?。ㄖ笜硕?平均事務響應時間)
Time per request: 14.063 [ms] (mean, across all concurrent requests)
?。棵胝埱髸r間)
Transfer rate: 35.56 [Kbytes/sec] received
?。▊鬏斔俾剩?br />
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 109 124 16.3 140 140
Waiting: 109 124 16.3 140 140
Total: 109 124 16.3 140 140
(所有請求的響應情況)
Percentage of the requests served within a certain time (ms)
50% 140
66% 140
75% 140
80% 140
90% 140
95% 140
98% 140
99% 140
100% 140 (longest request)
每個請求都有一個響應時間 。。
比如 其中 50% 的用戶響應時間小于 140 毫秒 。。
最大的響應時間小于 140 毫秒 (100% 處) 。。