Varnish Explained
ma.ttias.be
ma.ttias.be
It doesn't do TLS. Something else needs to be put in front of it to terminate HTTPS connections. HTTP/2 support is planned but (again) with no TLS, making it a dud as browsers don't implement non-TLS HTTP/2.
The mass storage engine isn't part of the opensource release and my experience with larger-than-memory scenarios in the standard varnish has been less than stellar. Again, needing something else to handle this bit or control what's fed to it.
My conclusion is that if I always have to put an nginx in there somewhere, I might as well not add varnish into the mix.
They very much espouse the philosophy of "do one thing, do it simply, do it well, do it composably"
If you're serving HTTPS to clients and your backends are also HTTPS, you quickly get into a mess of extra components opening unnecessary sockets around just to do TLS.
For really high traffic sites where static assets are off-loaded to other servers, I wonder if Varnish even makes sense (versus an enterprise solution with edge servers across the world).
Using Varnish to cache http request that are returned from your code (e.g. the HTML returned from an application) is where I'd imagine you'd see the highest gains. However, that gets pretty complex, especially when dealing with cookies for logged in users.
What I would find really useful are guides on getting utility out of Varnish, rather than just "cache http responses" - for example:
* Ability to do cloudfront/s3 style signed-requests to create temporary or one-time downloads for authenticated users
* Cache OTHER PEOPLE's API's that your site calls out to, especially if the other API doesn't change often. In this scenario, your app would call on a Varnish server, which in turn would be caching responses from an external API (a reversal of the typical way you'd think people use Varnish). One possible use case might be in deployment, grabbing .zip files from Github.
* Rate-limiting requests to your API
* Standard Varnish usecase, nothing extra needed.
* https://github.com/varnish/varnish-modules vsthrottle
[0] https://info.varnish-software.com/blog/using-varnish-cache-s...
They seem (at first glance) to have no concept of security in the sense of restricting people's access to certain content like in the case of all social networks.
Up to a certain high load, Varnish works well, then all hell breaks loose - Nginx in comparison was much more stable and used less resources, had a higher max throughput, and when it hit the max - (assuming it filenode limit was high enough) would still work..just slowly. Varnish just died.
I encourage people to read http://capriccio.cs.berkeley.edu/pubs/threads-hotos-2003.pdf. Yeah, it's old, but so is the 10k Concurrency paper which is still touted as the reason why people should use nginx instead of anything else. Threads will only get better.
http://stackoverflow.com/questions/16693677/why-isnt-varnish...
If you really need a large malloc, I highly recommend running Varnish on FreeBSD instead of Linux as the Linux kernels VM system is horrible when memory is overcommitted.
Varnish is a lot easier to configure if you have some complexity, for example if you want to cache the same page but for different languages that is sent from the browser.
There is also another alternative, Apache Traffic Server.
In the end, it may be Nginx, Apache Traffic Server which are the right tools for your problem. None of them solves every caching problem.
It seems kind of nasty to say this, but nginx isn't the be all and end all. Now, yeah, you could say I'm biased, but this is because instead of being swayed by marketing, PR and FUD, I instead am swayed by real world scenarios. nginx is very, very good, but it is no longer heads-and-shoulders above httpd or anything else really. It is weird, and wrong, to take every other tool which does a part of what nginx does and immediately want to criticize it or say "nginx does that too! What do we need Foo for?!" When doing architecture, pick the right tools for the right job. And most of the time that means picking a caching layer, a TLS termination layer, dynamic content, Authn&Authz layer, etc...