设为首页 收藏本站
查看: 774|回复: 0

[经验分享] 几种apache 压力测试工具介绍

[复制链接]

尚未签到

发表于 2018-11-25 08:35:54 | 显示全部楼层 |阅读模式
  原文:http://www.askwan.com/post/6/
  题记:压力和性能测试工具很多,下文讨论的是我觉得比较容易上手,用的比较多的三种
  http_load
  下载地址:http://www.acme.com/software/http_load/http_load-12mar2006.tar.gz
  程序非常小,解压后也不到100K 居家旅行 携带方便 呵呵
  http_load以并行复用的方式运行,用以测试web服务器的吞吐量与负载。但是它不同于大多数压力测试工具,它可以以一个单一的进程运行,一般不会把客户机搞死。可以可以测试HTTPS类的网站请求。
  命令格式:http_load   -p 并发访问进程数   -s 访问时间   需要访问的URL文件
  例如:
引用http_load -p 30 -s 60   urllist.txt  准 备URL文件:tst.list,文件格式是每行一个URL,URL最好超过50-100个测试效果比较好,另外,测试结果中主要的指标是 fetches/sec 这个选项,即服务器每秒能够响应的查询次数,用这个指标来衡量性能。似乎比 apache的ab准确率要高一些,也更有说服力一些。
  官方的例子:
引用  % ./http_load -rate 10 -seconds 60 urllist.txt
  49 fetches, 4 max parallel, 289884 bytes, in 10.0148 seconds
  5916 mean bytes/connection
  4.89274 fetches/sec, 28945.5 bytes/sec
  msecs/connect: 28.8932 mean, 44.243 max, 24.488 min
  msecs/first-response: 63.5362 mean, 81.624 max, 57.803 min
  4.89274 fetches/sec 这个值得就是说服务器每秒能够响应的查询次数为4.8左右
  这个值得是根据 49 fetches / 10.0148 seconds 秒计算出来的
  webbench
  webbench是Linux下的一个网站压力测试工具,最多可以模拟3万个并发连接去测试网站的负载能力。下载地址可以到baidu google搜,我这里给出一个
  下载地址:http://cid-9601b7b7f2063d42.skydrive.live.com/self.aspx/Public/webbench-1.5.tar.gz
  这个程序更小,解压后不到50K,呵呵
  安装非常简单
  #tar zxvf webbench-1.5.tar.gz
  #cd webbench-1.5
  #make && make install
  会在当前目录生成webbench可执行文件,直接可以使用了
  用法:
  webbench -c 并发数 -t 运行测试时间 URL
  如:
  webbench -c 5000 -t 120 http://www.askwan.com
  ab
  ab是apache自带的一款功能强大的测试工具
  安装了apache一般就自带了,
  用法可以查看它的说明
引用$ ./ab  ./ab: wrong number of arguments
  Usage: ./ab [options] [http://]hostname[:port]/path
  Options are:
  -n requests Number of requests to perform
  -c concurrency Number of multiple requests to make
  -t timelimit Seconds to max. wait for responses
  -p postfile File containing data to POST
  -T content-type Content-type header for POSTing
  -v verbosity How much troubleshooting info to print
  -w Print out results in HTML tables
  -i Use HEAD instead of GET
  -x attributes String to insert as table attributes
  -y attributes String to insert as tr attributes
  -z attributes String to insert as td or th attributes
  -C attribute Add cookie, eg. 'Apache=1234. (repeatable)
  -H attribute Add Arbitrary header line, eg. 'Accept-Encoding: gzip'
  Inserted after all normal header lines. (repeatable)
  -A attribute Add Basic WWW Authentication, the attributes
  are a colon separated username and password.
  -P attribute Add Basic Proxy Authentication, the attributes
  are a colon separated username and password.
  -X proxy:port Proxyserver and port number to use
  -V Print version number and exit
  -k Use HTTP KeepAlive feature
  -d Do not show percentiles served table.
  -S Do not show confidence estimators and warnings.
  -g filename Output collected data to gnuplot format file.
  -e filename Output CSV file with percentages served
  -h Display usage information (this message)
  参数众多,一般我们用到的是-n 和-c
  例如:
  ./ab -c 1000 -n 100 http://www.askwan.com/index.php
  这个表示同时处理1000个请求并运行100次index.php文件.


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-639240-1-1.html 上篇帖子: apache 模块 下篇帖子: Centos5下安装Apache Tomcat/7.0.20
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表