当尝试加载需要更长时间在 Web 服务器上生成的页面时,Varnish 不断抛出 503 Service Unavailable。
在 varnishlog 中,我可以看到一个FetchError c http read error: 0
错误,但我不太确定它的含义。
我还尝试增加后端超时:
backend default {
.host = "x.x.x.x";
.port = "80";
.connect_timeout = 600s;
.first_byte_timeout = 600s;
.between_bytes_timeout = 600s;
}
Run Code Online (Sandbox Code Playgroud)
后端是一个 Apache 服务器。
所有其他页面工作正常。
有任何想法吗?
错误消息意味着(行号参考参考 varnish 2.1.3):
在获取标头 [bin/varnishd/cache_fetch.c:399] 时,可以:
a) 发生溢出 [bin/varnishd/cache_httpconn.c:170]
或者
b) 调用 read() 时发生错误 [bin/varnishd/cache_httpconn.c:175]
最后的数字是 errno 的值,所以因为它是 0(没有错误),所以我假设选项 a) 发生了,因为read()
不设置 errno 不应该返回负数。
使用以下代码 [bin/varnishd/cache_httpconn.c:167] 检测到溢出,返回否定结果:
i = (htc->ws->r - htc->rxbuf.e) - 1; /* space for NUL */
Run Code Online (Sandbox Code Playgroud)
htc->ws
是一个struct ws
[bin/varnishd/cache.h:126] 它是一个“工作区结构” r 成员是该工作区的保留长度。htc->rxbuf
指的是struct txt
[bin/varnishd/cache.h:109] 但没有评论描述成员 (b & e) 所指的内容。也许开始和结束?
我不知道工作区是如何调整大小的(或者即使它们是)但是 - 我真的在这里猜测领域 - 我认为问题的一些可能原因是:
通过搜索以下空间来尝试找到可以强制发生错误的点可能很有用:
并查看您是否可以可靠地重现该问题。
您可以通过增加http_headers
运行时选项来解决该问题。(如果您运行的是 < 2.1,我认为这是一个编译时或配置时选项)
归档时间: |
|
查看次数: |
4115 次 |
最近记录: |