This blog will be an overview of varnish, its uses and how it can turn your terribly slow website into being able to easily serve traffic at the very least 10 thousand hits per second, more likely around 2 hundred thousand hits per second.
Now that is fast.
Varnish is a high end, web application accelerator, known as a caching HTTP reverse proxy. The best part about varnish is you can make it do a whole lot more than just caching.
Through configuration you can have varnish perform the act of load balancing, geo-load balancing, serving multiple front ends, language redirection, clearing of unsightly headers, cookies, device detection, just to name a few. One thing it can't do is SSL termination, but there is a relatively easy solution to that which I will cover in another post.
When we first implemented Varnish 3.0 there wasn't that much documentation, happily I see now the documentation has improved significantly. Essentially the best way to get performance out of varnish is to write your own vcl from scratch. This means you need to study, and know what your own application does, learn how to optimize it and cache it to the max. You can even use varnishtest now to unit test your vcl, so you can utilize the benefits of TDD even in your varnish configuration code.
I will provide more varnish examples and use cases in the future as this is meant to be more of an introduction. However if you are considering using varnish to accelerate your web stack I recommend it, it is so good it is even used on wordpress sites to make them less unbearable.
So varnish is the secret to scaling your crappy code, giving you time to write it properly, buy new hardware or even time while your wordpress site grows to hire a developer, I mean "Engineer" and do it all properly.
No comments:
Post a Comment