frequent 504's on VCL

Lasse Karstensen lkarsten at varnish-software.com
Tue Jul 28 13:31:06 CEST 2015


On Mon, Jul 27, 2015 at 10:24:21PM -0400, Tim Dunphy wrote:
[cut]
> It's pretty odd how inconsistent this VCL is behaving.

Varnish does not produce 504 responses.

If you see 504, they are coming through from your backend.


> On one load of the page where the graphics are broken I'm seeing this error
> in the logs:
>    10 TxHeader     c Connection: close
>    10 TxHeader     c X-Cache: MISS
>    10 Debug        c Write error, retval = -1, len = 602, errno =
> Connection reset by peer
>    10 ReqEnd       c 241437586 1438049428.763690233 1438049435.868994236
> 0.000110626 7.105183125 0.000120878

Client or backend closed the connection (went away) after 7 seconds.


[..]
> And on 504 errors I'm seeing this result in the logs:
> 10 TxHeader     c Via: 1.1 varnish
>    10 TxHeader     c Connection: close
>    10 TxHeader     c X-Cache: MISS
>    10 Length       c 316
>    10 ReqEnd       c 241437672 1438049679.750560999 1438049679.750730276
> 0.000099182 0.000094652 0.000074625
>    10 SessionClose c error
>    10 StatSess     c 54.86.143.49 49821 0 1 1 0 0 0 285 316
> I'm running 3 back ends using apache 2.4 on Centos 7. I'm running two
> Varnish nodes at version 3.0.5.

Please note that Varnish 3 is end of life.

In the 4.0 release timestamp logging is vastly improved. It would tell
you if it was the client or backend that went away above, for example.

Another sweet feature in 4.0 is that just-expired content will be served
while a background fetch is initiated.

> backend web1 {
>   .host = “10.10.10.25”;
>   .port = "80";
>   .connect_timeout = 45s;
>   .first_byte_timeout = 45s;
>   .between_bytes_timeout = 45s;
[probe section]
>    .timeout = 60s;

These timeouts are way too long.  What client sits around for 45s waiting
for a web page? Isn't it better to produce clean 503s to the client that
can be looked for in varnishlog, rather than not responding?


-- 
Lasse Karstensen
Varnish Software AS



More information about the varnish-misc mailing list