Live data from Hacker News

Varnish Cache 5.0

varnish.org

41–50 of 55 posts

Re: Varnish Cache 5.0

#41
post #35
post #34

Earlier quoted context omitted.

Oh, sure. And one will be faster than the other in any given scenario. Not "faster like c++ is faster than ruby", though, it's "faster like this c++ compiler is faster than that one".

I'm sorry but I strongly disagree with the line of thought there. Parent above was saying "both are at the same speed / none offer any speed advantage". He is then asked for any metrics to support that statement, which is not an extravagant request and should be encouraged more. Your answer that "At that point, talking about metrics is likely procrastination" and "one will be faster than the other in any given scenar…

OK, maybe I put that stupidly. Let me try it differently. "I've deployed both, I did enough load testing to learn something about their performance in the configurations that mattered to me, and the performance is so okay that I'm not even going to look it up. Choose based on other criteria."

There are other criteria.

Re: Varnish Cache 5.0

#42
post #38

https://www.nginx.com/blog/maximizing-drupal-8-performance-n... In the BBC’s testing, they found that with NGINX as a drop-in replacement for Varnish, they saw five times more throughput.

nginx as a cache is very minimal-featured compared to Varnish. If it fits your workload, great. If not, Varnish is an exceptional tool.

Re: Varnish Cache 5.0

#43
post #16

As someone who has never used Varnish but has used Nginx's cache to some degree... whats the benefit of placing varnish in the middle vs going with Nginx?

If you use it for caching, nginx is lacking something quite important at the moment: stale-while-revalidate ( https://tools.ietf.org/html/rfc5861 ) Aka serving a cached response while the cache is getting refreshed (even to the request who initiated the refresh). Currently when nginx has to refresh the cache it will "hang" the current response until it gets refreshed (the requests that follow, even while the cache is…

There is an openresty project that provides this https://github.com/pintsized/ledge - also provides ESI and more.

Re: Varnish Cache 5.0

#44
post #38

https://www.nginx.com/blog/maximizing-drupal-8-performance-n... In the BBC’s testing, they found that with NGINX as a drop-in replacement for Varnish, they saw five times more throughput.

PHK explained the cause of this is that the Linux kernel VM system performs poorly when overcomitted.

https://news.ycombinator.com/item?id=10752209

So the conclusion is, as long your malloc fits in your system memory, Varnish should be blazing fast on Linux. If you need a gigantic cache, please try FreeBSD.

Re: Varnish Cache 5.0

#45
post #15
post #8

Earlier quoted context omitted.

Faster and far more configurable, the configuration language (VCL) compiles to 'C' and you can inline bits of C if you want. https://www.varnish-cache.org/trac/wiki/ArchitectureInlineC

Faster in theory maybe. In production nginx has always faster, more stable, less resources. I've used both extensively. Varnish has more caching features and configuration for sure.

If you need just a generic cache, then using varnish, nginx or httpd are all fine choices. The issue is when you start scaling at obscene amounts of traffic. At that point, having a single single attempting to do too many things just doesn't work. varnish was/is designed as an extremely fast and performant cache which, when correctly configured, simply beats the pants off of nginx or httpd. It's easily as stable as nginx and httpd and as compliant as httpd (nginx is a bit less so).

For caches, the bugaboo is latency, and event architectures are not good choices when small-as-possible latency is an issue. It is here that heavily threaded architectures really shine. Sure, you can likely get by with less resources w/ events, but (1) performance will suffer and (2) as thread implementations improve, threading will only get better and more "stingy" re: resources.

Re: Varnish Cache 5.0

#46
post #23

As someone who has never used Varnish but has used Nginx's cache to some degree... whats the benefit of placing varnish in the middle vs going with Nginx?

* ESI support is really nice (if you're an API designer, you can really go nuts on this and make a super simple API do some very complex things or expressive composition from lots of simple calls) * More fine-grained control of your caching is possible * Easier to express normalisation of requests (increase your cache hit rate and protect your underlying origin from malicious requests by discarding cache busters) * I…

"In theory if you have enough RAM you can go faster than nginx's on-disk... in practice the sweet spot for the gain is small and they're both on par"

Not in theory, but in reality. Even if you don't, varnish's file on-disk implementation is just as good as nginx's if not better.

The idea behind a cache is to increase performance. If that is the priority then you would pick a design and implementation geared towards that problem set. Sure you can say "Well, nginx or httpd is 'good enough'" and that would be right. But when nginx or httpd aren't good enough, you need varnish. And even when you don't need varnish, it is often a better architectural design to break out specific functionality (best of breed).

Re: Varnish Cache 5.0

#47

As someone who has never used Varnish but has used Nginx's cache to some degree... whats the benefit of placing varnish in the middle vs going with Nginx?

1: Performance. varnish provides much less latency.

2: More control.

3: Better compliance

Re: Varnish Cache 5.0

#48
post #10

Do I understand this right? It supports HTTP/2, but doesn't support HTTPS. Therefore it supports HTTP/2 in a mostly unusable form, because browser vendors (for good reasons) decided to support HTTP/2 only over HTTPS.

Yes, Varnish does h2c so for HTTPS you will need something like 1.4 or later: https://hitch-tls.org/ Made by Varnish Software to provide a "browser-vendor-compliant" HTTP/2 stack.

Hmm... you guys sure have pretty thoroughly sanitized all references to Stud at this point in code, documentation, READMEs, etc.

:-(

Re: Varnish Cache 5.0

#49
post #36
post #21

Earlier quoted context omitted.

Nope: "updating" does what I described, if another request initiated an update and it's in progress, it will serve a stale value, but the request who triggered the update is still "hanging" until the cache is refreshed. So you get that annoying slowdown for at least 1 user (often the CEO of your client company). The way to work around this issue with nginx (for simple endpoints) is to write scripts that will hit the…

There's a $500 bounty for this [1], but it doesn't look like anyone has taken it on. [1] - https://www.bountysource.com/issues/972735-proxy_cache_use_s...

The user who posted the bounty has not had any activity on bountysource outside of that bounty as far as I can tell from their profile [0], and it was two years since he and others talked about it in the comments (not including the comment six months ago from someone else since that was not directed at the poster of the bounty). To anyone thinking of fixing the issue, might want to check up on whether the bounty is still up before getting to work. If the bounty is your goal, I mean.

[0]: https://www.bountysource.com/people/23342-bdavis

Re: Varnish Cache 5.0

#50
post #17
post #2

From the release notes http://varnish.org/docs/5.0/whats-new/relnote-5.0.html "It is important that people understand that Free and Open Source Software isn't the same as gratis software: Somebody has to pay the developers mortgages and student loans." Varnish is an excellent piece of software, but I thought it was totally funded by the commercial side varnish software. How does this model work? It seems odd to ask f…

Varnish Cache Author here. The Varnish Cache FOSS project and Varnish Software the company are two entirely different things. By and large, the Varnish Cache FOSS project is me, and I am not employed by Varnish Software: I have my own one-man company where I "make computers to do weird things". The time I spend on Varnish Cache is funded by "The Varnish Moral License": http://phk.freebsd.dk/VML/index.html (See also:…

Thanks so much for replying. I did notice the Moral License and was confused as to how it works. I will attempt to get some high profile users I know to help pay for some continued development.
Post reply on HN