Varnish implicitly hashing backend

Jonathan Matthews contact at jpluscplusm.com
Mon Apr 30 15:18:24 CEST 2012


On 30 April 2012 12:49, Neil Saunders <n.j.saunders at gmail.com> wrote:
> Hi all -
>
> I'm attempting to implement a suggestion provided as a solution to another
> question I posted regarding cache warming.
>
> Long story short, I have 6 webservers that I'm pre-warming 60,000 urls via a
> script. I had previously been sending each request to each web-server, but
> it was suggested that it would be much quicker, and indeed more elegant, to
> be able to set a header (X-Cache-Warming in this case) that if set would
> cause the web-server to use the next web server as the backend, until it
> reached the last web server and it would be fetched via the actual backend:
> Goal - Make a single request on the first web server to warm all 6.
>
> The issue I'm seeing is following cache warming the I get cache misses on
> actual requests on all web servers except the last in the chain, which would
> imply to me that Varnish implicitly hashes the backend name used.

I don't have an answer for this, but here's a thought: try explicitly
logging the "req.hash" value as late as possible in the vcl_* chain (I
don't know when/where it's an acceptable variable to query) to see
what it produces.
https://www.varnish-cache.org/docs/3.0/reference/vcl.html#the-hash-director
says it uses just this as the key.

I don't know if it contains an opaque lookup key, or something more
useful. Perhaps comparing a single request's req.hash value between
multiple chained caches in your setup will show something interesting
...

Jonathan
-- 
Jonathan Matthews
Oxford, London, UK
http://www.jpluscplusm.com/contact.html



More information about the varnish-misc mailing list