I have 2 varnish, each of them having 2 backends (same varnish versions -v4.x- and configuration file).
Incoming client connections are randomly distributed to any available varnish.
I need clients to always use the same varnish backend, based on their source IP (except, of course, in case of a failed backend).
I use the following (simplified) configuration:
new servers = directors.hash();
servers.add_backend(srv01, 1.0);
servers.add_backend(srv02, 1.0);
sub vcl_recv {
set req.backend_hint = servers.backend(client.ip);
}
I would like to know if the hashing algorithm used by Varnish will guarantee that no matter which Varnish they go through, clients will always be using the same backend.
It means that no random-like data must be used to initialize the hashing algorithm. Do you know if it is the case?