2004 年 11 月 23 日
使用httperf和Autobench对服务器性能进行测试
httperf---A Tool for Measuring Web Server Performance
Autobench is a simple Perl script for automating the process of benchmarking a web server (or for conducting a comparative test of two different web servers). The script is a wrapper around httperf.
两个软件安装完毕后的第一次测试
[root@dalouis test]# httperf --server localhost --uri / --num-call 10 --num-conn 5000 --timeout 5 --rate 150httperf --timeout=5 --client=0/1 --server=localhost --port=80 --uri=/ --rate=150 --send-buffer=4096 --recv-buffer=16384 --num-conns=5000 --num-calls=10
Maximum connect burst length: 65
Total: connections 4684 requests 36738 replies 36593 test-duration 40.268 s
Connection rate: 116.3 conn/s (8.6 ms/conn, <=1022 concurrent connections)
Connection time [ms]: min 19.8 avg 7171.1 max 31861.6 median 5519.5 stddev 5746.8
Connection time [ms]: connect 702.9
Connection length [replies/conn]: 9.960Request rate: 912.3 req/s (1.1 ms/req)
Request size [B]: 60.0Reply rate [replies/s]: min 790.0 avg 908.8 max 970.2 stddev 56.3 (8 samples)
Reply time [ms]: response 609.8 transfer 37.8
Reply size [B]: header 222.0 content 8478.0 footer 2.0 (total 8702.0)
Reply status: 1xx=0 2xx=36593 3xx=0 4xx=0 5xx=0CPU time [s]: user 1.57 system 10.84 (user 3.9% system 26.9% total 30.8%)
Net I/O: 7774.1 KB/s (63.7*10^6 bps)Errors: total 1353 client-timo 1037 socket-timo 0 connrefused 0 connreset 0
Errors: fd-unavail 316 addrunavail 0 ftab-full 0 other 0
我要求的是 1500个/s request,现在的峰值是Request rate: 912.3 req/s,说明已经到达服务器极限,测试有效!
使用 autobench 进行测试
# autobench --single_host --file bench_results.tsv --low_rate 40 --high_rate 200 --rate_step 20 [--quiet]
引用通告: http://weblog.kreny.com/cgi-bin/mt30/mt-tb.cgi/173
br> br>这不是服务器到极限,是客户端到极限了吧。见httperf的文档:
fd-unavail: The number of times the httperf process was out of file descriptors. Whenever this count is non-zero, the test results are meaningless because the client was overloaded (see section "CHOOSING TIMEOUT VALUES").