Live data from Hacker News

Varnish 4.0.2 released

varnish-cache.org

51–56 of 56 posts

Re: Varnish 4.0.2 released

#51

Varnish and caching in general can be a complete mind-freak the first few times you experience it, however after working with it nearly daily for the last 3 years, I've come to love it. It has allowed me to scale a number of WordPress websites far beyond where they had business being (34mm UV/180mm PV per month on a handful of servers). Super excited to see them continuing to build in great features.

>34mm UV/180mm PV per month on a handful of servers Can you give more details about the hardware setup?

All bare-metal, 2 basic varnish, 4 beefier web heads, 2 really, really beefy DB + NFS.

hit me on twitter @kentonjacobsen

Re: Varnish 4.0.2 released

#52
post #22

My experience with Varnish was when we tried to use it for something that had relatively complex caching rules. The config/VCL became spaghetti: attaching values to req and restarting the flow. This appeared to be the normal way to write VCL. We ended up writing our own system, with our own high-concurrent LRU cache, that was more tightly coupled with our application servers (and thus able to figure out what the cach…

I think your description might fit if performance and scalability is a non-issue for your site. Your own caching will make your webapp (or API) scale (say 2x faster or serve 15x the amount of users), but if you need your app to take some serious beating (say 100x to 400x the amount of users with minimal ttfb) because your site/app suddenly becomes flavour of the month on the Internet, then you will really need Varnis…

We were handling over 10K req / sec through that layer of our system and load tested the entire system to over 100K, testing various cache hit ratios (our 95th percentile uncached response time was ~5ms for our core service). At that scale, a sudden 400x spike isn't something you worry about -- our various network providers would null route us way before we ever got there.

When we moved away from Varnish towards our own integrate cache, our hit ratio went from 50% to 80% on average, and some individual routes hit over 95% (we proactively purged+refetched in the background through a queue).

So maybe you're right, but for the opposite reason that you state. Our scale and performance requirements were so great, a custom solution made more sense.

Re: Varnish 4.0.2 released

#53

Earlier quoted context omitted.

I have never tried but failed miserably in trying to setup a Varnish front-end for a wordpress setup - especially with pretty urls. The hard part was getting varnish to work with the admin interface - especially image uploads - and comments. Do you know of any good starting config file that can be used ?

A couple of resources for Varnish 3: * https://github.com/mattiasgeniar/varnish-3.0-configuration-t... (fairly well maintained with CMS specific VCL examples) * https://github.com/slashsBin/nuCache (library for different programming languages, not so CMS centric) Both of these are listed in our utilities directory: * https://www.varnish-cache.org/utilities Other Varnish (VCL) extensions can be found in the VMOD direc…

@ruben_varnish - this is great ! thanks.

I think it would be great if varnish had an official repo with different configuration templates for different stacks that could be used as "drop-in".

For example, my question about a fairly basic Rails config (https://news.ycombinator.com/item?id=8431927) had a couple of different answers disagreeing about stuff.

Also, things like SSL termination are something that the documentation skips over entirely - I understand completely that Varnish does not implement it, but Varnish necessitates the introduction of certain other players in the stack, which it should document.

For example, a canonical example of varnish setup as Nginx (SSL termination) -> Varnish -> Nginx (reverse proxy) -> App would be very useful.

Re: Varnish 4.0.2 released

#54
post #52

Earlier quoted context omitted.

I think your description might fit if performance and scalability is a non-issue for your site. Your own caching will make your webapp (or API) scale (say 2x faster or serve 15x the amount of users), but if you need your app to take some serious beating (say 100x to 400x the amount of users with minimal ttfb) because your site/app suddenly becomes flavour of the month on the Internet, then you will really need Varnis…

We were handling over 10K req / sec through that layer of our system and load tested the entire system to over 100K, testing various cache hit ratios (our 95th percentile uncached response time was ~5ms for our core service). At that scale, a sudden 400x spike isn't something you worry about -- our various network providers would null route us way before we ever got there. When we moved away from Varnish towards our…

I think that the point with Varnish and VCL is that you can adapt it, tailor it and even extend it (the language with additional functionality from external libraries i.e. cURL or memcached) to the point that it fits your system just the way you need it.

Obviously, depending on what you were trying to do and to which extend Varnish was extendable then (VMODs were added in 3.0) it might not have been the best option there is.

Anyway, thank you for your reply. It was a very interesting insight you came with there.

Re: Varnish 4.0.2 released

#55

Has anyone documented how to convert a 3.x config to 4.x config yet? The documentation on the site assumes a level of understanding of the internal workings I don't have. I'm still running 3.x because they broke a bunch of stuff. I discovered this when I updated a couple of dev boxes and varnish stopped working.

You can use these:

* Upgrading notes: https://www.varnish-cache.org/docs/4.0/whats-new/upgrading.h...

* A script by Fed that will do 70-90% of the job for you: https://github.com/fgsch/varnish3to4

Let us know how it went :-)

Re: Varnish 4.0.2 released

#56
post #28

Earlier quoted context omitted.

Now that you mention it, I forget why that specific snippet is in my config... it is part of a block of similar-but-more-useful things (specifically, having multiple caches serving the same static content from a variety of different domain names)

so, what's the answer - this is why Varnish is so confusing. I have my non-www to www redirects working perfectly on nginx. should I do anything special in varnish, or should I trust it to cache the nginx redirect headers by itself ?

The answer is have nginx do the redirect, varnish will handle it correctly
Post reply on HN