我在我的架构中使用t2.medium作为前端服务器。
通常 AWS 自动缩放使用“CPU 利用率”,但对于 t2 来说有点棘手。当“CPU Credit Balance”较低时,t2.medium“CPU Utilization”最高可达20%,因此自动缩放不会检测到警报。
有没有办法扩展 t2 实例?
更新: 尝试使用自定义指标https://github.com/shtrihstr/cloudwatch
我在同一台服务器上的 Varnish(4.1.0) 前面有 Nginx(1.9.9)。
//nginx
upstream varnish {
server 127.0.0.1:8391;
keepalive 16;
}
location ~ \.php$ {
proxy_pass http://varnish;
proxy_http_version 1.1; #for 1.0 varnish shows blank page
proxy_set_header Connection "";
proxy_redirect off;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 600;
proxy_send_timeout 600;
proxy_connect_timeout 600;
}
//varnish
DAEMON_OPTS="-a :8391 \
-T localhost:6082 \
-f /etc/varnish/default.vcl \
-S /etc/varnish/secret \
-s malloc,1024m"
Run Code Online (Sandbox Code Playgroud)
对于 0.001% 的请求,nginx 显示错误:
[error] 5331#5331: *7392847 upstream prematurely closed connection while reading response header from upstream, …Run Code Online (Sandbox Code Playgroud)