標籤:style blog http color io 使用 ar strong div
webbench最多可以類比3萬個並發串連去測試網站的負載能力,個人感覺要比Apache內建的ab壓力測試工具好,安裝使用也特別方便。
1、適用系統:Linux
2、編譯安裝:
wget http://www.ha97.com/code/webbench-1.5.tar.gztar zxvf webbench-1.5.tar.gzcd webbench-1.5makemake install
如果出現編譯錯誤
[[email protected]]# makecc -Wall -ggdb -W -O -c -o webbench.o webbench.cwebbench.c: In function ‘alarm_handler’:webbench.c:77: warning: unused parameter ’signal’cc -Wall -ggdb -W -O -o webbench webbench.octags *.c/bin/sh: ctags: command not foundmake: [tags] Error 127 (ignored)
是沒安裝ctags組件,使用yum -y install ctags,解決問題
install -s webbench /usr/local/bininstall -m 644 webbench.1 /usr/local/man/man1install: cannot create regular file `/usr/local/man/man1′: No such file or directorymake: *** [install] Error 1
解決方案
mkdir -m 644 -p /usr/local/man/man1
3、使用:
webbench -c 1000 -t 30 http://127.0.0.1/phpinfo.php
參數說明:-c表示並發數,-t表示時間(秒)
4、測試結果樣本:
Webbench - Simple Web Benchmark 1.5Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.Benchmarking: GET http://127.0.0.1/test.jpg500 clients, running 30 sec.Speed=3230 pages/min, 11614212 bytes/sec.Requests: 1615 susceed, 0 failed.
網站效能Web壓力測試工具webbench