压力测试工具集合
压力测试工具集合【ab,webbench,Siege,h ttp_ load,Web Applica tionStress】1. autobench 结合 httperf 可以画出很漂亮的分析图下载网址:http:/www.xenoclast. org/autobench/autobench -single_host -hostl www.test.com uri1 /10K quiet-low_rate 20 -high_rate 200 -rate_step 20 -num_call 10 -num_conn 5000 -timeout 5 -file results.tsv2.Siege 功能强大的压力测试软件http:/www.joedog.org/JoeDog/Siege操作手册:htt p:/www.joedog.org/Siege/Manual-c 500 并发500个用户-r 150 重复循环150次-f sites.list 任务的 URL 列表 其它实用参数:-i 随机 URL ,默认是从列表的上面到下面来打压力-b 进行压力测试,不进行延时-t持续时间,即测试持续时间,在NUM时间后结束,单位默认为分Siege 修正参数进行压力测试./siege -c 500 -r 150 -f sites.list -i -b 复制代码3. webbench web/proxy 测试软件,相当不错!http:/home .tiscali.cz:8080/cz210552/webbench.htmlhtt p:/www.ibiblio.org/pub/Linux webbench-1.5 .t ar.gz4. sysbench 数据库压力测试不错的软件,当你 mysql 调优以后不防有这个压压 测试一下http:/sysbench.sourceforge.net/sysbench是一个模块化的、跨平台、多线程基准测试工具,主要用于评估测试 各种不同系统参数下的数据库负载情况。它主要包括以下几种方式的测试:1 、 cpu 性能2、磁盘 io 性能3、调度程序性能4、内存分配及传输速度5、POSIX 线程性能6、数据库性能(OLTP基准测试)目前 sysbench 主要支持 MySQL,pgsql, oracle 这 3 种数据库。htt p:/www.opensource testi ng.org/performance.php一、webbenchWeb-bench is a simple web server benchark.Web Bench is very simple tool for benchmarking WWW or proxy servers. Uses fork() for simulating multiple clients and can use HTTP/0.9-HTTP/1.1 requests.This benchmark is not very realistic, but it can test if your HTTPD can realy handle that many clients at once (try to run some CGIs) without taking your machine down.Displayspages/minandbytes/sec.Canbeusedinmoreaggressivemodewith -f switch.What's New in This Release:# tar zxvf webbench-1.5.tar.gz# cd webbench-1.5# make && make install#webbench -c 500 -t 30参数说明:-c表示并发数,-t表示时间(秒)二、Siege:压力模拟/测试工具最早使用的压力测试工具是 apache 的 ab(apache benchmark) , apache ab 做重 复压力测试不错,但是每次只能测试一个链接,如何测试一组链接(比如从日志 中导出的 1 个小时的日志,做真实压力测试),后来找到了这个:Siege是一个压力测试和评测工具,设计用于WEB开发这评估应用在压力下的承 受能力:可以根据配置对一个WEB站点进行多用户的并发访问,记录每个用户所 有请求过程的相应时间,并在一定数量的并发访问下重复进行。SIEGE is an http regressive testing and benchmarking utility. It was designed to let web developers measure the performance of their code under duress, to see how it will stand up to load on the internet. It lets the user hit a webserver with a configurable number of concurrent simulated users. Those users place the webserver "under siege." The duration of the siege is measured in transactions, the sum of simulated users and the number of times each simulated user repeats the process of hitting the server. Thus 20 concurrent users 50 times is 1000 transactions, the length of the test.下载/安装Siege 时一个开放源代码项目:http:/www.joedog.org下载:wget ftp:/sid.joedog.org/pub/siege/siegeTatest.tar.gz安装:# ./configure#make && make installsiege包含了一组压力测试工具:SIEGE (1) Siege是一个HTTP压力测试和评测工具.使用样例:任务歹U表:www.chedong.com.url 文件htt p:/www.chedong.com/ tech/htt p:/www.chedong.com/ tech/acdsee.h tmlhtt p:/www.chedong.com/ tech/a nt.htmlhtt p:/www.chedong.com/ tech/apache_ins tall.h tmlhtt p:/www.chedong.com/ tech/aws tat s.h tmlhtt p:/www.chedong.com/ tech/cache.h tml htt p:/www.chedong.com/ tech/click.h tml htt p:/www.chedong.com/ tech/cms.h tml htt p:/www.chedong.com/ tech/compress.h tml http:/www.chedong.com/tech/cvs card.html htt p:/www.chedong.com/ tech/defau lt.html http:/www.chedong.com/ tech/dev.h tml htt p:/www.chedong.com/ tech/gnu.h tml# siege -c 20 -r 2 -f www.sina.com.cn 参数说明:-c 20 并发20个用户-r 2 重复循环 2 次-f www.chedong.com.url 任务歹U表:URL 歹U表输出样例: * Siege 2.59* Preparing 20 concurrent users for battle. 这次“战斗”准备了 20 个并 发用户The server is now under siege. done. 服务在“围攻”测试中:Transactions: 40 hits 完成 40 次处理Availability: 100.00 % 成功率Elapsed time: 7.67 secs 总共用时Data transferred: 877340 bytes 共数据传输:877340 字节Response time: 1.65 secs 相应用时 1.65 秒:显示网络连接的速度Transaction rate: 5.22 trans/sec 平均每秒完成 5.22 次处理:表示服务器后 台处理的速度Throughput: 114385.92 bytes/sec 平均每秒传送数据:114385.92 字节Concurrency: 8.59 最高并发数 8.59Successful transactions: 40 成功处理次数Failed transactions: 0 失败处理次数注意:由于速度很快,可能会达不到并发速度很高就已经完成。Response time 显示的是测试机器和被测试服务器之间网络链接状况。 Transaction rate 则表 示服务器端任务处理的完成速度。辅助工具:增量压力测试:为了方便增量压力测试,siege还包含了一些辅助工具:bombardment (1)是一个辅助工具:用于按照增量用户压力测试:使用样例:bombardment urlfile.txt 5 3 4 1初始化 URL 列表: urlfile.txt初始化为: 5 个用户每次增加: 3 个用户运行: 4 次每个客户端之间的延迟为: 1 秒输出成 CSV 格式:siege2csv.pl (1)siege2csv.pl 将 bombardment 的输出变成 CSV 格式:Time Data Transferred Response Time Transaction Rate ThroughputConcurrency Code 200 (note that this is horribly broken.)242 60.22 603064 0.02 4.02 10014.35 0.08605 59.98 1507660 0.01 10.09 25136.05 0.12938 59.98 2337496 0.02 15.64 38971.26 0.261157 60 2883244 0.04 19.28 48054.07 0.78网络 IO 性能测试: http:/bbs.linuxtone.org/thread-5437-l-l.html httpload: http:/bbs.linuxtone.org/thread-2899T-2.htmlhttp:/bbs.linux to ne.org/threadT097-l-2.h tml1 Apache 附带的工具 ab ab的全称是ApacheBench,是Apache附带的一个小工具,专门用于HTTP Server 的benchmark testing,可以同时模拟多个并发请求。在这个例子的一开始,我执行了这样一个命令 ab -n 10 -c