http_load
1. 官方描述:
- http_load runs multiple http fetches in parallel, to test the throughput of a web server. However unlike most such test clients, it runs in a single process, so it doesn't bog down the client machine. It can be configured to do https fetches as well.
- You give it a file containing a list of URLs that may be fetched, a flag specifying how to start connections (either by rate or by number of simulated users), and a flag specifying when to quit (either after a given number of fetches or a given elapsed time). There are also optional flags for checksums, throttling, random jitter, and progress reports.
reference: http://www.acme.com/software/http_load/
2. 安装方法:
- 将MakeFile中的SSL_TREE,SSL_DEFS,SSL_INC,SSL_LIBS注释去掉。其中SSL_TREE是openssl的安装路径。
- 如果是Solaris这样的SystemV系统,将SYSV_LIBS注释去掉
3. 使用方法:
http_load -parallel 5 -fetches 1000 urls.txthttp_load -rate 2 -seconds 300 urls.txt
样例含义
- -parallel 简写-p :含义是并发的用户进程数。
- -fetches 简写-f :含义是总计的访问次数
- -rate 简写-r :含义是每秒的访问频率
- -seconds简写-s :含义是总计的访问时间
- urls.txt 是一个url 列表,每个url 单独的一行;不可以直接跟一个url,有些博客主说的可以跟一个url是错误的说法。
4. 结果分析:
49 fetches, 2 max parallel, 289884 bytes, in 10.0148 seconds5916 mean bytes/connection4.89274 fetches/sec, 28945.5 bytes/secmsecs/connect: 28.8932 mean, 44.243 max, 24.488 minmsecs/first-response: 63.5362 mean, 81.624 max, 57.803 minHTTP response codes:code 200 -- 49
- 49 fetches, 2 max parallel, 289884 bytes, in 10.0148 seconds
- 一共发送了49次请求,最大并发数是2,发送了289884 字节, 用时10.0148秒
- 5916 mean bytes/connection
- 每次请求平均发送5916字节
- 4.89274 fetches/sec, 28945.5 bytes/sec
- 每秒请求数是4.89274(qps) , 每秒发送28945.5字节
- msecs/connect: 28.8932 mean, 44.243 max, 24.488 min
- 平均每个请求耗时28.8932msecs, 请求耗时最大44.243 msecs, 最小耗时24.488 msecs
- msecs/first-response: 63.5362 mean, 81.624 max, 57.803 min
- 首次平均响应时间63.5362msecs, 最大耗时81.624msecs, 最小耗时57.803msecs
- HTTP response codes: code 200 -- 49
- http响应码,返回200的有49次
由于http_load自身https的算法问题,发送压力测试请求的client机器成为了瓶颈,无法体现真实的https数据。所以又采用了httperf进行测试。
压力测试集合