Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Dec 22, 2011 7:54 am 
Offline
Senior Newbie

Joined: Wed Mar 17, 2010 6:39 am
Posts: 8
I've setup a Varnish cache on a 512MB linode, using a 1GB file cache.

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)?


Top
   
 Post subject:
PostPosted: Thu Dec 22, 2011 12:59 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
I'm going to be a dick and say "try it and see!" :-)

I haven't used it yet, but this blog post made me aware of something called vmtouch, which allows you to see (and control) what's in your cache. This can probably help answer that question.

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? ;-)

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
 Post subject:
PostPosted: Fri Dec 23, 2011 4:47 am 
Offline
Senior Newbie

Joined: Wed Mar 17, 2010 6:39 am
Posts: 8
Hi Hooypcat

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?


Top
   
 Post subject:
PostPosted: Fri Dec 23, 2011 8:07 am 
Offline
Senior Newbie

Joined: Wed Mar 17, 2010 6:39 am
Posts: 8
Ok, my own empirical evidence on Varnish (on a 512MB linode) regarding cache settings in memory vs file, both 256MB:

None at all :)

Also investigated Varnish vs nginx:

b -c400 -n20000 http://mytesturl/

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.


Top
   
 Post subject:
PostPosted: Fri Dec 23, 2011 9:33 am 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
Linode's graphs give you CPU, memory, and disk I/O. With munin, however, you can graph pretty much anything. This is perhaps a ludicrous collection of examples, but at a glance, I can tell you my memcached ain't doin' nothin' right now:

Image

(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.)

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
 Post subject:
PostPosted: Fri Dec 23, 2011 11:36 am 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
Varnish is meant to use all RAM in a box and let the OS's virtual memory manager determine what gets cached and not. It also uses compression by default, if I'm not mistaken, which nginx may not, which could account for the higher CPU usage.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group