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.
There's a recurring discussion I get myself into, and it goes roughly like this:
- I want to stream live video, what kind of machine, and how many of them do I need?
- It depends.
- Depends on what?
- Math! Also, numbers!
- Joking, can you tell me <list of characteristics>
- <provides value>
- <performs black magic>. The answer to your question is <scarily accurate values>!
Obviously, it doesn't go "exactly" like this, but the goal of this post is going to be largely about boring math, so it sounds cooler if we say I'll be talking about black magic, right?
Let's open the grimoires and see how we can answer this sizing question!
During the latest Varnish Summit in London, the awesome Thijs Feryn had a presentation in which he explained the need to normalize Accept headers, and I proudly spoke up to say that a few weeks prior, I actually wrote a VMOD to do exactly that.
Well...I DID write it, but never actually blogged about it, being the procrastinator that I am. You can consider this post as a cathartic mea culpa, and as an attempt to give a bit more exposure to a VMOD that should have been advertised/used weeks ago. But enough self-flagellation, and let's look at this VMOD, after we explain what Accept headers are. If you are already fluent in that subject, you can skip ahead to the "Balls to the walls" section.