首页 > 系统 > Linux >

用Webbench进行网站压力测试

2017-02-15

用Webbench进行网站压力测试,这几天一直在做web service想找个工具测试下并发请求处理能力,开始找到了web-ct,windows客户端的,但是安装后用起来很不好,而且免费版最多能测试并发40个,最长10s。

用Webbench进行网站压力测试,这几天一直在做web service想找个工具测试下并发请求处理能力,开始找到了web-ct,windows客户端的,但是安装后用起来很不好,而且免费版最多能测试并发40个,最长10s

这基本上测试不出来什么,还有就是360软件管家卸载不掉,需要去windows控制面板中卸载!恶心....

今天突然发现一个新大陆,Webbench,是Linux下,用这很方便,开源,不限制并发访问次数和时间....大爱啊!

下载Webbench

使用wget 或者windows下载好导入linux也行,地址:http://home.tiscali.cz/cz210552/distfiles/webbench-1.5.tar.gz

编译安装

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

ok,安装成功

看看他的帮助文档

[plain] view plain copy
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 Run benchmark for seconds. Default 30.
-p|--proxy Use proxy server for request.
-c|--clients Run 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#

用法很简单,下面简单的测试使用
[plain] view plain copy
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.
并发100个,运行30s,访问请求全部成功,速度495888 pages/min, 586798 bytes/sec
[plain] view plain copy
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.
相关文章
最新文章
热点推荐