Mailing List Archive

[master] 0c30fedfe shard director: explain how the ring is constructed with weights
commit 0c30fedfe418c59eb6bb900c43c075092e7daddf
Author: Nils Goroll <nils.goroll@uplex.de>
Date: Mon Jul 6 18:07:09 2020 +0200

shard director: explain how the ring is constructed with weights

diff --git a/lib/libvmod_directors/vmod_directors.vcc b/lib/libvmod_directors/vmod_directors.vcc
index 8ab9f12fa..940b403cd 100644
--- a/lib/libvmod_directors/vmod_directors.vcc
+++ b/lib/libvmod_directors/vmod_directors.vcc
@@ -319,7 +319,10 @@ hashing circular data structure gets built from the last 32 bits of
SHA256 hash values of *<ident>*\ *<n>* (default *ident* being the
backend name) for each backend and for a running number *n* from 1 to
*replicas*. Hashing creates the seemingly random order for placement
-of backends on the consistent hashing ring.
+of backends on the consistent hashing ring. When
+`xshard.add_backend()`_ was called with a *weight* argument,
+*replicas* is scaled by that weight to add proportionally more copies
+of the that backend on the ring.

When `xshard.backend()`_ is called, a load balancing key
gets generated unless provided. The smallest hash value in the circle
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit