Cache configuration

Poul-Henning Kamp phk at phk.freebsd.dk
Mon Aug 31 23:31:01 CEST 2009


In message <dc64e7230908311420o4ad27089td44a6c99ecf88c46 at mail.gmail.com>, maill
ists0 at gmail.com writes:

>I'm calling Varnish with the option "-s file,/dir/cachefile,1g"  When I
>restart it, I see that everything is fetched fresh from the source server.
>Is that expected behaviour? Can I make the cache persist across
>restarts/reboots?

I am working on a persistent storage module as we speak...

>Related question: how should I plan memory/swap usage? I have millions of
>4-5k objects. I'd like to limit the cache size of a single varnish server to
>around 50Gigs. Should I expect that varnish will try to use that same amount
>in swap? What about corresponding memory usage?

If you have millions of objects, you will want to tune the parameter
obj_workspace as far down as you sensibly can to reduce overhead.

As for memory use, I do not have an exact formula I can give you
but most of the non-storage-file space used is proportional to number
of objects, and not very tweakable.

>Also, may I add that varnishlog is the coolest thing since sliced bread?

Have you tried varnishtop ?  :-)

Poul-Henning

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



More information about the varnish-misc mailing list