We’re running into an issue with having EE & Varnish together. Everytime a page is loaded for the first time in a while (I am guessing there’s a connection between cache expiry), we get this error:
Error 503 Service Unavailable
Service Unavailable Guru Meditation:
XID: 153391359
Varnish cache server
Reloading the page again loads the page normally.
Is this an issue with the EE caching (it happens 100% of the time after a template has been updated and the EE caches cleared) or purely with Varnish? If so, is there anything I can pass on to our sysadmin (who was the one whose setup Varnish)?
I suggest trying a simpler config file and then slowly adding one line at a time to match your current config file to see where the issue is. Here’s a great article from EllisLab that is very helpful:
Thanks for posting your VCL. Is the website having the problems listed in this conditional?
if (req.http.Host == "westeros.org" || req.http.Host == "www.westeros.org" || req.http.Host == "testsite.westeros.org" || req.http.Host ~ "hippokrene.com" || req.http.Host ~ "hippoiathanatoi.com" ) {
set req.backend = apache;
}
Hmm, it’s hard to say then. I wouldn’t think ExpressionEngine would be causing this, it seems like Varnish may think the backend is unhealthy and is just timing out. You already have first_byte_timeout
on your apache
backend which is good, that was going to be my first suggestion, which is why I asked if your sites were in that conditional.
Outside of that, I’d maybe try increasing the connect_timeout
property on the backend from its default of 3.5 seconds. I wouldn’t normally think you’d need to increase that, but worth a shot. Also maybe try looking at the Varnish logs to see if you can see how its deciding to show a 503.
Okay, our friendly server admin set up a version entirely out of Varnish and we still get the error:
http://westeros-test.noderunner.net:8081/
If someone has visited it recently, it’ll pull from EE’s cache… but if not, you’ll get a content encoding error. Unfortunately, I’m not sure how to diagnose the problem further, but this does fit what the server admin speculated:
“t looks to me in Varnish’s logs like what happens is ExpressionEngine sends back a corrupted page; Varnish can’t parse it as a valid HTTP body and dies.
If my theory is right, then Chrome or Safari will also refuse to render the page appropriately when you trip the issue; i.e., the Varnish Guru issue isn’t Varnish, it’s just Varnish tossing up a webpage when ExpressionEngine throws back random garbage data instead of text/html content.”
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.