Varnish cache on small linode - file or memory?
However, I've seen quite a lot of recommendations to make this a memory cache.
Thing is, I believe Linux will start caching the blocks from the varnish log file in memory, and thus don't see why this should make a difference (except for after restarting the machine)?
5 Replies
I haven't used it yet, but this blog postvmtouch
And, of course, the standard admonition applies: If you aren't using munin or something similar to monitor memory usage, disk I/O, varnish stats, and page load times, you should install that and get it going before you even think of doing anything else. Web servers/applications/caches form a very complex system. Do you know if varnish is helping at all, or if you are even using 1 GB of it?
Thanks for the response - seems entirely reaonable to me! Thinking about it more than a few seconds (and not just lazily asking here!), I really don't need 1GB. I just have a few Drupal 7 sites (page size according to Chrome averages only ~100kb, but the vast majority of that is css, js, and jpeg, shared on all pages), with low traffic. My only reason for Varnish was to attempt to prevent any downtime should I be lucky enough for one of my posts to be linked from a high traffic site. I since also tweaked the Apache max clients down, so at least the whole node doesn't blow up either.
Thanks also for both those links - I seem to recall reading the Instagram one a while back, but had since forgotten about it. With that in mind might go the whole nginx route, and drop Varnish altogether.
Re Munin - I thought that's what generates the graphs on the Linode panel? Is there something extra I'd gain by setting it up myself?
None at all
Also investigated Varnish vs nginx:
b -c400 -n20000
Varnish: 2200 req/sec, 35% CPU, 17% mem
nginx: 1900 req/sec, 26% CPIU, 0.2% mem
So Varnish uses more memory, and more CPU cycles… but I like the configurability/power of using VCL for stripping cookies, and the varnishlog/varnishtop etc utils.
This is perhaps a ludicrous collection of examples
~~![](<URL url=)
(I can also tell you 42 customers are without power in my area, and that it's probably not snowing outside, but those are in the "ludicrous" category.)~~