安装
# tar zxvf webbench-1.5.tar.gz# cd webbench-1.5# make && make installcc -Wall -ggdb -W -O -c -o webbench.o webbench.cwebbench.c: In function ‘alarm_handler’:webbench.c:77: 警告:未使用的参数 ‘signal’cc -Wall -ggdb -W -O -o webbench webbench.o ctags *.cinstall -s webbench /usr/local/bininstall -m 644 webbench.1 /usr/local/man/man1install -d /usr/local/share/doc/webbenchinstall -m 644 debian/copyright /usr/local/share/doc/webbenchinstall -m 644 debian/changelog /usr/local/share/doc/webbench(按照下面安装就好)
# install -s webbench /usr/local/bin
先创建目录,不然会报错
#mkdir /usr/local/man/man1
# install -m 644 webbench.1 /usr/local/man/man1
# install -d /usr/local/share/doc/webbench
# install -m 644 debian/copyright /usr/local/share/doc/webbench
# install -m 644 debian/changelog /usr/local/share/doc/webbench
# webbench
webbench [option]... URL
-f|--force Don't wait for reply from server.
-r|--reload Send reload request - Pragma: no-cache.
-t|--time <sec> Run benchmark for <sec> seconds. Default 30.
-p|--proxy <server:port> Use proxy server for request.
-c|--clients <n> Run <n> HTTP clients at once. Default one.
-9|--http09 Use HTTP/0.9 style requests.
-1|--http10 Use HTTP/1.0 protocol.
-2|--http11 Use HTTP/1.1 protocol.
--get Use GET request method.
--head Use HEAD request method.
--options Use OPTIONS request method.
--trace Use TRACE request method.
-?|-h|--help This information.
-V|--version Display program version.
简的测试命令:
#webbench -c 800 -t 60
800 clients, running 60 sec.
Speed=78170 pages/min, 408272 bytes/sec.
Requests: 78170 susceed, 0 failed.
表示并发800,持续60秒,可以看出一分钟接受了78170次页面请求,每秒处理408272 bytes,没有失败