AWS ELB每天都在崩溃

时间:2016-05-10 17:07:08

标签: performance amazon-web-services nginx uwsgi amazon-elb

我没有解释。

我们正在运行一个ELB,它在AWS上包含6个uWSGI+NGINX静态IP实例。 在附加的图像上,您可以看到每天在负载变化的同时(不知道为什么),然后ELB标记服务器和outOfService,即使它们在直接命中实例时功能正确。

实例为m4.xlarge(16.0 GB,13个单元,4个核心),Centos 7 ami。 iptables丢弃空包。

IPTables规则:

-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -j DROP
-A INPUT -p tcp -m tcp ! --tcp-flags FIN,SYN,RST,ACK SYN -m state --state NEW -j DROP
-A INPUT -f -j DROP
-A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG FIN,SYN,RST,PSH,ACK,URG -j DROP

要求: sum of requests ELB 5xx: sum of 5xx

我们的流量负载在当天没有变化(至少不应该),在我们全球工作时它非常稳定。

问题可能是由uWSGI配置引起的? 见附件:

<pre>
[uwsgi]
    vhost = true
    uid = username
    base =      /path/to/app
    wsgi-file = /path/to/app
    chdir = %(base)
    chown-socket = nginx:nginx
    uid = nginx
    gid = nginx
    chmod-socket = 777
    socket = /var/run/webpage.com.uwsgi.socket
    plugin = python
    master = True
    callable = app
    threads = 10
    vacuum = true
    die-on-term = true
    max-requests = 500
    thread-stacksize = 2048
    cheaper-algo = spare2
    cheaper = 4
    cheaper-initial = 8
    workers = 16
    cheaper-step = 1
    buffer-size = 30000
    disable-logging = True
</pre>

NGINX Config(我知道CORS,故意):

<pre>
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

events {
    worker_connections 1024;
}

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    add_header 'Access-Control-Allow-Origin' "*";
    add_header 'Access-Control-Allow-Credentials' 'true';
    add_header 'Access-Control-Allow-Methods' 'HEAD, GET, POST, OPTIONS';
    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

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

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

    #server {
    #    listen       80 default_server;
    #    listen       [::]:80 default_server;
    #    server_name  _;
    #    root         /usr/share/nginx/html;

        # Load configuration files for the default server block.
    #    include /etc/nginx/default.d/*.conf;

    #    location / {
    #    }

    #    error_page 404 /404.html;
    #        location = /40x.html {
    #    }

    #    error_page 500 502 503 504 /50x.html;
    #        location = /50x.html {
    #    }
    #}
}
</pre>

如果需要,我很乐意提供更多信息。

0 个答案:

没有答案