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


