LoginSignup
23
20

More than 5 years have passed since last update.

gatlingによる負荷試験で、負荷をかける側にしたチューニング

Last updated at Posted at 2016-07-08

前提条件

  • gatlingで、他サーバーで動いているwebアプリケーションに負荷をかける
  • webアプリケーション側はきちんとチューニングされている

発生したエラーとその対処

j.n.ConnectException: 要求アドレスに割り当てられません

  • これが出た場合、socketが枯渇している可能性がある
  • time_waitになっているsocketの再利用を許可する
/etc/sysctl.conf

net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1

j.u.c.TimeoutException: Request timeout to not-connected after 60000ms

  • ファイルディスクリプタ数が限度オーバーした可能性がある
  • ulimit -nを叩いて確認。デフォルト値1024だったりするので、これを引き上げる必要がある
  • gatling実行中、ps aux | grep gatlingでプロセスIDを確認
  • cat /proc/<PID>/limits でMax open filesを確認
  • gatling実行でエラーが出たタイミングで、ls /proc/<PID>/fd | wc -lし、上記で確認したlimitsを超えそうならビンゴ
  • /etc/security/limits.confで上限を増やす
/etc/security/limits.conf

* soft nofile 65536
* hard nofile 65536
23
20
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
23
20