nginx压力测试webbench

下载压力测试工具webbench  

wget http://home.tiscali.cz/~cz210552/distfiles/webbench-1.5.tar.gz

安装依赖包

yum -y install ctags

 注:这个包没装会报下面错误

cc -Wall -ggdb -W -O -c -o webbench.o webbench.c
ctags *.c
/bin/sh: ctags: command not found
make: [tags] Error 127 (ignored)
webbench.c: In function ‘alarm_handler’:
webbench.c:77: warning: unused parameter ‘signal’
cc -Wall -ggdb -W -O -o webbench webbench.o

安装webbench

tar -zxvf webbench-1.5.tar.gz -C /usr/local/webbench
make && make install

注:make && make install 的时候报下面的错  执行 mkdir -p /usr/local/man/man1

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
install -s webbench /usr/local/bin    
install -m 644 webbench.1 /usr/local/man/man1    
install: cannot create regular file `/usr/local/man/man1': No such file or directory
make: *** [install] Error 1

 

添加环境变量

export  PATH=/usr/local/webbench:${PATH}

参数介绍

webbench [option]... URL

-f|--force               不等待服务器应答
-r|--reload              生新发送请求
-t|--time <sec>          运行时间
-p|--proxy <server:port> 使用代理服务器
-c|--clients <n>         请求数
-9|--http09              使用http/0.9模式
-1|--http10              使用http/1.0模式
-2|--http11              使用http/1.1模式
--get                    使用get的模式请求
--head                   使用head模式请求
--options                使用options模式请求
--trace                  使用trace模式请求
-?|-h|--help             帮助

用法

#模拟100次请求,持续时间5秒的压力测试
webbench -c 100 -t 5 http://localhost/index.php

Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.

Benchmarking: GET http://localhost/index.php
100 clients, running 5 sec.

Speed=96804 pages/min, 88496336 bytes/sec.
Requests: 8067 susceed, 0 failed.

--每秒钟响应请求数:Speed=96804 pages/min

--每秒钟传输数据量:88496336 bytes/sec

--8067次返回正常

--0 次失败

 

posted @ 2017-05-27 15:27  vick.wang  阅读(315)  评论(0编辑  收藏  举报