应用程序负载均衡器上的状态代码 460

Status Code 460 on Application Load Balancer

我在我的 Application Load Balancer 日志中看到数量不多的 460 状态代码。我没有看到这些代码在时间、服务器或请求 URL 方面有任何模式。根据this forum post,460表示:

The client has closed the connection with the ALB before the idle timeout has kicked in on either the front-end or the back-end connection.

我可以看到发送到后端服务器的请求,并且后端处理该请求时没有问题而且速度非常快。为什么会发生这些错误?此 ALB 使用 6-8 台后端服务器处理大量流量。

示例 ALB 日志:

https 2017-01-30T22:46:27.451363Z app/LOAD-BALANCER/bbab458ad0b80d X.X.X.X:55999 10.5.X.X:80 0.000 -1 -1 460 - 132 0 "GET https://www.website.com:443/app/page HTTP/1.1" "-" ECDHE-RSA-AES128-SHA TLSv1 arn:aws:elasticloadbalancing:us-west-2:743462462234:targetgroup/TARGET-GROUP/e6120e5adr245b79107e "Root=1-588fc23e-77aea5adf4534af3de09659d13a08"

来自后端的 NGINX 日志示例:

X.X.X.X 1485807955.048 www.website.com /app/page - GET 200 - 0.056 24 text/html; charset=UTF-8 -

这个序列中可能有一个线索:

0.000 -1 -1 460 -

字段为request_processing_time、target_processing_time、response_processing_time、elb_status_code、target_status_code

target_processing_time 和 response_processing_time 字段为 -1 表明根据 http://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-access-logs.html

将请求分派到目标主机时出现问题

检查您的目标是否收到请求,ALB 和目标之间可能存在一些配置或网络问题。 ALB 在将请求发送到目标时将跟踪 header X-Amzn-Trace-Id 插入到请求中,也许将这些记录在您的 NGINX 后端并查看您是否收到了失败的特定请求。

我一直在处理类似的问题,它似乎与我们的主机因 windows 主机上的 TCP 卸载而丢弃 TCP 数据包有关。

针对 Application Load Balancer 更新了状态代码 460 的文档。

This error occurs when the load balancer received a request from a client, but the client closed the connection with the load balancer before the idle timeout period elapses.

Check whether the client timeout period is greater than the idle timeout period for the load balancer. Ensure that your target provides a response to the client before the client timeout period elapses, or increase the client timeout period to match the load balancer idle timeout, if the client supports this.

您可以在此处阅读完整文档: http://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-troubleshooting.html#http-460-issues