by jjoe · 16y ago · 0 comments
2) Nginx is no match for Varnish's VCL for header/cache manipulation
Regards
Let me know if you have any question/comment.
Regards
The post describes a setup with two cacheing layers on each edge node, varnish cache in front of ngingx cache, which has got to be sub-optimal.
Keep in mind that the goal of the article is to build an affordable CDN based on VM edge nodes. Memory is still expensive on VMs (especially if you're going to be renting VMs in costly locations). So if you have say a 20GB static store that needs to be served, on a 2GB RAM VPS, Varnish will only be able to cache that much files and be forced to make round trips to the dynamic node on miss.
Varnish does have "persistent" storage capabilities but from what I've read they're still experimental.
Regards
Not sure what you mean by "has some performance penalty compared to Varnish" however.
The performance penalty comes the number of system calls needed to complete the request. According to the Varnish arch docs, it's 18 syscalls (http://varnish-cache.org/wiki/ArchitectNotes). Also, Varnish doesn't malloc for each new request/header. It mallocs once per workspace.
Unfortunately there's no such thing as Nginx vs Varnish benchmarks because Varnish is just a cache (apple to orange comparison).
Regards Joe
Also read my other reply to your comment: http://news.ycombinator.com/item?id=1593611
I suggest you take down that benchmark article, because it is flawed on too many levels.
As explained above, all info has been disclosed on the page in question. It's up to the reader to agree or disagree with the results. Let's face it, benchmarks are always going to be controversial and imperfect. One should always take the initiative to verify results by running their own tests.
Regards
Joe