http_loadでベンチマークしてた一日だった
abコマンドは
Apacheのabコマンドでベンチマークを測定する | Linuxで自宅サーバ構築
こんな感じでやったことあったけど、先輩に今日はhttp_load教えてもらった。
http://www.acme.com/software/http_load/
wget http://www.acme.com/software/http_load/http_load-12mar2006.tar.gz tar xvfz http_load-12mar2006.tar.gz cd http_load-12mar2006 make
gccないって怒られた
sudo yum install gcc make make install
なんかエラー吐いた
mkdir /usr/local/man/ mkdir /usr/local/man/man1 make install
これでhttp_loadコマンド打てた。
abコマンドとの違いを調べると
複数のURLに対して同時にhttpアクセスできる
ってのが売りらしい。
/home/ec2-user/sample.txt
http://hoge.com/sample.png http://hoge.com/sample.png http://hogepiyo.com/sample.png http://hogehoge.com/sample.png http://hogepiyopiyo.com/sample.png
こんな感じでテキストにベンチマークしたい先のURLを書いておく。 複数のURLがあることがここでわかる。
あとはこんな感じでコマンド打つ
http_load -parallel 150 -seconds 10 sample.txt
parallelが同時接続数 secondsが接続する秒数
レスポンスはこんな感じ。
4184 fetches, 110 max parallel, 4.66704e+08 bytes, in 10 seconds 111545 mean bytes/connection 418.4 fetches/sec, 4.66704e+07 bytes/sec msecs/connect: 46.8614 mean, 95.575 max, 0.831 min msecs/first-response: 81.2267 mean, 217.853 max, 3.516 min HTTP response codes: code 200 -- 4184