16:10 - Wednesday, 23 April 2014

I Keep Getting Varnish Guru Mediation 503 Errors Despite Setting Timeouts

#Topics: Error 503 All backends failed or unhealthy,All backends failed or unhealthy,removing guru mediation from iphone,varnish all backend unhealthy,What does Error 503 Backend is unhealthy

I have the following backend setup:

backend seanesopenko {    .host = "seanesopenko.ca";    .port = "8080";    .connect_timeout = 60s;    .first_byte_timeout = 300s;    .between_bytes_timeout = 60s;}

I still keep getting Guru Mediation 503 errors despite setting the timeouts in the backends. I think it could be apache2/php errors that are being displayed as Guru Mediation 503 errors by Varnish. How do I configure varnish/apache to display apache2 errors?

A 503 error from Varnish usually means either:

  • You have configured backend health checks and the health check has failed, or
  • Varnish is simply unable to contact your backend server (e.g., the connection has taken more than connect_timeout seconds, or was refused, etc).

Since (a) doesn’t apply to your configuration, I’m guessing (b). What does the output of varnishlog look like? Have you verified that you can correctly connect to http://seanesopenko.ca:8080/ from your Varnish server? For example:

curl http://seanesopenko.ca:8080/

In any case, varnishlog should shed some light on the situation.