Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Director subscriptions #4084

Open
nigoroll opened this issue Mar 18, 2024 · 0 comments
Open

RFC: Director subscriptions #4084

nigoroll opened this issue Mar 18, 2024 · 0 comments

Comments

@nigoroll
Copy link
Member

nigoroll commented Mar 18, 2024

Layering directors works at the moment by adding references to a director as a backend of another director.

This is all good and well, but there is an additional use case idea which could be powerful and of which I was reminded by a question: Directors currently combine the functions of discovering backends and distributing requests. Most directors use "static" discovery (configuration via VCL), but "dynamic" directors don't and, for example, the dynamic director gets its backend from DNS or other name services.

Currently, the dynamic director needs to (re)implement all distribution functions it wants to offer. But would it not be nice to be able to split them, and use the dynamic director's discovery for arbitrary load balancing directors, such as, in particular, shard?

This ticket is to ask for opinions about this idea. I am aware that a proper proposal should come in the form of a VIP, but I would first like to gather feedback on the viability of the idea and also the potential design.

For now, I would think that we could have something like the following vcl strawman:

sub vcl_init {
  new discovery = dynamic.backend("foo.bar");
  new shard = directors.shard();
  shard.subscribe(discovery.backend());
  shard.parametrize("^[a-f]\.", rampup=5m);
}

This would configure a dynamic director discovery and a shard director, which subscribes to backend updates of discovery. A .parametrize() method could be used to add additional parameters to backends learned from the subscription, for example by a regex of their name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant