我的 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 可以通过以下步骤修复:
增加后端设置中的
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; }
启动varnish时将参数增加到8192。
varnishd [options] http_resp_hdr_len=8192
检查您的
网络
或后端服务器
。如果步骤 1 和步骤 2 无法帮助您,请检查您的
网络连接
和banckend 服务器的可用性
。
关于caching - Varnish 503 服务不可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13042571/