手机
当前位置:查字典教程网 >操作系统 >unix linux >Linux中安装使用http_load对服务器进行压力测试的教程
Linux中安装使用http_load对服务器进行压力测试的教程
摘要:http_load基于linux平台的一种性能测工具。以并行复用的方式运行,用以测试web服务器的吞吐量与负载,测试web页面的性能。1、下...

http_load基于linux平台的一种性能测工具。以并行复用的方式运行,用以测试web服务器的吞吐量与负载,测试web页面的性能。

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选其中一个。

4、示例:

http_load -parallel 50 -s 10 urls.txt

这段命令行是同时使用50个进程,随机访问urls.txt中的网址列表,总共访问10秒。

http_load -rate 50 -f 5000 urls.txt

每秒请求50次,总共请求5000次停止。

测试网站每秒所能承受的平均访问量:

http_load -parallel 5-fetches 1000urls.txt

这段命令行是同时使用5个进程,随机访问urls.txt中的网址列表,总共访问1000次。运行之后的结果:

1000 fetches, 5 max parallel, 6e+06 bytes, in 58.1026 seconds

6000 mean bytes/connection

17.2109 fetches/sec, 103266 bytes/sec

msecs/connect: 0.403263 mean, 68.603 max, 0.194 min

msecs/first-response: 284.133 mean, 5410.13 max, 55.735 min

HTTP response codes:

code 200 — 1000

从上面的运行结果来看,目标网站仅仅能够承受每秒17次访问,不够强壮。

【Linux中安装使用http_load对服务器进行压力测试的教程】相关文章:

Linux中编译安装Subversion(SVN)客户端的教程

Linux中安装oray服务的步骤分享

Linux Apache Web 服务器终极教程

解决安装Domino for Linux时配置的Web服务器无法启动的问题

Linux2.6对新型CPU的支持

Linux上安装GCC编译器过程

Linux下使用httpry来嗅探HTTP流量教程

Linux下 Sendmail服务器 转发功能的讲解

Linux下Web服务器架设攻略

Linux下的代理服务器设置

精品推荐
分类导航