http_load 是輕量級 HTTP 壓力測試工具,支援並發進程 (-p) 或固定頻率 (-r)、總請求數 (-f) 或總時間 (-s),適合快速評估 Web 伺服器吞吐量。本文記錄下載編譯與實戰參數範例。
cd /root
wget https://acme.com/software/http_load/http_load-12mar2006.tar.gz
tar xzf http_load-12mar2006.tar.gz
cd http_load-12mar2006
make
# 產生 http_load 二進制檔於當前目錄

| 參數 | 縮寫 | 說明 |
|---|---|---|
| -parallel N | -p N | 並發進程數 (同時 N 個用戶) |
| -rate N | -r N | 每秒請求頻率 (互斥 -p) |
| -fetches N | -f N | 總請求次數 (互斥 -s) |
| -seconds N | -s N | 總測試時間 (秒) (互斥 -f) |
| -checksum | -c | 驗證回應內容校驗和 |
| -throttle | -t | 限制頻寬 (模擬慢速連線) |
| -proxy host:port | 透過代理伺服器測試 | |
| -verbose | -v | 詳細輸出每個請求資訊 |
| -timeout secs | 請求逾時秒數 | |
| -sip sip_file | 指定來源 IP 池檔案 |
必選組合:-p 或 -r (二擇一) + -f 或 -s (二擇一) + url_file (每行一個 URL)。
./http_load -parallel 50 -seconds 10 urls.txt
./http_load -rate 50 -fetches 5000 urls.txt
./http_load -parallel 5 -fetches 1000 urls.txt
輸出結果解讀:
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.403 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
https://example.com/
https://example.com/page1.html
https://example.com/api/data
測試時會隨機從檔案選取 URL。http_load 功能簡潔、無依賴、編譯即用,適合 CI/CD 流程快速基準測試。