使用http_load来给Linux系统的服务器做压力测试
2015-10-28 11:51
781 查看
介绍个http_load压力测试工具,http_load,类似的工具还有webbench、ab、Siege。
1、下载
官方网站:http://acme.com/software/http_load/
2、安装
执行完make,会在当前目录生成一个http_load二进制文件。
3、使用方法
One start specifier, either -parallel or -rate, is required.
One end specifier, either -fetches or -seconds, is required.
主要参数说明:
-parallel 简写-p :含义是并发的用户进程数。
-rate 简写-r :含义是每秒的访问频率
-fetches 简写-f :含义是总计的访问次数
-seconds简写-s :含义是总计的访问时间
选择参数时,-parallel和-rate选其中一个,-fetches和-seconds选其中一个。
示例:
http_load -parallel 50 -s 10 urls.txt
这段命令行是同时使用50个进程,随机访问urls.txt中的网址列表,总共访问10秒。
http_load -rate 50 -f 5000 urls.txt
每秒请求50次,总共请求5000次停止。
4、基本的返回值
(1).49 fetches, 2 max parallel, 289884 bytes, in 10.0148 seconds
说明在上面的测试中运行了49个请求,最大的并发进程数是2,总计传输的数据是289884bytes,运行的时间是10.0148秒
(2).5916 mean bytes/connection
说明每一连接平均传输的数据量289884/49=5916
(3).4.89274 fetches/sec, 28945.5 bytes/sec
说明每秒的响应请求为4.89274,每秒传递的数据为28945.5 bytes/sec
(4).msecs/connect: 28.8932 mean, 44.243 max, 24.488 min
说明每连接的平均响应时间是28.8932 msecs,最大的响应时间44.243 msecs,最小的响应时间24.488 msecs
(5).msecs/first-response: 63.5362 mean, 81.624 max, 57.803 min
(6).HTTP response codes: code 200 -- 49
说明打开响应页面的类型,如果403的类型过多,那可能要注意是否系统遇到了瓶颈。
特殊说明:这里,我们一般会关注到的指标是fetches/sec、msecs/connect
他们分别对应的常用性能指标参数Qpt-每秒响应用户数和response time,每连接响应用户时间。测试的结果主要也是看这两个值。当然仅有这两个指标并不能完成对性能的分析,我们还需要对服务器的cpu、men进行分析,才能得出结论
5、如果你需要测试https,你必须将 Makefile中
由于使用到openssl,你必须安装openssl和相应的开发环境
所以上面红色字体部分必须修改
1、下载
官方网站:http://acme.com/software/http_load/
cd /root wget http://acme.com/software/http_load/http_load-12mar2006.tar.gz tar xzf http_load-12mar2006.tar.gz
2、安装
cd http_load-12mar2006 make
执行完make,会在当前目录生成一个http_load二进制文件。
3、使用方法
root@www:~/http_load-12mar2006# ./http_load --help usage: ./http_load [-checksum] [-throttle] [-proxy host:port] [-verbose] [-timeout secs] [-sip sip_file] -parallel N | -rate N [-jitter] -fetches N | -seconds N url_file
One start specifier, either -parallel or -rate, is required.
One end specifier, either -fetches or -seconds, is required.
主要参数说明:
-parallel 简写-p :含义是并发的用户进程数。
-rate 简写-r :含义是每秒的访问频率
-fetches 简写-f :含义是总计的访问次数
-seconds简写-s :含义是总计的访问时间
选择参数时,-parallel和-rate选其中一个,-fetches和-seconds选其中一个。
示例:
http_load -parallel 50 -s 10 urls.txt
这段命令行是同时使用50个进程,随机访问urls.txt中的网址列表,总共访问10秒。
http_load -rate 50 -f 5000 urls.txt
每秒请求50次,总共请求5000次停止。
4、基本的返回值
(1).49 fetches, 2 max parallel, 289884 bytes, in 10.0148 seconds
说明在上面的测试中运行了49个请求,最大的并发进程数是2,总计传输的数据是289884bytes,运行的时间是10.0148秒
(2).5916 mean bytes/connection
说明每一连接平均传输的数据量289884/49=5916
(3).4.89274 fetches/sec, 28945.5 bytes/sec
说明每秒的响应请求为4.89274,每秒传递的数据为28945.5 bytes/sec
(4).msecs/connect: 28.8932 mean, 44.243 max, 24.488 min
说明每连接的平均响应时间是28.8932 msecs,最大的响应时间44.243 msecs,最小的响应时间24.488 msecs
(5).msecs/first-response: 63.5362 mean, 81.624 max, 57.803 min
(6).HTTP response codes: code 200 -- 49
说明打开响应页面的类型,如果403的类型过多,那可能要注意是否系统遇到了瓶颈。
特殊说明:这里,我们一般会关注到的指标是fetches/sec、msecs/connect
他们分别对应的常用性能指标参数Qpt-每秒响应用户数和response time,每连接响应用户时间。测试的结果主要也是看这两个值。当然仅有这两个指标并不能完成对性能的分析,我们还需要对服务器的cpu、men进行分析,才能得出结论
5、如果你需要测试https,你必须将 Makefile中
# CONFIGURE: If you want to compile in support for https, uncomment these # definitions. You will need to have already built OpenSSL, available at # <a href="http://www.openssl.org/">http://www.openssl.org/</a> Make sure the SSL_TREE definition points to the # tree with your OpenSSL installation - depending on how you installed it, # it may be in /usr/local instead of /usr/local/ssl. SSL_TREE = /usr SSL_DEFS = -DUSE_SSL SSL_INC = -I$(SSL_TREE)/include SSL_LIBS = -L$(SSL_TREE)/lib -lssl -lcrypto
由于使用到openssl,你必须安装openssl和相应的开发环境
apt-get install openssl apt-get install libssl-dev</p> <p>find -name ssl.h /usr/include/openssl/ssl.h
所以上面红色字体部分必须修改
相关文章推荐
- aauto攫http数据
- IOS网络笔记--(系统的)下拉刷新
- android-async-http框架库使用基础
- 配置https
- Android5.0以上使用XUtils访问网络出现错误: java.io.IOException: stack size 1036KB
- 在WMWare 安装Redhat Linux 6.4 basic server版本(没有图形界面)网络连接
- Java网络socket编程详解
- 计算机网络常见概念
- HTTP通信过程原理
- http的post传送文件详解
- Erlang HTTP client:ibrowse
- 在服务器上用Fiddler抓取HTTPS流量
- 使用wireshake调试HTTP2
- HttpClient发送后台请求
- Spring3.2异步处理http请求
- 配置Tomcat使用https协议(配置SSL协议)
- 【Java TCP/IP Socket】构建和解析自定义协议消息(含代码)
- MTK平台下用Socket如何实现HTTP请求
- 计算机网络-http简介
- IDEA maven web 问题 -- maven包由于网络问题不能自动下载--本地包无法识别-解决