Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
NGINX多次崩溃_Nginx_Crash_Bind_Php_Epoll - Fatal编程技术网

NGINX多次崩溃

NGINX多次崩溃,nginx,crash,bind,php,epoll,Nginx,Crash,Bind,Php,Epoll,我对NGINX有问题。我有3个运行NGINX和php-fpm的负载平衡(ELB)系统(EC2)。在所有3个系统上,NGINX将神秘地崩溃。下面我已经包括了调试模式下日志的一部分 在我通过日志之前,这里是我关于可能发生的事情的理论,也许有人可以证实或提供一些更好的见解,我可以深入研究。从我在网上找到的;NGINX崩溃的一个主要原因是NFS共享的一个已知问题。当NGINX调用文件并且NFS引擎正忙于“阻塞”时,就会发生这种情况。我可以确认我有大约6个NFS共享连接到这些系统。每个设置的站点都有一个。

我对NGINX有问题。我有3个运行NGINX和php-fpm的负载平衡(ELB)系统(EC2)。在所有3个系统上,NGINX将神秘地崩溃。下面我已经包括了调试模式下日志的一部分

在我通过日志之前,这里是我关于可能发生的事情的理论,也许有人可以证实或提供一些更好的见解,我可以深入研究。从我在网上找到的;NGINX崩溃的一个主要原因是NFS共享的一个已知问题。当NGINX调用文件并且NFS引擎正忙于“阻塞”时,就会发生这种情况。我可以确认我有大约6个NFS共享连接到这些系统。每个设置的站点都有一个。这些共享仅包含必须共享文件的相关目录,如上传的图像和化身

我在网上读到过一个优化方法,就是将NGINX设置为使用“epoll”。虽然我没有在设置中直接说明它,但您可以在日志中看到它的用法。我还是应该将设置添加到CONF文件中吗?NFS共享是我的问题的根源吗

谢谢,非常感谢您的帮助

这里有一个NGINX-V:

nginx version: nginx/1.4.7
built by gcc 4.8.2 20131212 (Red Hat 4.8.2-7) (GCC) 
TLS SNI support enabled
configure arguments: 
--prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx 
--conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log 
--http-log-path=/var/log/nginx/access.log 
--http-client-body-temp-path=/var/lib/nginx/tmp/client_body 
--http-proxy-temp-path=/var/lib/nginx/tmp/proxy 
--http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi 
--http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi 
--http-scgi-temp-path=/var/lib/nginx/tmp/scgi 
--pid-path=/var/run/nginx.pid --lock-path=/var/lock/subsys/nginx 
--user=nginx --group=nginx --with-file-aio --with-ipv6 
--with-http_ssl_module --with-http_spdy_module 
--with-http_realip_module --with-http_addition_module 
--with-http_xslt_module --with-http_image_filter_module 
--with-http_geoip_module --with-http_sub_module --with-http_dav_module 
--with-http_flv_module --with-http_mp4_module --with-http_gunzip_module 
--with-http_gzip_static_module --with-http_random_index_module 
--with-http_secure_link_module --with-http_degradation_module 
--with-http_stub_status_module --with-http_perl_module --with-mail 
--with-mail_ssl_module --with-pcre --with-google_perftools_module 
--with-debug 
--with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' 
--with-ld-opt=' -Wl,-E'
2014/09/17 08:37:46 [debug] 2034#0: worker cycle
2014/09/17 08:37:46 [debug] 2034#0: epoll timer: 11605
2014/09/17 08:37:46 [debug] 2034#0: epoll: fd:69 ev:0005 d:0000000001632281
2014/09/17 08:37:46 [debug] 2034#0: timer delta: 0
2014/09/17 08:37:46 [debug] 2034#0: posted events 0000000001661460
2014/09/17 08:37:46 [debug] 2034#0: posted event 0000000001661460
2014/09/17 08:37:46 [debug] 2034#0: posted event 0000000000000000
2014/09/17 08:37:46 [debug] 2034#0: worker cycle
2014/09/17 08:37:46 [debug] 2034#0: epoll timer: 11605
2014/09/17 08:37:50 [debug] 2034#0: epoll: fd:51 ev:0005 d:0000000001631500
2014/09/17 08:37:50 [debug] 2034#0: *1 event timer del: 51: 1410964731764
2014/09/17 08:37:50 [debug] 2034#0: *1 http process request line
2014/09/17 08:37:50 [debug] 2034#0: *1 http request line: "GET /data/avatars/m/0/163.jpg HTTP/1.1"
2014/09/17 08:37:50 [debug] 2034#0: *1 http uri: "/data/avatars/m/0/163.jpg"
2014/09/17 08:37:50 [debug] 2034#0: *1 http args: ""
2014/09/17 08:37:50 [debug] 2034#0: *1 http exten: "jpg"
2014/09/17 08:37:50 [debug] 2034#0: *1 posix_memalign: 00000000014FA890:4096 @16
2014/09/17 08:37:50 [debug] 2034#0: *1 http process request header line
2014/09/17 08:37:50 [debug] 2034#0: timer delta: 4205
2014/09/17 08:37:50 [debug] 2034#0: posted events 0000000001661460
2014/09/17 08:37:50 [debug] 2034#0: posted event 0000000001661460
2014/09/17 08:37:50 [debug] 2034#0: posted event 0000000000000000
2014/09/17 08:37:50 [debug] 2034#0: worker cycle
2014/09/17 08:37:50 [debug] 2034#0: epoll timer: 7400
2014/09/17 09:03:15 [debug] 2144#0: bind() 0.0.0.0:80 #46 
2014/09/17 09:03:15 [debug] 2144#0: counter: 00007F697920F080, 1
2014/09/17 09:03:15 [debug] 2144#0: posix_memalign: 00000000011CF400:16384 @16
2014/09/17 09:03:18 [debug] 2153#0: bind() 0.0.0.0:80 #46 
2014/09/17 09:03:18 [emerg] 2153#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2014/09/17 09:03:18 [notice] 2153#0: try again to bind() after 500ms
2014/09/17 09:03:18 [debug] 2153#0: bind() 0.0.0.0:80 #46 
2014/09/17 09:03:18 [emerg] 2153#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2014/09/17 09:03:18 [notice] 2153#0: try again to bind() after 500ms
2014/09/17 09:03:18 [debug] 2153#0: bind() 0.0.0.0:80 #46 
2014/09/17 09:03:18 [emerg] 2153#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2014/09/17 09:03:18 [notice] 2153#0: try again to bind() after 500ms
2014/09/17 09:03:18 [debug] 2153#0: bind() 0.0.0.0:80 #46 
2014/09/17 09:03:18 [emerg] 2153#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2014/09/17 09:03:18 [notice] 2153#0: try again to bind() after 500ms
2014/09/17 09:03:18 [debug] 2153#0: bind() 0.0.0.0:80 #46 
2014/09/17 09:03:18 [emerg] 2153#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2014/09/17 09:03:18 [notice] 2153#0: try again to bind() after 500ms
2014/09/17 09:03:18 [emerg] 2153#0: still could not bind()
以下是调试信息:

nginx version: nginx/1.4.7
built by gcc 4.8.2 20131212 (Red Hat 4.8.2-7) (GCC) 
TLS SNI support enabled
configure arguments: 
--prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx 
--conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log 
--http-log-path=/var/log/nginx/access.log 
--http-client-body-temp-path=/var/lib/nginx/tmp/client_body 
--http-proxy-temp-path=/var/lib/nginx/tmp/proxy 
--http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi 
--http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi 
--http-scgi-temp-path=/var/lib/nginx/tmp/scgi 
--pid-path=/var/run/nginx.pid --lock-path=/var/lock/subsys/nginx 
--user=nginx --group=nginx --with-file-aio --with-ipv6 
--with-http_ssl_module --with-http_spdy_module 
--with-http_realip_module --with-http_addition_module 
--with-http_xslt_module --with-http_image_filter_module 
--with-http_geoip_module --with-http_sub_module --with-http_dav_module 
--with-http_flv_module --with-http_mp4_module --with-http_gunzip_module 
--with-http_gzip_static_module --with-http_random_index_module 
--with-http_secure_link_module --with-http_degradation_module 
--with-http_stub_status_module --with-http_perl_module --with-mail 
--with-mail_ssl_module --with-pcre --with-google_perftools_module 
--with-debug 
--with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' 
--with-ld-opt=' -Wl,-E'
2014/09/17 08:37:46 [debug] 2034#0: worker cycle
2014/09/17 08:37:46 [debug] 2034#0: epoll timer: 11605
2014/09/17 08:37:46 [debug] 2034#0: epoll: fd:69 ev:0005 d:0000000001632281
2014/09/17 08:37:46 [debug] 2034#0: timer delta: 0
2014/09/17 08:37:46 [debug] 2034#0: posted events 0000000001661460
2014/09/17 08:37:46 [debug] 2034#0: posted event 0000000001661460
2014/09/17 08:37:46 [debug] 2034#0: posted event 0000000000000000
2014/09/17 08:37:46 [debug] 2034#0: worker cycle
2014/09/17 08:37:46 [debug] 2034#0: epoll timer: 11605
2014/09/17 08:37:50 [debug] 2034#0: epoll: fd:51 ev:0005 d:0000000001631500
2014/09/17 08:37:50 [debug] 2034#0: *1 event timer del: 51: 1410964731764
2014/09/17 08:37:50 [debug] 2034#0: *1 http process request line
2014/09/17 08:37:50 [debug] 2034#0: *1 http request line: "GET /data/avatars/m/0/163.jpg HTTP/1.1"
2014/09/17 08:37:50 [debug] 2034#0: *1 http uri: "/data/avatars/m/0/163.jpg"
2014/09/17 08:37:50 [debug] 2034#0: *1 http args: ""
2014/09/17 08:37:50 [debug] 2034#0: *1 http exten: "jpg"
2014/09/17 08:37:50 [debug] 2034#0: *1 posix_memalign: 00000000014FA890:4096 @16
2014/09/17 08:37:50 [debug] 2034#0: *1 http process request header line
2014/09/17 08:37:50 [debug] 2034#0: timer delta: 4205
2014/09/17 08:37:50 [debug] 2034#0: posted events 0000000001661460
2014/09/17 08:37:50 [debug] 2034#0: posted event 0000000001661460
2014/09/17 08:37:50 [debug] 2034#0: posted event 0000000000000000
2014/09/17 08:37:50 [debug] 2034#0: worker cycle
2014/09/17 08:37:50 [debug] 2034#0: epoll timer: 7400
2014/09/17 09:03:15 [debug] 2144#0: bind() 0.0.0.0:80 #46 
2014/09/17 09:03:15 [debug] 2144#0: counter: 00007F697920F080, 1
2014/09/17 09:03:15 [debug] 2144#0: posix_memalign: 00000000011CF400:16384 @16
2014/09/17 09:03:18 [debug] 2153#0: bind() 0.0.0.0:80 #46 
2014/09/17 09:03:18 [emerg] 2153#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2014/09/17 09:03:18 [notice] 2153#0: try again to bind() after 500ms
2014/09/17 09:03:18 [debug] 2153#0: bind() 0.0.0.0:80 #46 
2014/09/17 09:03:18 [emerg] 2153#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2014/09/17 09:03:18 [notice] 2153#0: try again to bind() after 500ms
2014/09/17 09:03:18 [debug] 2153#0: bind() 0.0.0.0:80 #46 
2014/09/17 09:03:18 [emerg] 2153#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2014/09/17 09:03:18 [notice] 2153#0: try again to bind() after 500ms
2014/09/17 09:03:18 [debug] 2153#0: bind() 0.0.0.0:80 #46 
2014/09/17 09:03:18 [emerg] 2153#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2014/09/17 09:03:18 [notice] 2153#0: try again to bind() after 500ms
2014/09/17 09:03:18 [debug] 2153#0: bind() 0.0.0.0:80 #46 
2014/09/17 09:03:18 [emerg] 2153#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2014/09/17 09:03:18 [notice] 2153#0: try again to bind() after 500ms
2014/09/17 09:03:18 [emerg] 2153#0: still could not bind()
(适用于未来发现此功能的人)

端口80上正在侦听其他内容。可能是另一个http服务器(可能)或您不打算在80上侦听的内容(不太可能)

使用
netstat-plnt | grep':80'
查找它是什么