Varnish 2.0 backend health polling and Zope 2.10.
Amongst the neat features of Varnish 2.0 is backend health polling, so that Varnish keeps track of if the backend is up and running. You can from this information do various things like loads balancing etc. I’ve been spending the day on trying this out, and failing miserably. Thanks to some help from Paul-Henning Kamp and Tollef Fog Heen from Linpro I’ve figured out the problem.
Varnish, when doing the health polling, will send a request and the “half-close” the TCP connection. This is standard practice in TCP, and it is like saying “OK, I am done, close the connection when you are done.” So, Zope should finish the request and the close the connection. However, Zope 2.10 will close the connection immediately, and THEN finish the request. The result is that Varnish will see the poll as failed, so backend health polling against Zope 2.10 will not work.
What most likely will solve this problem is putting an Apache inbetween. Also, if you are load balancing with Pound, that probably will avoid it, although I haven’t tried this out yet. The goal of this is to see if we can get Varnish to serve cached pages when the server is down, even if the cached pages really has timed out. If I suceed in this, I will make a follow-up.