Questions on backend allocations
Dridi Boukelmoune
dridi at varni.sh
Wed Apr 15 19:31:45 CEST 2015
Hi,
Last day of training, and probably the last patch set regarding
dynamic backends operations (only during vcl.* commands).
I'm almost satisfied with this batch, and it's basically all non
disruptive changes I could do to make dynamic backends work
to some extent.
Cheers,
Dridi
On Wed, Apr 15, 2015 at 12:23 AM, Dridi Boukelmoune <dridi at varni.sh> wrote:
> Hi,
>
> It turns out my trainees were so quiet during exercises that I could
> explore this a bit more.
>
> I have come to the point where you don't need a backend declaration in
> your VCL, as long as you have a director that will dynamically create
> one. Once backend check was deferred to *after* vcl_init, it made very
> easy to allow a director to become the default backend.
>
> See the test d00007.vtc for a pure dynamic backend:
>
> varnish v1 -vcl {
> import ${vmod_debug};
>
> sub vcl_init {
> new s1 = debug.dyn("${s1_addr}", "${s1_port}");
> }
> } -start
>
> See the test d00008.vtc for a director as the default:
>
> varnish v1 -vcl+backend {
> import ${vmod_directors};
>
> # no need for `set bereq.backend = default;`
> sub vcl_init {
> new default = directors.round_robin();
> default.add_backend(s1);
> default.add_backend(s2);
> }
> } -start
>
> There are still caveats with the current implementation, and it's still not
> enough to implement a new dns director. Dynamically created backend
> won't receive events, which is not a problem *so far* since we can't pass
> probes to VMODs yet. Instead of emitting per-backend code for events,
> it could rely on backend_find() to fire events on both static and dynamic
> backends.
>
> Comments?
>
> Cheers,
> Dridi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0008-Fix-comment-in-a-test-case.patch
Type: text/x-patch
Size: 785 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20150415/78e25c95/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0009-Rename-backend_find-to-VBE_Find-and-make-it-public.patch
Type: text/x-patch
Size: 2434 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20150415/78e25c95/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0010-Fire-events-to-all-the-backends-of-the-active-VCL.patch
Type: text/x-patch
Size: 7759 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20150415/78e25c95/attachment-0002.bin>
More information about the varnish-dev
mailing list