首先安裝Httperf。主要是Httperf網路上給出的url均無法訪問,因此在GitHub上找的源碼工程,進行安裝。
接下來介紹安裝步驟,從Github下載下來的httperf包是zip。
unzip httperf-master.zip
cd httperf-master
autoreconf -i (可能要首先安裝一下autoconf sudo apt-get install autoconf )
生成configure文件之後
./configure
make && make install
至此httperf安裝完成 cd到/usr/local/bin下有httperf可執行文件
測試一下:httperf --server 127.0.0.1 --port 8081 --num-conns 200 --timeout 5 --uri /getServerIp
測試結果:
httperf --timeout=5 --client=0/1 --server=127.0.0.1 --port=8081 --uri=/getServerIp --send-buffer=4096 --recv-buffer=16384 --ssl-protocol=auto --num-conns=200 --num-calls=1
Maximum connect burst length: 1
Total: connections 200 requests 200 replies 200 test-duration 17.702 s
Connection rate: 11.3 conn/s (88.5 ms/conn, <=1 concurrent connections)
Connection time [ms]: min 63.5 avg 88.5 max 1066.1 median 76.5 stddev 81.0
Connection time [ms]: connect 42.4
Connection length [replies/conn]: 1.000Request rate: 11.3 req/s (88.5 ms/req)
Request size [B]: 79.0Reply rate [replies/s]: min 9.8 avg 11.1 max 13.4 stddev 2.0 (3 samples)
Reply time [ms]: response 46.1 transfer 0.0
Reply size [B]: header 160.0 content 19.0 footer 0.0 (total 179.0)
Reply status: 1xx=0 2xx=200 3xx=0 4xx=0 5xx=0CPU time [s]: user 11.92 system 5.48 (user 67.3% system 31.0% total 98.3%)
Net I/O: 2.8 KB/s (0.0*10^6 bps)Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0
Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
接下來安裝AutoBench,這個相對來說好安裝,直接wget下載安裝即可。
- 下載: wget http://www.xenoclast.org/autobench/downloads/autobench-2.1.2.tar.gz
- 解壓 : tar xvzf autobench-2.1.2.tar.gz
- cd autobench-2.1.2
- 編譯 make
- 安裝 make install
測試一下:autobench --single_host --host1=127.0.0.1 --port1=8081 --uri1=/getServerIp --quiet --low_rate=20 --high_rate=200 --rate_step=20 --num_call=5 --num_conn=500 --timeout=5 --file ./results.tsv
測試結果存放在result.tsv文件中,至此安裝並測試完成。