I run wordpress websites on Nginx server (v 1.21.6).
And recently i saw error like below.
2022/03/07 19:43:41 [crit] 563445#563445: accept4() failed (24: Too many open files)
2022/03/07 19:43:42 [crit] 563445#563445: accept4() failed (24: Too many open files)
I restart Nginx, website access works fine.
And then, I googled to solve this problem, a lot of tutorials and values came up that confused me.
My system info
ulimit -Hn
1048576
ulimit -Sn
1024
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 7581
max locked memory (kbytes, -l) 65536
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 7581
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
Then i added the following values to /etc/sysctl.conf.
fs.file-max = 70000
Did this solve all my problems?
If that's not the case, I'd love to hear some advice on whether I should add another setting.
Thank you.