AWS ELB as backend for Varnish Accelerator

Posted by addisonj on Server Fault See other posts from Server Fault or by addisonj
Published on 2012-08-01T00:05:52Z Indexed on 2014/06/06 9:28 UTC
Read the original article Hit count: 329

I am working on a large deployment on AWS that has high uptime requirements and variable loads throughout the day. Obviously, this is the perfect use case for ELB (Elastic Load Balancer) and autoscaling.

However, we also rely on varnish for caching of API calls. My initial instinct was to structure the stack so that varnish uses ELB as a backend which in turn hits an appGroup.

Varnish -> ELB -> AppServers

However, according to a few sources that isn't possible as ELB constantly changes the IP address of its DNS hostname, which varnish caches on start, meaning changes to the IP won't be picked up by varnish.

Reading around however, it looks like people are doing this so I am wondering what workarounds exist? Perhaps a script to reload the vcl periodically?

In the case of where this is really just not a good idea, any idea of other solutions?

© Server Fault or respective owner

Related posts about amazon-web-services

Related posts about varnish