the most basic config

Sascha Ottolski ottolski at
Tue Apr 1 21:15:11 CEST 2008

Am Dienstag 01 April 2008 17:42:17 schrieb DHF:
> Sascha Ottolski wrote:
> > Hi,
> >
> > I'm a bit puzzled by the examples and the explanation of the
> > "default" vcl config presented in the man page. Now I'm wondering,
> > if I want to make my first steps for creating a reverse proxy for
> > static images only, that basically should cache everything
> > indefinetely (as long as cache space is available), what would be
> > the minimum config I need to have? Of course I need to define a
> > backend, may be increase the TTL for objects.
> >
> > A pointer to some kind of "beginners guide" would be nice, if such
> > a thing exists.
> I don't think there really is a step by step beginners guide to
> varnish, though one nice thing is out of the box it works with very
> few changes. If you used the rpm that is available on sourceforge,
> all you need is the following in /etc/sysconfig/varnish:
> DAEMON_OPTS="-a :80 \
>              -T localhost:82 \
>              -b localhost:81 \
>              -u varnish -g varnish \
>              -s file,/var/lib/varnish/varnish_storage.bin,1G"
> I have this on a test machine in my lab currently and it is happily
> wailing out cached bits at an unbelievable rate.  Apache is running
> on localhost:81, and it is setting the desired age for objects, the
> storage file size above is the default.  This should get you up and
> running, and you can start tuning from there.  One thing that seems
> to be daunting at first is that varnish is extremely flexible, and
> because of that there are many examples of neat configuration tricks
> and snippets of wizardry sprinkled in the sparse documentation, which
> makes it seem that these things are necessary to make varnish work,
> but this is not the case, the default settings work quite well.
> --Dave

thanks very much, this was very helpful. now, could anyone give me a 
hint how to interpret the output of varnishhist?

I'm seeing

client_req              15054       123.39 Client requests received
cache_hit                1632        13.38 Cache hits
cache_hitpass               0         0.00 Cache hits for pass
cache_miss               1024         8.39 Cache misses
backend_req             12347       101.20 Backend requests made

I'm wondering, why is there such a big difference between cache_miss and 
client_req. I would expect both to be similar, shouldn't they?

as I said, my setup is very simply, only static images to be be proxied. 
I started varnish (1.1.2) with

# cat
ulimit -n 131072

varnishd \
    -u sfapp \
    -g sfapp \
    -a :80 \
    -T :81 \
    -b \
    -p thread_pool_max=2000 \
    -p default_ttl=31104000 \
    -h classic,2500009 \
    -s file,/var/cache/varnish/store.bin

BTW, in the wiki, under "Performance", is a hint to 
increase "lru_interval", but apparently this parameter isn't known to 
varnishd any more.

Thanks, Sascha

More information about the varnish-misc mailing list