Varnish is a powerhouse, and a lot of the use cases you'll see about it are about delivering stellar performance, specially in CDN contexts. But today I'd like to share a more intimate setup that I came across recently, where Varnish shone not because of its perfomance but rather thanks to its flexibility. This should give you some ideas on how to use it more, notably back within the confines of your infrastructure.
Some time ago, we discussed backend pools and how to load-balance inside them using directors, remember? During the first post I hinted at forcing backends to "sick" before maintenance of a backend but didn't go into more detail. Today it's time to have a short yet closer look at how you can cleanly take a backend out and insert it again.
Docker has been on my radar for quite some years now, but, I have to admit, as a C developer, I never really cared about it. I run Arch Linux on my computer, so everything I ever needed was packaged, save for a few exceptions where I could just whip up a custom PKGBUILD and install the resulting package. If I needed another OS, I used a VM.
But recently, I forced myself to try that container thingy (much like you'd try again some food you wrongly discarded as uninteresting when you were a child), and I found that I could find a few use cases for it, related to Varnish, of course. This post is a report of my exploration, so, don't expect too much new stuff, but since it's also focused on running Varnish inside a container, so there a few specific tricks and questions to be aware of.