NGINX * 7060上游超时(110:连接超时)

时间:2017-08-22 17:01:12

标签: nginx

今天我的VIN上的NGINX出现了这个错误,php7:

  

2017/08/22 07:46:09 [错误] 19191#19191:* 7060上游超时   (110:连接超时)从读取响应头时   upstream,client:111.11.11.111,server:somedomain.com,request:“GET   / COM $

我对服务器进行了硬重置,现在一切正常。但究竟是什么呢,它为什么会再次发生呢?

这是我的nginx.conf:

user www-data;
worker_processes auto;
pid /run/nginx.pid;

events {
        worker_connections 768;
        # multi_accept on;
}

http {
        ##
        # Basic Settings
        ##

        #custom added 22.08.2017
        proxy_read_timeout 300;
        #end custom
        client_max_body_size 800m;

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        # server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # SSL Settings
        ##

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;

        ##
        # Logging Settings
        ##

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        ##
        # Gzip Settings
        ##

        gzip on;
        gzip_disable "msie6";

        # gzip_vary on;
        # gzip_proxied any;
        # gzip_comp_level 6;
        # gzip_buffers 16 8k;
        # gzip_http_version 1.1;
        # gzip_types text/plain text/css application/json 
        application/javascript text/xml application/xml appli$

        ##
        # Virtual Host Configs
        ##

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
}

1 个答案:

答案 0 :(得分:2)

最后,我发现了这个问题!

我同时有太多的进程。

问题出在php-fpm设置中。

所以这个错误我在php日志中有: (所以,如果你有相同的问题检查PHP日志) enter image description here

在网络上,我发现了article

我添加更改后的www.conf文件:

pm.max_children = 40

然后我重启php-fpm:

systemctl restart php7.0-fpm.service