A couple varnish 2.1 questions...

Darron Froese darron at nonfiction.ca
Tue Apr 27 18:54:09 CEST 2010


I have a Rackspace Cloud server running Ubuntu 9.10 (1GB of RAM,
Quad-Core AMD Opteron Processor 2374 HE, I believe it's 64bit)
specifically JUST to run Varnish for a festival website. It's fast
enough for most of the year, but for about 3 weeks it gets pretty
loaded and I want to make sure that the site survives without issues
this year. It's mostly static information so pretty easy to cache.

Varnish 2.1 is compiled from this dsc file:

http://archive.ubuntu.com/ubuntu/pool/universe/v/varnish/varnish_2.1.0-2.dsc

I have 2 questions:

1. I know that I'm doing something wrong with my vcl file - what I want is this:

5 minute TTL for all content (regardless of headers) - as long as the
backend is healthy
1 hour TTL for all content if the backend is sick (500 error, not
responding, etc)

I've tried what's referenced here:

http://varnish-cache.org/wiki/VCLExampleGrace
http://varnish-cache.org/wiki/BackendPolling

And it didn't seem to work - some content gave out a 50x error RIGHT
away when I took the test backend down and other content worked for 5
minutes and then gave 50x errors.

Here was that vcl:

http://gist.github.com/380966

Here's my current vcl (with hostnames obscured sorry):

http://gist.github.com/380942

I know it's wrong - can somebody point out what I'm missing? I've
messed with it for a while now and just can't seem to get it to do
what I want.

2. I stress tested that server overnight hit 479M pageviews which will
be much higher than I need - I basically ran these two commands in a
loop:

ab -n 10000 -c 100 http://varnish.nonfiction.ca/
wget -q -A *.html -r http://varnish.nonfiction.ca/

NOTE: High levels of single page traffic on this site, it exists to
serve out lots of homepage traffic and very low levels of anything
else. All external images/CSS and JS files will be served via CDN.

Varnishstat at the end of the run: http://drp.ly/TEvcv
Here's the munin details: http://drp.ly/TEzd0

My only concern is the amount of committed memory - should it be
rising that high?

After I killed varnish - the committed memory went back down:
http://drp.ly/TFtdx

Do I need to put a manual restart of Varnish into my crontab to free that up?

Any responses/links/etc. would be great - thanks.




More information about the varnish-misc mailing list