安装
# macOS
brew install http_load
或则直接去 http://www.acme.com/software/http_load/ 下载
使用
现定一个文本文件,里面放上要压测 url
urls.txt
http://localhost:8888/hello
执行命令
http_load -p 50 -s 5 urls.txt
-p 50
命令表示50个连接进程,-s 5
表示持续 5 秒
结果:
16284 fetches, 50 max parallel, 179124 bytes, in 5.00497 seconds
11 mean bytes/connection
3253.56 fetches/sec, 35789.2 bytes/sec
msecs/connect: 2.44797 mean, 862.047 max, 0.098 min
msecs/first-response: 2.30903 mean, 861.732 max, 0.116 min
HTTP response codes: