Hello
In some server that have 700 domains, I have the error with nginx :
nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: [emerg] open() "/var/www/vhosts/system/xxxxxxxxx/logs/proxy_access_ssl_log" failed (24: Too many open files)
nginx: configuration file /etc/nginx/nginx.conf test failed
I try this support article : Nginx fails: Too many open files also with 8192, and same error.
I increase fs.file-max = 70000 in sysctl.conf, I increase /etc/security/limits.conf limits
root soft nofile 64000
root hard nofile 64000
nginx soft nofile 64000
nginx hard nofile 64000
also in /etc/security/limits.d/20-nproc.conf
* soft nproc 64000
root soft nproc unlimited
Also change the daemon :
cat /etc/systemd/system/nginx.service.d/local.conf
[Service]
LimitNOFILE=128104
See these limits
# ps -axwwww | grep nginx
17564 ? Ss 0:00 nginx: master process /usr/sbin/nginx
17565 ? S 0:00 nginx: worker process
17567 ? S 0:00 nginx: worker process
17569 ? S 0:00 nginx: worker process
17570 ? S 0:00 nginx: worker process
22232 pts/0 S+ 0:00 grep --color=auto nginx
# cat /proc/17564/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 128104 128104 processes
Max open files 128104 128104 files
Max locked memory 65536 65536 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 128104 128104 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us
Error still present... I don't know what more I can change...
In some server that have 700 domains, I have the error with nginx :
nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: [emerg] open() "/var/www/vhosts/system/xxxxxxxxx/logs/proxy_access_ssl_log" failed (24: Too many open files)
nginx: configuration file /etc/nginx/nginx.conf test failed
I try this support article : Nginx fails: Too many open files also with 8192, and same error.
I increase fs.file-max = 70000 in sysctl.conf, I increase /etc/security/limits.conf limits
root soft nofile 64000
root hard nofile 64000
nginx soft nofile 64000
nginx hard nofile 64000
also in /etc/security/limits.d/20-nproc.conf
* soft nproc 64000
root soft nproc unlimited
Also change the daemon :
cat /etc/systemd/system/nginx.service.d/local.conf
[Service]
LimitNOFILE=128104
See these limits
# ps -axwwww | grep nginx
17564 ? Ss 0:00 nginx: master process /usr/sbin/nginx
17565 ? S 0:00 nginx: worker process
17567 ? S 0:00 nginx: worker process
17569 ? S 0:00 nginx: worker process
17570 ? S 0:00 nginx: worker process
22232 pts/0 S+ 0:00 grep --color=auto nginx
# cat /proc/17564/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 128104 128104 processes
Max open files 128104 128104 files
Max locked memory 65536 65536 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 128104 128104 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us
Error still present... I don't know what more I can change...