通過對服務器壓力測試可以大概了解一個服務器的負載能力,下面是Windows下的Apache服務器測試方法。
在Apache服務器自帶了一個測試程序Ab.exe可以很方便的使用 。。
命令是 ab -c 請求數 -n 線程數 網址(建議輸入目標網頁)。。
線程數不宜過大 按照你電腦的承受能力 。。。
請求數有限制 防止有人亂Ddos別人 。。
例:ab -n 10 -c 10
結果如下 。。
D:\Apache\bin>ab -n 10 -c 10
(以上是輸入的命令)
Benchmarking 192.168.1.3 (be patient).....done
Server Software:
(目標服務器Apache版本號)
Server Hostname:
(目標服務器主機頭名稱)
Server Port:
(目標服務器Apache端口)
Document Path:
(目標網頁相對地址)
Document Length:
(目標網頁大小)
Concurrency Level:
(并發線程數)
Time taken for tests:
(使用時間)
Complete requests:
(成功的請求數量)
Failed requests:
(失敗的請求數量)
Write errors:
(發生錯誤數量)
Total transferred:
(全部使用的流量)
HTML transferred:
(Html文件使用的流量)
Requests per second:
( )
Time per request:
(
Time per request:
Connection Times (ms)
Connect:
Processing:
Waiting:
Total:
(所有請求的響應情況)
Percentage of the requests served within a certain time (ms)
每個請求都有一個響應時間 。。
比如 其中 50% 的用戶響應時間小于
最大的響應時間小于