webbench在linux下的安装教程
一、下载Webbench
二、编译安装webbench:
root@jack-desktop:~/software# tar xvzf webbench-1.5.tar.gz
root@jack-desktop:~/software/webbench-1.5# make cc -Wall -ggdb -W -O -c -o webbench.o webbench.c webbench.c: In function ‘alarm_handler’: webbench.c:77: warning: unused parameter ‘signal’ cc -Wall -ggdb -W -O -o webbench webbench.o ctags *.c root@jack-desktop:~/software/webbench-1.5# make install install -s webbench /usr/local/bin 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 root@jack-desktop:~/software/webbench-1.5# root@jack-desktop:~/software/webbench-1.5# web webbench webs 安装成功
三,查看webbench帮助文档
root@jack-desktop:~/software/webbench-1.5# webbench --help
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. root@jack-desktop:~/software/webbench-1.5#
root@jack-desktop:~/software/webbench-1.5# webbench -c 100 http://localhost:12345/test
Webbench - Simple Web Benchmark 1.5 Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software. Benchmarking: GET http://localhost:12345/test 100 clients, running 30 sec. Speed=495888 pages/min, 586798 bytes/sec. Requests: 247944 susceed, 0 failed.
root@jack-desktop:~/software/webbench-1.5# webbench -c 1000 http://localhost:12345/test
Webbench - Simple Web Benchmark 1.5 Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software. Benchmarking: GET http://localhost:12345/test 1000 clients, running 30 sec. Speed=414996 pages/min, 490915 bytes/sec. Requests: 207430 susceed, 68 failed. 并发1000个,运行30s,访问68个失败,速度也慢下来了,414996 pages/min, 490915 bytes/sec 在并发很大时服务器占用资源很厉害,主要是CPU占用过多,有时达到80%以上!
总结: |