Siege
https://github.com/JoeDog/siege
Siege は、ページ内の画像や CSS、JavaScript なども同時にリクエストしたり、URL リストからランダムでアクセスしたり、POST リクエストを投げたりすることができる負荷テストツール。
インストール
CentOS にインストールする場合、 EPEL リポジトリからインストールできる。
バージョンは最新の 4.0.2 がインストールされる。
yum install epel-release
yum install siege
設定ファイルは ~/.siege/siege.conf に生成される。
テスト実施
siege -c 3 -t 3S http://example.com/
| 省略 | オプション | 内容 |
|---|---|---|
| -c | --concurrent=NUM | 同時接続ユーザー数。デフォルト値は 10 |
| -r | --reps=NUM | REPS, number of times to run the test. |
| -t | --time=NUMm | TIMED testing where "m" is modifier S, M, or H ex: --time=1H, one hour test. |
| -H | --header="text" | リクエストヘッダーの追加 (複数指定可) |
| -A | --user-agent="text" | User-Agent の指定 |
| -T | --content-type="text" | Content-Type の指定 |
| -g | --get | GET, pull down HTTP headers and display the transaction. Great for application debugging. |
| -d | --delay=NUM | Time DELAY, random delay before each requst |
| -b | --benchmark | BENCHMARK: no delays between requests. |
| -i | --internet | インターネットユーザーシミュレーション。URLへランダムアクセス |
| -f | --file=FILE | URL一覧ファイルの指定 |
| -R | --rc=FILE | siegerc ファイルの指定 |
| -l | --log[=FILE] | ファイルへのログ出力。FILE が未指定の場合のデフォルト値は PREFIX/var/siege.log |
| -m | --mark="text" | MARK, mark the log file with a string. between .001 and NUM. (NOT COUNTED IN STATS) |
| -V | --version | バージョン番号の表示 |
| -h | --help | ヘルプの表示 |
| -C | --config | 現在の設定を表示 |
| -v | --verbose | 画面に通知を表示 |
| -q | --quiet | 冗長表示をオフにして出力を抑止 |
結果
** SIEGE 4.0.2
** Preparing 10 concurrent users for battle.
The server is now under siege...
HTTP/1.1 200 0.21 secs: 606 bytes ==> GET /
HTTP/1.1 200 0.22 secs: 606 bytes ==> GET /
HTTP/1.1 200 0.23 secs: 606 bytes ==> GET /
.
.
.
Lifting the server siege...
Transactions: 14 hits
Availability: 100.00 %
Elapsed time: 2.34 secs
Data transferred: 0.01 MB
Response time: 0.27 secs
Transaction rate: 5.98 trans/sec
Throughput: 0.00 MB/sec
Concurrency: 1.63
Successful transactions: 14
Failed transactions: 0
Longest transaction: 0.43
Shortest transaction: 0.21
| 項目 | 内容 | 出力例 |
|---|---|---|
| Transactions | リクエスト数 | 14 hits |
| Availability | 成功率 | 100.00 % |
| Elapsed time | 処理時間 | 2.34 secs |
| Data transferred | データ転送量 | 0.01 MB |
| Response time | レスポンス時間 | 0.27 secs |
| Transaction rate | 秒間リクエスト数 | 5.98 trans/sec |
| Throughput | スループット(秒間処理データ量) | 0.00 MB/sec |
| Concurrency | 平均同時接続数 | 1.63 |
| Successful transactions | 成功したリクエスト数 | 14 |
| Failed transactions | 失敗したリクエスト数 | 0 |
| Longest transaction | 最長リクエスト秒 | 0.43 |
| Shortest transaction | 最短リクエスト秒 | 0.21 |