Nginx - Too many open files: различия между версиями
Материал из Wiki - Iphoster - the best ever hosting and support. 2005 - 2024
Admin iph (обсуждение | вклад) (Новая страница: «=== Nginx - Too many open files === Ошибка в логах nginx: 2023/09/14 18:02:58 [alert] 1132#1132: *4342328 socket() failed (24: Too many open files)...») |
Admin iph (обсуждение | вклад) |
||
Строка 12: | Строка 12: | ||
nginx soft nofile 100000 | nginx soft nofile 100000 | ||
nginx hard nofile 100000 | nginx hard nofile 100000 | ||
+ | |||
+ | # systemctl edit --full nginx.service | ||
+ | [Service] | ||
+ | .... | ||
+ | LimitNOFILE=100000 | ||
+ | |||
+ | # vi /etc/nginx/nginx.conf | ||
+ | worker_rlimit_nofile 100000; | ||
+ | events { | ||
+ | worker_connections 10240; | ||
+ | } | ||
+ | |||
# reboot | # reboot |
Текущая версия на 19:48, 14 сентября 2023
Nginx - Too many open files
Ошибка в логах nginx:
2023/09/14 18:02:58 [alert] 1132#1132: *4342328 socket() failed (24: Too many open files)
Решение:
# vi /etc/sysctl.conf fs.file-max = 100000
# vi /etc/security/limits.conf nginx soft nofile 100000 nginx hard nofile 100000
# systemctl edit --full nginx.service [Service] .... LimitNOFILE=100000
# vi /etc/nginx/nginx.conf worker_rlimit_nofile 100000; events { worker_connections 10240; }
# reboot