Nginx 断开连接

Nginx 断开连接

我正在设置一个设置,其中我使用 linode 节点平衡器(负载平衡器)来平衡我的 nginx/php5-fpm 服务器。此平衡器被动检查。这些被动检查检查请求的状态代码。如果 5XX 状态代码过多,负载平衡器会将节点 (vps) 标记为离线

nodebalancer 以随机方式将我的服务器离线。联系 linode 支持人员时,他们得出的结论是没有 500 错误,但连接断开(或超时)。

我在 nginx 日志中找不到任何内容。有什么方法可以调试此问题并查看哪些连接因 nginx 超时而丢失?

编辑 我可以看到来自同一 IP/用户代理的大量 408 请求。它们是批量发送的。这可疑吗?您将如何处理这种情况?来自 access.log 的快照

69.30.*.* - - [22/Apr/2014:19:28:29 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:29 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:29 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:29 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:29 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:29 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:29 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:29 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:29 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:29 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:29 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:29 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:29 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:29 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:29 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:29 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:29 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:30 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:30 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:30 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:30 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:30 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:30 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:30 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:30 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:30 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:30 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:30 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:30 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:30 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:30 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:30 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:30 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:30 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:30 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:30 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:30 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:30 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:31 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:31 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:31 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
69.30.*.* - - [22/Apr/2014:19:28:31 +0200] "POST /error/register-image-error/ HTTP/1.1" 408 0 "http://www.mysite.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"

谢谢!

答案1

想知道你得到的 HTTP 代码是什么就好了。我怀疑应该是 408(请求超时),所以 nodebalancer 会认为服务器已经不存在了,并将其标记为离线。

你应该尝试一下:

  • 增加超时时间
  • 使用TCP模式代替HTTP模式

警告:使用 TCP 模式,cookie 处理如果离开

相关内容