RSS Feed for This PostCurrent Article

Caching Performance: Squid vs. Varnish

On deserialized.com there’s a nice pair (Part I & Part II) of articles comparing Squid and Varnish.
While the findings there closely resemble the results of my own testing and live installations, they have to be taken with a grain of salt (as you should do with all test results anyway). The major thing here is that they just measure the raw performance of a single object type of fixed size. So the cache isn’t really populated, eliminating lookups for the requested object. And there are some other things that could be tested to more closely match a real world szenario.
However, what I found even more interesting is the comment section. Looks like we’ve got another holy war here which really makes me wonder. For me, any proxy cache is just that: a tool that helps me to deliver content faster. There are situations where I would use Varnish and other where I would use Squid – depending on which of those fits the job better. So my advice here is: If you ever want to do serious caching, take a look at all the tools available and choose the one you’re most comfortable with.

Trackback URL

4 Responses to “Caching Performance: Squid vs. Varnish”

  1. Per Buer says:

    No. Thats not true. You should always use Varnish, dammit! :-)

  2. sru says:

    LOL.
    Ok, you win. I surrender. Just check the headers sent by this server :-D

  3. Hey, thanks for the link back. You are certainly right, it has sparked another holy war.

    One correction, however, is that in my first test I did test only against a single object of a fixed size but in the second test I had a script to generate random URLs that all point to files of different sizes. The script allows me to specify how many results, so I could easily generate 10,000,000 random URLs. Within this list there are (very) likely to be duplicate URLs which is similar to a production environment – but certainly not identical.

    The script can be modified to be more or less random, but on average, most of our pages fall within the 25K to 35K range, so I tried to keep my tests within that range.

    I should have said somewhere in my posts that while my results are indicative of the performance of both options in general, they are tailored to my needs. Do your own tests that correlate to needs of your own business if you want to get usable data for yourself.

  4. sru says:

    Of course it’s always better to do one’s own testing. And I certainly didn’t want to really criticize the method you applied. For me, testing is somewhat irrelevant for in one of the larger installations I’ve got systems running that get > 1000 hits/s in a live environment. So I know pretty well how good Squid and Varnish perform in the real world ;)

Leave a Reply