Lots of configs

David Murphy david at firechaser.com
Wed Mar 9 09:41:14 CET 2011

>And finally, since most users with massive domains will need or want
>to reload VCL for trivial addition/removals of domains, somebody[TM]
>should probably write a VMOD which looks a domain up in a suitable
>database file (db/dbm/whatever)

I was wondering, is there any way for us to be able to run an external
lookup that can form part of decision-making in VCL. For example, a
file or db lookup to see if a value is true/false and that will
determine which sections of VCL code run?

A real-world example is where we have a waiting room feature that aims
to limit traffic reaching a payment portal. When the waiting room is
on we'd like Varnish to hold onto the traffic. When turned off we
would then forward the requests hitting VCL to the payment system.
Currently we are doing this in the backend with a PHP / MySQL lookup
and it works, but it's far from ideal.

Perhaps a better way would be to pass in the true/false value as a
command line arg to Varnish as a 'reload' rather than restart (similar
to Apache, I guess) so we don't lose connections. Would also mean that
no lookups are required per request. The waiting room state changes
on/off only a few times a day. Not sure if this is possible or even
desirable but would appreciate your thoughts/suggestions.

Thanks, David

More information about the varnish-misc mailing list