Caching efficiency, VCL

Dag-Erling Smørgrav des at linpro.no
Thu Sep 21 12:05:37 CEST 2006


Eirik Øverby <ltning at anduin.net> writes:
> - Others on this list have asked for VCL documentation.  I seel the
> same.

I'm working on it.

> - There's also some lack in the documentation of (runtime)
> parameters listed in the varnishd man page.

'param.show -l' in the management interface will give you a complete
list with fairly detailed descriptions.

> - Can I control access to the management interface through VCL?

No.

> - Due to the fact that webserver and varnish are currently running
> on the same box, I am using a pf ruleset like the following:
> no rdr on $int_if proto tcp from $my_ip to $my_ip port 80
> rdr on $int_if proto tcp from any to $my_ip port 80 -> $my_ip port 8080
> Is this going to limit my performance in any significant way? Given
> that I'm running on hardware comparable to what the devs have been
> testing on, and the site I'm serving sees only a tiny fraction of the
> traffic, I wouldn't think so.

Can't you make your web server run on port 8080?

> - The cmdline allows me to specify a minimum ttl for objects -- I'm
> missing a way to specify max ttl. Is this something I could do in
> VCL, and in that case, why is there an option for the minimum ttl?

This is a documentation error - the option actually controls the
*default* ttl if none is provided by the backend server.

You can inspect and modify the TTL in VCL; vcl_fetch would be a good
place to do that...  something like:

sub vcl_fetch {
    if (obj.ttl > 120s) {
        set obj.ttl = 120s;
    }
}

(not tested, so caveat emptor)

DES
-- 
Dag-Erling Smørgrav
Senior Software Developer
Linpro AS - www.linpro.no



More information about the varnish-misc mailing list