Hello,
My nginx was build from source on Debian Jessie
--prefix=/etc/nginx --modules-path=/usr/lib/nginx/modules --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/lock/nginx.lock --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/cache/nginx/tmp/client --http-proxy-temp-path=/var/cache/nginx/tmp/proxy --http-fastcgi-temp-path=/var/cache/nginx/tmp/fastcgi --http-scgi-temp-path=/var/cache/nginx/tmp/scgi --http-uwsgi-temp-path=/var/cache/nginx/tmp/uwsgi --with-http_v2_module --with-http_stub_status_module --with-http_realip_module --with-http_ssl_module --with-http_secure_link_module --with-http_geoip_module=dynamic --user=nginx --group=nginx
nginx.conf:
worker_rlimit_nofile 8192;
As root
ulimit -n 65536
When starting /etc/init.d/nginx start - everything is ok
lsof -u nginx|wc -l
3333
, but when reloading i get
[emerg] 18662#0: open() "/var/log/nginx/access/foo.log" failed (24: Too many open files)
lsof -u nginx|wc -l
2776
Master proces
cat /proc/21101/limits
Max open files 1024 4096 files
One of workers
cat /proc/21102/limits
Max open files 8192 8192 files
I can't figure why this problem occurs when reloading and not when starting. How to avoid it?
My nginx was build from source on Debian Jessie
--prefix=/etc/nginx --modules-path=/usr/lib/nginx/modules --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/lock/nginx.lock --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/cache/nginx/tmp/client --http-proxy-temp-path=/var/cache/nginx/tmp/proxy --http-fastcgi-temp-path=/var/cache/nginx/tmp/fastcgi --http-scgi-temp-path=/var/cache/nginx/tmp/scgi --http-uwsgi-temp-path=/var/cache/nginx/tmp/uwsgi --with-http_v2_module --with-http_stub_status_module --with-http_realip_module --with-http_ssl_module --with-http_secure_link_module --with-http_geoip_module=dynamic --user=nginx --group=nginx
nginx.conf:
worker_rlimit_nofile 8192;
As root
ulimit -n 65536
When starting /etc/init.d/nginx start - everything is ok
lsof -u nginx|wc -l
3333
, but when reloading i get
[emerg] 18662#0: open() "/var/log/nginx/access/foo.log" failed (24: Too many open files)
lsof -u nginx|wc -l
2776
Master proces
cat /proc/21101/limits
Max open files 1024 4096 files
One of workers
cat /proc/21102/limits
Max open files 8192 8192 files
I can't figure why this problem occurs when reloading and not when starting. How to avoid it?