Chinaunix首页 | 论坛 | 博客
  • 博客访问: 929428
  • 博文数量: 245
  • 博客积分: 11429
  • 博客等级: 上将
  • 技术积分: 2662
  • 用 户 组: 普通用户
  • 注册时间: 2009-08-15 00:16
文章存档

2011年(56)

2010年(174)

2009年(15)

分类: LINUX

2010-06-09 11:23:21

Benchmarks(压力测试工具汇总)

 

1.autobench结合httperf可以画出很漂亮的分析图
下载网址:
autobench --single_host --host1 --uri1 /10K --quiet     \
          --low_rate 20 --high_rate 200 --rate_step 20 --num_call 10 \
          --num_conn 5000 --timeout 5 --file results.tsv

2.Siege 功能强大的压力测试软件

操作手册:

3.webbench web/proxy测试软件,相当不错!



4.sysbench  数据库压力测试不错的软件,当你mysql调优以后不防有这个压压测试一下

sysbench是一个模块化的、跨平台、多线程基准测试工具,主要用于评估测试各种不同系统参数下的数据库负载情况。
       它主要包括以下几种方式的测试:
       1、cpu性能
       2、磁盘io性能
       3、调度程序性能
       4、内存分配及传输速度
       5、POSIX线程性能
       6、数据库性能(OLTP基准测试)
       目前sysbench主要支持 MySQL,pgsql, oracle 这3种数据库。


----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


一、webbench
Web-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.
Displays pages/min and bytes/sec. Can be used in more aggressive mode with -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时一个开放源代码项目:

下载:
wget

安装:
# ./configure
#make && make install

siege包含了一组压力测试工具:
SIEGE (1) Siege是一个HTTP压力测试和评测工具.
使用样例:
任务列表:文件











http://www.chedong.com/tech/dev.html

....

# siege -c 20 -r 2 -f
参数说明:
-c 20 并发20个用户
-r 2 重复循环2次
-f 任务列表:URL列表

输出样例:

** 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.59
Successful 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 Throughput Concurrency Code 200 (note that this is horribly broken.)
242 60.22 603064 0.02 4.02 10014.35 0.08
605 59.98 1507660 0.01 10.09 25136.05 0.12
938 59.98 2337496 0.02 15.64 38971.26 0.26
1157 60 2883244 0.04 19.28 48054.07 0.78


网络IO性能测试:
httpload:
            
阅读(1193) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~