банальное

вылезло банальное…


# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: [warn] 4096 worker_connections exceed open file resource limit: 1024
nginx: configuration file /etc/nginx/nginx.conf test is successful
#


OMG 2020 :)


 ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 95655
max locked memory       (kbytes, -l) 64
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) 95655
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited


# ulimit -n 65536



# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 95655
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 65536
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) 95655
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
#



# service nginx restart
Redirecting to /bin/systemctl restart nginx.service
#


кол-во открытых
for pid in `pidof nginx`; do echo "$(< /proc/$pid/cmdline)"; egrep 'files|Limit' /proc/$pid/limits; echo "Currently open files: $(ls -1 /proc/$pid/fd | wc -l)"; echo; done


в 2х строках

# vi /etc/sysctl.conf
fs.file-max = 64000

Edit /etc/security/limits.conf and add:
nginx soft nofile 64000
nginx hard nofile 64000

echo ‘NGINX_ULIMIT=»-n 64000″‘ >> /etc/sysconfig/nginx

Edit /usr/lib/systemd/system/nginx.service and add a line in the [Service] section:
LimitNOFILE=64000

In /etc/sysconfig/nginx.systemd add:
LimitNOFILE=64000

Reload system daemon:
# systemctl —system daemon-reload
# sysctl -p


смотрим еще и старую тему https://dzek.ru/blog/linux/271.html

0 комментариев

Только зарегистрированные и авторизованные пользователи могут оставлять комментарии.