web性能测试工具 SuperWebBench
jopen
13年前
<p>SuperWebBench 是由webbench改进而来的一款简单易用的web性能测试工具.</p> <p></p> <p style="text-align:left;padding-bottom:0px;line-height:26px;font-family:Tahoma;color:#545454;font-size:14px;">背景:</p> <p style="text-align:left;padding-bottom:0px;line-height:26px;font-family:Tahoma;color:#545454;font-size:14px;">webbench最多可以模拟3万个并发连接去测试网站的负载能力,个人感觉要比Apache自带的ab压力测试工具好,安装使用也特别方便。</p> <p style="text-align:left;padding-bottom:0px;line-height:26px;font-family:Tahoma;color:#545454;font-size:14px;">webbench是基于GPL授权协议的,我自然可以取得源码修改,然后作为superwebbench这个项目发布。</p> <p style="text-align:left;padding-bottom:0px;line-height:26px;font-family:Tahoma;color:#545454;font-size:14px;"> </p> <p style="text-align:left;padding-bottom:0px;line-height:26px;font-family:Tahoma;color:#545454;font-size:14px;">简介:</p> <p style="text-align:left;padding-bottom:0px;line-height:26px;font-family:Tahoma;color:#545454;font-size:14px;">SuperWebBench 是由webbench改进而来的一款简单易用的web性能测试工具</p> <p style="text-align:left;padding-bottom:0px;line-height:26px;font-family:Tahoma;color:#545454;font-size:14px;">SuperWebBench 是依照GPL V2.0发布的</p> <p style="text-align:left;padding-bottom:0px;line-height:26px;font-family:Tahoma;color:#545454;font-size:14px;">SuperWebBench是遵循POSIX标准的C语言编写的程序</p> <p style="text-align:left;padding-bottom:0px;line-height:26px;font-family:Tahoma;color:#545454;font-size:14px;"> </p> <p style="text-align:left;padding-bottom:0px;line-height:26px;font-family:Tahoma;color:#545454;font-size:14px;">主要改动如下:</p> <p style="text-align:left;padding-bottom:0px;line-height:26px;font-family:Tahoma;color:#545454;font-size:14px;">1、更正connect()服务器失败时,不能close()的bug</p> <p style="text-align:left;padding-bottom:0px;line-height:26px;font-family:Tahoma;color:#545454;font-size:14px;">2、使用多线程代替多进程,提供更高的效率</p> <p style="text-align:left;padding-bottom:0px;line-height:26px;font-family:Tahoma;color:#545454;font-size:14px;">3、自动资源限制检测和设置(线程数和打开文件数限制)</p> <p style="text-align:left;padding-bottom:0px;line-height:26px;font-family:Tahoma;color:#545454;font-size:14px;">4、测试时间到达后,快速关闭套接字,不用再等待服务器响应(在WAN的情况下,这会占用很多时间)</p> <p style="text-align:left;padding-bottom:0px;line-height:26px;font-family:Tahoma;color:#545454;font-size:14px;">5、加入了检测HTTP响应号的功能,这样就可以分辨HTTP是否返回了正确的信息(HTTP2XX)</p> <p style="text-align:left;padding-bottom:0px;line-height:26px;font-family:Tahoma;color:#545454;font-size:14px;">6、重新组织了下代码结构,使得阅读更方便</p> <p style="text-align:left;padding-bottom:0px;line-height:26px;font-family:Tahoma;color:#545454;font-size:14px;"> </p> <p style="text-align:left;padding-bottom:0px;line-height:26px;font-family:Tahoma;color:#545454;font-size:14px;">安装:</p> <p style="text-align:left;padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"><span style="padding-bottom:0px;line-height:26px;margin:0px;padding-left:0px;padding-right:0px;padding-top:0px;">wget http://www.teamhost.org/attachments/download/77/SuperWebBench.tar.gz</span></p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"><span style="padding-bottom:0px;line-height:26px;margin:0px;padding-left:0px;padding-right:0px;padding-top:0px;">tar zxvf SuperWebBench.tar.gz</span></p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"><span style="padding-bottom:0px;line-height:26px;margin:0px;padding-left:0px;padding-right:0px;padding-top:0px;">cd superwebbench</span></p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"><span style="padding-bottom:0px;line-height:26px;margin:0px;padding-left:0px;padding-right:0px;padding-top:0px;">make && make install</span></p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"><span style="padding-bottom:0px;line-height:26px;margin:0px;padding-left:0px;padding-right:0px;padding-top:0px;"><br /> </span></p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"><span style="font-family:Tahoma, Arial;"><span style="padding-bottom:0px;line-height:normal;margin:0px;padding-left:0px;padding-right:0px;font-size:12px;padding-top:0px;">superwebbench -c 500 -t 30 http://127.0.0.1/test.jpg </span><br /> </span></p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;">参数说明:-c表示并发数,-t表示时间(秒)</p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;">测试结果示例:</p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;">SuperWebBench - Advanced Simple Web Benchmark 0.1</p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;">Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.</p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;">Modified By Davelv 2011-11-03</p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;">Benchmarking:GET http://127.0.0.1/test.jpg (using HTTP/1.1)</p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;">500 clients, running 30 sec.</p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;">Speed=5887 pages/sec, 1862058 bytes/sec.</p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;">Requests: 0 ok, 176220 http error, 405 failed.</p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;">示范:</p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;">superwebbench </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;">superwebbench [option]... URL </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> -f|--force Don't wait for reply from server. </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> -r|--reload Send reload request - Pragma: no-cache. </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> -t|--time <sec> Run benchmark for <sec> seconds. Default 30. </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> -p|--proxy <server:port> Use proxy server for request. </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> -c|--clients <n> Run <n> HTTP clients at once. Default one. </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> -9|--http09 Use HTTP/0.9 style requests. </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> -1|--http10 Use HTTP/1.0 protocol. </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> -2|--http11 Use HTTP/1.1 protocol. </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> --get Use GET request method. </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> --head Use HEAD request method. </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> --options Use OPTIONS request method. </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> --trace Use TRACE request method. </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> -?|-h|--help This information. </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> -V|--version Display program version. </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> <br /> 常见问题:</p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;">ctags *.c</p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;">/bin/sh: ctags: command not found</p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;">make: [tags] 错误 127 (忽略)</p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;"> </p> <p style="padding-bottom:0px;font-family:Tahoma;color:#545454;font-size:14px;">ok,是在centos下没自动安装ctags命令,于是yum install ctags,安装成功。<br /> <br /> </p> <p><strong>项目主页:</strong><a href="http://www.open-open.com/lib/view/home/1328166116390" target="_blank">http://www.open-open.com/lib/view/home/1328166116390</a></p>