ps ax | grep nginx | grep worker
11151 ? S 0:01 nginx: worker process
↓ 11151 から次のコマンドを実行
cat /proc/11151/limits
Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 8388608 unlimited bytes
Max core file size 0 unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 1866 1866 processes
Max open files 20000 20000 files
Max locked memory 65536 65536 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 1866 1866 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us
Max open files 20000 となっています。
cat /etc/nginx/nginx.conf | grep worker_rlimit_nofile
20000
cat /proc/sys/fs/file-max
vi /etc/nginx/nginx.conf
例: worker_rlimit_nofile を 40000 に設定する
worker_rlimit_nofile 40000;
nginx のリスタート
nginx -s reload