LoginSignup
44
46

More than 5 years have passed since last update.

siegeでお手軽にストレステスト

Posted at

siegeはabより高機能で、JMeterほど面倒くさくないWEBのパフォーマンス測定ツールです。
siegeとは、包囲攻撃という意味の単語で、「シィージ」と発音するみたいです。
アクセス先を複数のURLからランダムで抽出する
インターネットモードがなかなか便利です。

以下CentOSやAmazonLinuxへsiegeの最新版をインストールする手順です。

インストール

yum install gcc

wget http://download.joedog.org/siege/siege-latest.tar.gz
tar xvf siege-latest.tar.gz
cd siege-3.1.0/
./configure
make
make install

siege -V
----------------
SIEGE 3.1.0

Copyright (C) 2015 by Jeffrey Fulmer, et al.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.
----------------

負荷をかけるURLを設定

vi /usr/local/etc/urls.txt
----------
http://hoge.huge/index.html
http://hoge.huge/1.html
http://hoge.huge/2.html
http://hoge.huge/3.html
----------

http://hoge.huge/script POST key1=value1&key2=value2
などと書くとPOSTも可能です。

実行

siege -c 300 -t 10S -b -i -f /usr/local/etc/urls.txt

=>urls.txtからランダムにURLを抽出して、10秒間300同時接続でアクセスをする

実行結果

Transactions: 1442 hits
Availability: 100.00 %
Elapsed time: 1.08 secs
Data transferred: 0.01 MB
Response time: 0.08 secs
Transaction rate: 1335.19 trans/sec
Throughput: 0.01 MB/sec
Concurrency: 103.77
Successful transactions: 1442
Failed transactions: 0
Longest transaction: 0.52
Shortest transaction: 0.00

各項目は以下のような意味です。

Transactions: 合計リクエスト数
Availability: リクエストの成功数
Elapsed time: 負荷をかけた合計時間
Data transferred: データの合計転送量
Response time: 1リクエストあたりの平均処理時間
Transaction rate: 1秒あたりの平均リクエスト数
Throughput: 1秒あたりの平均スループット
Concurrency: 平均同時接続数
Successful transactions: 成功したリクエスト数
Failed transactions: 失敗したリクエスト数
Longest transaction: 1リクエストの最大秒数
Shortest transaction:1リクエストの 最小秒数

ドキュメント

細かいパラメータなどはこちらへ
https://www.joedog.org/siege-manual/

44
46
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
44
46