Nginx - Too many open files

Материал из Wiki - Iphoster - the best ever hosting and support. 2005 - 2024
Перейти к:навигация, поиск

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