Varnish 3.0 Guru冥想与FetchError TestGunzip错误在最后

我得到了间歇性的大师冥想清(因为在我发射50个请求和3回来坏)。 在varnishlog它说

15 VCL_return c hash 15 HitPass c 1394372109 15 VCL_call c pass pass 15 Backend c 17 default default 15 TTL c 1394372164 RFC 0 -1 -1 1384590297 0 1384590291 0 0 15 VCL_call c fetch 15 TTL c 1394372164 VCL 120 -1 -1 1384590297 -0 15 VCL_return c hit_for_pass 15 ObjProtocol c HTTP/1.1 15 ObjResponse c OK 15 ObjHeader c Date: Sat, 16 Nov 2013 08:24:51 GMT 15 ObjHeader c Server: Apache 15 ObjHeader c Accept-Ranges: bytes 15 ObjHeader c Cache-Control: max-age=0, no-cache 15 ObjHeader c Vary: Accept-Encoding 15 ObjHeader c X-Mod-Pagespeed: 1.5.27.2-2912 15 ObjHeader c Content-Encoding: gzip 15 ObjHeader c Content-Type: text/html; charset=utf-8 15 Gzip cu F - 3755 13624 80 0 0 15 FetchError c TestGunzip error at the very end 15 VCL_call c error deliver 15 VCL_call c deliver deliver 15 TxProtocol c HTTP/1.1 15 TxStatus c 503 15 TxResponse c Service Unavailable 

您可以在最后看到问题的15 FetchError c TestGunzip error at the very end 。 我不知道如何解释Gzip cu F - 3755 13624 80 0 0以上的行,我不明白为什么这是一个问题。 在我们把清漆放在前面之前,该网站没有任何报道的加载页面的问题。

在一个关于gzip的清漆比浏览器更严格的假设中,我试图closuresgzip处理,所以我在/etc/defaults/varnish设置了closureshttp_gzip_support

 DAEMON_OPTS="-a :80 \ -T localhost:6082 \ -f /etc/varnish/default.vcl \ -S /etc/varnish/secret \ -s malloc,256m \ -p http_gzip_support=off" 

这没有任何区别。 我现在用完了想法,任何帮助将不胜感激。

这是修复

 if (beresp.status == 301 || beresp.status == 302) { if (beresp.http.Content-Encoding ~ "gzip") { if (beresp.http.Content-Length == "0") { unset beresp.http.Content-Encoding; } } } 
 if (req.http.Accept-Encoding) { if (req.http.Accept-Encoding ~ "gzip") { # If the browser supports it, we'll use gzip. #set req.http.Accept-Encoding = "gzip"; unset req.http.Accept-Encoding; } else if (req.http.Accept-Encoding ~ "deflate") { # Next, try deflate if it is supported. set req.http.Accept-Encoding = "deflate"; } else { # Unknown algorithm. Remove it and send unencoded. unset req.http.Accept-Encoding; } } 

我把未设置的Accept-Encoding,当响应从后端回来,它不会尝试TestGunZip它。 那就是它的样子。 这是我的修复,因为我也有同样的问题。

有时,各种后端需要更多的时间来加载清漆的响应,只是增加以下通常可以帮助:

 backend default { .host = "x"; .port = "x"; .connect_timeout = 30s; .first_byte_timeout = 30s; .between_bytes_timeout = 30s; }