【原创】测试基础之http_load(1)简介、安装、使用

时间:2024-09-22 17:07:56

http_load-09Mar2016
官方:https://acme.com/software/http_load/

一 简介

http_load - multiprocessing http test client

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.

二 安装

# wget https://acme.com/software/http_load/http_load-09Mar2016.tar.gz
# cd http_load-09Mar2016
# make

三 使用

$ ./http_load -h
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.

准备urls文件

$ echo 'http://localhost:80' > urls

测试

$ ./http_load -parallel 2 -seconds 10 urls
49 fetches, 2 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
HTTP response codes:
code 200 -- 49