查資料注意到 Apache Bench 並沒有 follow redirect 的功能,因此部分的測試可能會不準確。
文章中看到作者推薦了一個新的工具 – Siege,一個功能比 Apache Bench 更完整的 HTTP server 壓力測試工具,可以支援的功能也更齊全:
$ siege -C CURRENT SIEGE CONFIGURATION Mozilla/5.0 (pc-x86_64-linux-gnu) Siege/4.0.4 Edit the resource file to change the settings. ---------------------------------------------- version: 4.0.4 verbose: false color: true quiet: false debug: false protocol: HTTP/1.1 HTML parser: disabled get method: HEAD connection: close concurrent users: 25 time to run: n/a repetitions: n/a socket timeout: 30 cache enabled: false .....
執行測試的範例:
$ siege -c 1 -r 100 'https://www.your.domain/' ** SIEGE 4.0.4 ** Preparing 1 concurrent users for battle. The server is now under siege... Transactions: 200 hits Availability: 100.00 % Elapsed time: 43.85 secs Data transferred: 0.53 MB Response time: 0.22 secs Transaction rate: 4.56 trans/sec Throughput: 0.01 MB/sec Concurrency: 1.00 Successful transactions: 200 Failed transactions: 0 Longest transaction: 0.58 Shortest transaction: 0.11