从后端200后清漆503

时间:2016-05-24 16:27:59

标签: varnish varnish-4

我在Centos 7.2上有一个Varnish 4.0.3服务器。 Varnish配置了三个后端。我收到了Varnish的间歇性503's。我在503事件期间拉了一个tcpdump,我看到了:

  • 消费者向Varnish提出请求
  • Varnish打开套接字到后端。
  • 后端响应< 500ms的
  • Varnish向后端发送ACK,FIN。
  • Varnish向消费者发送503。
  • 后端向Varnish发送ACK,FIN

失败的请求不会出现与成功请求不同的请求。失败率为每20k请求约1个。

  -   Begin          req 2795361 rxreq
  -   Timestamp      Start: 1464106437.502383 0.000000 0.000000
  -   Timestamp      Req: 1464106437.502383 0.000000 0.000000
  -   ReqStart       10.14.X.X 43190
  -   ReqMethod      GET
  -   ReqURL         /service/v2/service/parameter/parameter/parameter
  -   ReqProtocol    HTTP/1.1
  -   ReqHeader      Accept: application/json
  -   ReqHeader      Content-Type: application/json
  -   ReqHeader      Host: UpsteamLoadBalancer:6081
  -   ReqHeader      Connection: Keep-Alive
  -   ReqHeader      User-Agent: Apache-HttpClient/4.2.4 (java 1.5)
  -   ReqHeader      X-Forwarded-For: 10.14.X.X
  -   VCL_call       RECV
  -   ReqURL         /service/v2/service/parameter/parameter/parameter
  -   ReqUnset       X-Forwarded-For: 10.14.X.X
  -   ReqHeader      X-Forwarded-For: 10.14.X.X
  -   VCL_return     hash
  -   VCL_call       HASH
  -   VCL_return     lookup
  -   Debug          "XXXX MISS"
  -   VCL_call       MISS
  -   VCL_return     fetch
  -   Link           bereq 2795368 fetch
  -   Timestamp      Fetch: 1464106442.526296 5.023913 5.023913
  -   Timestamp      Process: 1464106442.526311 5.023929 0.000015
  -   RespHeader     Date: Tue, 24 May 2016 16:14:02 GMT
  -   RespHeader     Server: Varnish
  -   RespHeader     X-Varnish: 2795367
  -   RespProtocol   HTTP/1.1
  -   RespStatus     503
  -   RespReason     Service Unavailable
  -   RespReason     Service Unavailable
  -   VCL_call       SYNTH
  -   RespHeader     Content-Type: text/html; charset=utf-8
  -   RespHeader     Retry-After: 5
  -   VCL_return     deliver
  -   RespHeader     Content-Length: 281
  -   Debug          "RES_MODE 2"
  -   RespHeader     Connection: keep-alive
  -   Timestamp      Resp: 1464106442.526356 5.023974 0.000045
  -   ReqAcct        290 0 290 211 281 492
  -   End

1 个答案:

答案 0 :(得分:0)

您的客户正在使用HTTP与Varnish通信。

HTTP响应503表示“由于服务器临时过载或维护,服务器当前无法处理请求。这意味着这是一个临时条件,在一段时间后会缓解”。

因此,此错误由Varnish服务器发送,表明上述原因。

此致 Sudhansu