caching - Varnish 503 服务不可用

标签 caching varnish varnish-vcl http-status-code-503

我的 Varnish 版本是3.0

当我 curl URL 时,我的服务器运行良好,但是当使用 Varnish 缓存时,它偶尔会返回 503 服务不可用

喜欢的日志信息是:

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

PS:当我在浏览器上 curl 或键入网址时,服务器响应 200。

最佳答案

Varnish 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;
    }
    
  2. 启动varnish时将参数增加到8192。

    varnishd [options] http_resp_hdr_len=8192
    
  3. 检查您的网络后端服务器

    如果步骤 1 和步骤 2 无法帮助您,请检查您的网络连接banckend 服务器的可用性

关于caching - Varnish 503 服务不可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13042571/

相关文章:

caching - 超出 Neo4j GC 开销限制

nginx - Magento 2通过负载平衡器在多个magento服务器上共享哪些目录?

使用mod-xsendfile的PHP文件下载不会下载整个文件

apache - Varnish 根据请求的文件是否存在在后端之间进行选择的好方法

caching - Redis 复制和 LFU 缓存

performance - 为什么 SAPUI5 多次加载类似的片段?

http - 是否可以可靠地检测 Varnish 中的文件上传?

caching - 是否可以根据 Varnish 中后端响应的大小来阻止缓存?

c - Varnish C VRT变量/功能

java - 尝试在 Spring-Hibernate 中启用二级 Hibernate 缓存时出错