これまで負荷テストには、 apache bench (ab)を使用してきましたが、 ランダムなurlにアクセスすることで、より本番に近い負荷を発生させたい為、 siege を試してみます。
https://github.com/JoeDog/siege
install
$ wget https://github.com/JoeDog/siege/archive/v4.0.4.tar.gz $ tar -xvf v4.0.4.tar.gz $ cd siege-4.0.4 $ less INSTALL $ ./utils/bootstrap + aclocal + autoheader + automake --foreign --copy + autoconf + utils/manifier doc/siege.pod doc/siege.1.in 'Siege Load Tester' 1 + utils/manifier doc/siege.config.pod doc/siege.config.1.in 'siege.config utility' 1 + utils/manifier doc/bombardment.pod doc/bombardment.1.in bombardment 1 + utils/manifier doc/bombardment.pod doc/siege2csv.1.in siege2csv 1 $ ./configure : config.status: executing default-6 commands -------------------------------------------------------- Configuration is complete Run the following commands to complete the installation: make make install For complete documentation: http://www.joedog.org -------------------------------------------------------- $ make $ make check $ sudo make install $ /usr/local/bin/siege --version SIEGE 4.0.4 Copyright (C) 2017 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.
config
と言っても、基本的に設定は不要?です。
私の場合、テスト対象のサイトに basic認証がある為、「login = ~」 を追記しています。
$ vi ~/.siegerc/siege.conf login = ないしょID:ないしょID
負荷生成
$ vi ./urls.txt ↓url一覧を記載して下さい http://cent80.a5.jp/?????/GXuchuu.pl http://cent80.a5.jp/?????/GXuchuu.pl?ac=view_juchuu&i_hid=331078 : $ /usr/local/bin/siege \ --concurrent=5 \ --time=120S \ --benchmark \ --file=./urls.txt \ --internet