首页 > 技术文章 > Linux下压力测试综合对比

Linux下压力测试综合对比

2010年6月13日 发表评论 336 views 阅读评论

一、http_load

http_load以并行复用的方式运行,用以测试web服务器的吞吐量与负载。但是它不同于大多数压力测试工具,它可以以一个单

一的进程运行,一般不会把客户机搞死。还可以测试HTTPS类的网站请求。
#wget http://www.acme.com/software/http_load/http_load-12mar2006.tar.gz
#tar zxvf http_load-12mar2006.tar.gz
#cd http_load-12mar2006
#make && make install
#http_load -p并发访问进程数 -f总计的访问次数 -r每秒的访问频率 -s访问时间  需要访问的url文件
#echo "http://192.168.1.101/test.php" >1.txt
#http_load -p 30 -s 60 1.txt
7751 fetches, 30 max parallel, 2.9119e+08 bytes, in 60.0024 seconds
37568 mean bytes/connection
129.178 fetches/sec, 4.85297e+06 bytes/sec
msecs/connect: 77.8017 mean, 3050.89 max, 30.308 min
msecs/first-response: 50.3716 mean, 9148.3 max, 31.205 min
HTTP response codes:code 200 -- 7751                说明打开响应页面的类型

http://www.acme.com/software这个网站上有很多小工具:http_ping、http_get、http_post

还有一个secure HTTP server:thttpd

二、webbench

#wget http://blog.s135.com/soft/linux/webbench/webbench-1.5.tar.gz
#tar zvxf webbench-1.5.tar.gz
#cd webbench-1.5
#make && make install
webbench -c 并发数 -t 运行测试时间 url
#webbench -c 5000 -t 30 http://192.168.1.101/test.php

三、ab

ab是apache自带的一款功能强大的测试工具,一般安装apache就默认安装的
#/usr/local/apache/bin/ab -c 100 -n 100 http://192.168.1.101/test.php
-c -n 是常用的两个
This is ApacheBench, Version 2.3 <$Revision: 655654 mce_markergt;
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.1.101 (be patient).....done

Server Software:        Apache/2.2.3
Server Hostname:        192.168.8.201
Server Port:            80

Document Path:          /1.php
Document Length:        37752 bytes

Concurrency Level:      100
Time taken for tests:   0.908 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      3923458 bytes
HTML transferred:       3905226 bytes
Requests per second:    110.11 [#/sec] (mean)
Time per request:       908.165 [ms] (mean)
Time per request:       9.082 [ms] (mean, across all concurrent requests)
Transfer rate:          4218.95 [Kbytes/sec] received

Connection Times (ms)
min  mean[+/-sd] median   max
Connect:       34   34   1.8     34      42
Processing:   109  519 246.1    474     868
Waiting:       35   78  61.8     56     285
Total:        151  553 245.5    508     901

Percentage of the requests served within a certain time (ms)
50%    508
66%    797
75%    814
80%    840
90%    883
95%    883
98%    901
99%    901
100%    901 (longest request)

四、Siege

一款开源的压力测试工具,可以根据配置对一个WEB站点进行多用户的并发访问,记录每个用户所有请求过程的相应时间,并在一定数量的并发访问下重复进行。
#wget ftp://ftp.joedog.org/pub/siege/siege-latest.tar.gz
#tar zvxf siege-latest.tar.gz
#cd siege-latest
#./configure && make && make install
#siege -c 100 -r 100 http://192.168.1.101/test.php
Transactions:                  10000 hits  1w点击率
Availability:                 100.00 %     成功率
Elapsed time:                  90.29 secs  总共用时
Data transferred:             365.56 MB    总共数据的传输
Response time:                  0.21 secs  显示网络连接的速度
Transaction rate:             110.75 trans/sec每秒完成处理次数
Throughput:                     4.05 MB/sec 平均每秒传送数据
Concurrency:                   23.61        最高并发量
Successful transactions:       10000        成功次数
Failed transactions:               0        失败次数
Longest transaction:           14.70        每次传输所花最长时间
Shortest transaction:           0.12        每次传输所花最短时间

相关文章

分类: 技术文章 标签: , ,
  1. 本文目前尚无任何评论.