目录结构 一、http_load
程序非常小,解压后也不到100K 安装很简单#tar zxvf http_load-12mar2006.tar.gz #cd http_load-12mar2006 #make && make install 基本用法:http_load -p 并发访问进程数 -s 访问时间 需要访问的URL文件参数其实可以自由组合,参数之间的选择并没有什么限制。 比如你写成http_load -parallel 5 -seconds 300 urllist.txt也是可以的。 我们把参数给大家简单说明一下。 -parallel 简写-p :含义是并发的用户进程数。 -fetches 简写-f :含义是总计的访问次数 -rate 简写-p :含义是每秒的访问频率 -seconds 简写-s :含义是总计的访问时间 准备URL文件:urllist.txt,文件格式是每行一个URL,URL最好超过50-100个测试效果比较好。 文件格式如下:http://www./ http://www./blog/ http://www./signin/ http://www./signup/ http://www./article/a-quick-look-at-the-redis-source-code.html http://www./article/how-the-browser-end-encryption.html http://www./article/jquery-form-validation-plug-in-validate.js-the-basic-usage.html http://www./article/use-flash-plugin-swfupload-head-is-upload-the-screenshot-in-two-ways.html http://www./article/should-make-your-site-using-html5.html http://www./article/simple-to-understand-linux-memory-allocation-mechanism.html http://www./article/organize-the-sphinx-api-based-on-php.html http://www./article/jquery-1-9-removed-browser-method-alternatives.html http://www./article/the-installation-of-fedora-under-chinese-search-sphinx-configuration.html http://www./article/schema-org-tag-was-used-to-optimize-web-pages.html http://www./article/jquery-reference-manual-tutorials-and-tools.html http://www./article/falling-in-love-with-bike-30-reasons.html http://www./article/online-test-tools-browserstack-cross-browser-compatibility.html http://www./article/talk-about-javascript-image-preloading-technology.html http://www./article/brokeback-mountain.html http://www./article/sql-index-caused-performance-issues.html http://www./article/use-python-scapy-reporter.html http://www./article/a-python-web-attack-script.html 例如:http_load -p 30 -s 60 urllist.txt 参数了解了,我们来看运行一条命令来看看它的返回结果如下:
结果分析:
1、294 fetches, 30 max parallel, 3.83835e+06 bytes, in 60.0026 seconds 二、webbench
webbench是Linux下的一个网站压力测试工具,最多可以模拟3万个并发连接去测试网站的负载能力。 #tar zxvf webbench-1.5.tar.gz #cd webbench-1.5 #make && make install
会在当前目录生成webbench可执行文件,直接可以使用了 例如:#webbench -c 1000 -t 130 http://www. 三、ab
ab是apache自带的一款功能强大的测试工具。 #./ab
参数众多,一般我们用到的是-n 和-c #webbench -c 1000 -t 130 http://www./index.php 这个表示同时处理1000个请求并运行130次index.php文件。 四、Siege一款开源的压力测试工具,可以根据配置对一个WEB站点进行多用户的并发访问,记录每个用户所有请求过程的相应时间,并在一定数量的并发访问下重复进行。 Siege官方:http://www./ Siege下载:http://www./pub/siege/siege-latest.tar.gz Siege解压并安装: # tar -zxvf siege-latest.tar.gz # cd siege-latest/ #./configure #make #make install Siege使用: #siege -c 100 -r 10 -f site.url-c是并发量,-r是重复次数。 url文件就是一个文本,每行都是一个url,它会从里面随机访问的。 site.url内容: http://www./ http://www./ http://www./测试结果:
结果说明:
Transactions: 550 hits //完成550次处理 |
|
来自: 昵称17217556 > 《高并发网站架构》