infoMore 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
List of users who liked
23Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
What you can do with signing up