Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm interested in maximizing cache hits and efficiency for a slow-changing site. The virtual host doesn't have a huge amount of RAM, but I'd like to use what's available for varnish, but to fall back to disk cache if there isn't enough memory.

Is it possible to do this with a single instance of varnish? The docs describe "file" and "malloc" storage as distinct options.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

Use the malloc method. It will try to put everything in RAM and the kernel will swap it out if needed. This way you are using memory and disk together.

At the same time file performs much better than malloc when you start hitting disk. For more info, see:

share|improve this answer
    
Thanks, this works. I think I'll just use malloc method with available RAM, and rely on the server to do disc caching (e.g. apache mod_disk_cache). –  user67641 Feb 1 '11 at 20:29
    
Is there a way to plug Varnish into other memory based backends? –  CMCDragonkai May 20 at 0:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.