Nginx内存不足,不加载新的虚拟主机?

我有一个在debian上运行的nginx。 Nginx将每2分钟刷新一次以获取新创build的虚拟主机。 过了一段时间,新的虚拟主机不再加载,但老的虚拟主机仍然由nginx提供服务

在我的nginx错误日志中,我可以find多个错误。

2014/08/10 06:30:05 [alert] 27891#0: epoll_ctl(1, 4) failed (9: Bad file descriptor) 2014/08/10 06:30:05 [alert] 27892#0: close() channel failed (9: Bad file descriptor) 2014/08/10 06:30:05 [alert] 27893#0: close() channel failed (9: Bad file descriptor) 2014/08/10 06:30:19 [alert] 4806#0: worker process 27891 exited with fatal code 2 and can not be respawn 2014/08/10 06:30:19 [alert] 4806#0: sendmsg() failed (9: Bad file descriptor) 2014/08/10 06:30:05 [alert] 27894#0: close() channel failed (9: Bad file descriptor) 2014/08/10 06:30:20 [alert] 4806#0: sendmsg() failed (9: Bad file descriptor) 2014/08/10 06:30:20 [alert] 4806#0: sendmsg() failed (9: Bad file descriptor) 2014/08/10 06:30:20 [alert] 4806#0: sendmsg() failed (9: Bad file descriptor) 2014/08/10 06:30:20 [alert] 4806#0: sendmsg() failed (9: Bad file descriptor) 

我试图在过去find一个解决scheme,并最终join

worker_rlimit_nofile 300000;

但看起来没有这个伎俩。

我有一种感觉,就是我的盒子在某个时候没有记忆,但是不完全确定。

重新启动nginx解决了这个问题,但是我担心我会在一段时间之后再次遇到这个问题。

另一个奇怪的事情,我看到的是,重新启动nginx后,交换只是在我的统计消失。 (见截图)。

交换空间在nginx重启后不见了

如果你想看到我的nginx.conf,这里是:

 user www-data; worker_processes 4; worker_rlimit_nofile 300000; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; events { worker_connections 2000; # multi_accept on; } http { include /etc/nginx/mime.types; server_names_hash_max_size 812000; geoip_country /etc/nginx/geoip/GeoIP.dat; # the country IP database geoip_city /etc/nginx/geoip/GeoLiteCity.dat; # the city IP database log_format withhost '$host - $remote_addr - $remote_user [$time_local] ' '"$request" $status $body_bytes_sent ' '"$http_referer" "$http_user_agent"'; # access_log /var/log/nginx/access.log withhost; # set_real_ip_from 141.101.64.0/18; # set_real_ip_from 108.162.192.0/18; # set_real_ip_from 190.93.240.0/20; # set_real_ip_from 2400:cb00::/32; # set_real_ip_from 2606:4700::/32; set_real_ip_from 69.164.223.55; set_real_ip_from 212.123.14.6; set_real_ip_from 192.168.255.17; real_ip_header X-Forwarded-For; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; tcp_nodelay on; server_tokens off; gzip on; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; include /etc/nginx/conf.d/*.conf; include /nfs/vhosts/*; include /etc/nginx/sites-enabled/*; } 

希望有人能帮我找出这个问题的原因,并帮我解决这个问题。

问候!