ulimit -aで現在のリミットを確認
変更するには、
/etc/security/limits.conf
を編集する。
sysctl -p
で更新。
例えば、nginx で Too many open files が出たら、
/etc/security/limits.conf に下記を追加
nginx soft nofile 10000
nginx hard nofile 30000
worker_rlimit_nofile 30000;
nginxを再起動して確認。
# /usr/local/nginx/sbin/nginx -t && /usr/local/nginx/sbin/nginx -s reload
# su - nginx
$ ulimit -Hn
$ ulimit -Sn
変更するには、
/etc/security/limits.conf
を編集する。
sysctl -p
で更新。
例えば、nginx で Too many open files が出たら、
/etc/security/limits.conf に下記を追加
nginx soft nofile 10000
nginx hard nofile 30000
sysctl -p
で更新。nginx.confに下記を追加worker_rlimit_nofile 30000;
nginxを再起動して確認。
# /usr/local/nginx/sbin/nginx -t && /usr/local/nginx/sbin/nginx -s reload
# su - nginx
$ ulimit -Hn
$ ulimit -Sn





