清漆503服务不可用

lic*_*gwu 5 caching varnish http-status-code-503 varnish-vcl

我的清漆版本是3.0.

当我卷曲URL时,我的服务器运行良好,但是当使用varnish cache时,它503 service unavailable会偶尔返回.

日志信息喜欢的是:

0 Debug        - "VCL_error(200, OK)"
24 VCL_call     c recv error
24 VCL_call     c error deliver
24 SessionClose c error
0 Debug        - "VCL_error(200, OK)"
27 VCL_call     c recv error
27 VCL_call     c error deliver
27 SessionClose c error
0 Debug        - "VCL_error(200, OK)"
16 VCL_call     c recv error
16 VCL_call     c error deliver
16 SessionClose c error
14 Debug        - "Write error, retval = 2998272, len = 8465870, errno = Success"
0 Debug        - "VCL_error(200, OK)"
14 VCL_call     c recv error
14 VCL_call     c error deliver
14 SessionClose c error
0 Debug        - "VCL_error(200, OK)"
21 VCL_call     c recv error
21 VCL_call     c error deliver
21 SessionClose c error
Run Code Online (Sandbox Code Playgroud)

PS:我在浏览器上卷曲或输入网址时的服务器响应200.

lic*_*gwu 10

清漆503可通过以下步骤修复:

  1. 增加connect_timeout,.first_byte_timeout.between_bytes_timeout在你的后端设置:

    backend default {
      .host = "www.example.com";
      .connect_timeout = 5s;
      .first_byte_timeout = 10s;
      .between_bytes_timeout = 10s;
    }
    
    Run Code Online (Sandbox Code Playgroud)
  2. 启动清漆时将参数增加到8192.

    varnishd [options] http_resp_hdr_len=8192
    
    Run Code Online (Sandbox Code Playgroud)
  3. 结帐你networkbackend server.

    如果步骤1和步骤2无法帮助您,请检查您network connectionbanckend server's availability.