Varnish versus other reverse proxies

5,111

Well, I'm running Varnish on my webservers, primarily for performance reasons, although its load balancing featues are handy as well.

My use case is caching in front of Django-based websites, and it does wonders for page loading performance. I'm able to serve most pages directly from cache and handle a flood of visitors with little trouble.

The reason I chose Varnish was mainly performance/scalability. The main points:

  • Varnish let's the kernel manage virtual memory, where Squid tries to keep separate disk and memory caches, can lead to the kernel and Squid squabbling a bit about what's to be paged out to disk.
  • Varnish uses VCL, it's own domain specific configuration language, which compiles down to machine code via C. That is a very real performance benefit if you have a more than a little bit of logic in your configuration – conditional header stripping etc.

In my experience, Varnish performs a bit better than Squid in most cases, and a lot better on traffic spikes. On the other hand, configuring Varnish correctly is going to take some mailing-list-trawling, since there aren't as many ready-to-go-for-your-specific-use-case-documentation flowing around the net as there are for Squid – mainly due to Varnish being a fairly young project in comparison.

Share:
5,111
womble
Author by

womble

I'm an old-timey sysadmin.

Updated on September 17, 2022

Comments

  • womble
    womble over 1 year

    I'm working with an organisation that has deployed Varnish as a caching reverse proxy for all of their web traffic. Their traffic make up is a lot of customer-generated dynamic websites, with the usual collection of static assets hanging off the side.

    While I'm trying to like varnish (I think it has a pretty good architecture, in principle), I'm having some troubles managing it and troubleshooting problems as they arise, so I'm wondering if it's really the right choice. I've used squid in the past as a reverse proxy, but not in the same sorts of role, so I don't have a clear basis for comparison.

    My question is targeted at people who have deployed varnish in production or seriously evaluated it against the alternatives: did you stick with varnish, or did you end up using another reverse proxy? What were your key points for staying with it or switching, and if you did use something else, what did you end up using?

    • Admin
      Admin about 15 years
      Varnish is probably your best solution. My advice is to join the mailings lists and get involved with the product, as you'll probably need their assistance if you run into any problems. Looking at their site it looks like they offer a paid support option, which you may be interested in