Performance AWS ELB每天在同一时间发生碰撞
我对此没有任何解释 我们正在AWS上运行一个包含6个Performance AWS ELB每天在同一时间发生碰撞,performance,amazon-web-services,nginx,uwsgi,amazon-elb,Performance,Amazon Web Services,Nginx,Uwsgi,Amazon Elb,我对此没有任何解释 我们正在AWS上运行一个包含6个uWSGI+NGINX静态ip实例的ELB。 <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
uWSGI+NGINX
静态ip实例的ELB。
<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>
在所附的图片上,您可以看到,每天都在负载变化的同一时间(不知道为什么),然后ELB标记服务器和停止服务
,即使它们在直接命中实例时功能正常
实例是带有Centos 7
ami的m4.xlarge
(16.0 GB,13个单元,4个内核)<代码>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
NGINX配置(我知道CORS,这是故意的):
用户nginx;
工人自动处理;
error\u log/var/log/nginx/error.log;
pid/run/nginx.pid;
事件{
工人(1024);;
}
http{
日志格式主“$remote\u addr-$remote\u user[$time\u local]“$request””
“$status$body\u bytes\u sent”$http\u referer”
“$http_user_agent”“$http_x_forwarded_for””;
添加标题“访问控制允许原点”'*”;
添加_头“访问控制允许凭据”“true”;
添加_标题“访问控制允许方法”“标题、获取、发布、选项”;
access\u log/var/log/nginx/access.log main;
发送文件到;
tcp_nopush on;
tcp_节点延迟开启;
保持生命超时65;
类型\散列\最大\大小2048;
包括/etc/nginx/mime.types;
默认_类型应用程序/八位字节流;
#从/etc/nginx/conf.d目录加载模块化配置文件。
#看http://nginx.org/en/docs/ngx_core_module.html#include
#了解更多信息。
包括/etc/nginx/conf.d/*.conf;
#服务器{
#监听80个默认_服务器;
#侦听[:]:80默认_服务器;
#服务器名称;
#root/usr/share/nginx/html;
#加载默认服务器块的配置文件。
#include/etc/nginx/default.d/*.conf;
#地点/{
# }
#错误\u第404/404.html页;
#location=/40x.html{
# }
#错误\u第500页502 503 504/50x.html;
#location=/50x.html{
# }
#}
}
如果需要,我很乐意提供更多信息。您是否打开了ELB的日志记录并查看了日志?我对AWS非常陌生,不知道此功能!我马上就去试试@我已经激活了elb日志。但这些只是访问日志-您会寻找什么异常?很难从这些日志中获得任何信息。它们只是所有请求页面及其加载时间的访问日志。。。这应该使问题的性质显而易见,如果它与访问您的站点的流量有关。。。因为可能有某些请求预示着厄运。这似乎不太可能是ELB本身的问题。您的服务器可能看起来运行正常,但实际情况可能并非如此。在任何情况下,如果您试图在没有日志的情况下进行故障排除,您都是盲目的。我感兴趣的是您的nginx日志是什么样子的-在这段时间内它们是否显示出任何不同?更多的错误?更多的点击?不同的打击?白天这些机器上的内存和cpu配置如何?
/etc/nginx/conf.d/
中有什么内容吗?(我建议至少对newrelic进行试验)
<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>