kube-httpcache icon indicating copy to clipboard operation
kube-httpcache copied to clipboard

Don't recomment hash

Open nigoroll opened this issue 5 months ago • 2 comments

Varnish-Cache maintainer and author of the shard director here.

I strongly recommend not to recommend the hash director:

https://github.com/mittwald/kube-httpcache/blob/f978b95a0c2ec72de24fc89f7f3e12fb5d0398fb/chart/values.yaml#L287

I recommend to use vmod_cluster, or at least the shard director with a bit of VCL (which you can also find in vmod_cluster)

nigoroll avatar Jul 16 '25 12:07 nigoroll

@nigoroll Could you explain more deeper this thing? I have a huge cluster running with this and I didn't see problems using this setup. Also, I can do the patch to fix if it's necessary.

pserrano avatar Jul 24 '25 10:07 pserrano

@pserrano For the simple case of your varnish cluster being stable (no nodes joining or leaving, health state always good), there is no relevant difference between the simple modulo hashing implemented by directors.hash(), but with any change in membership/health, disruptions become global. shard uses consistent hashing to keep the association of objects (actually hashes as calculated by sub vcl_hash {}) to nodes as stable as possible. For more background, please refer to the documentation.

nigoroll avatar Jul 25 '25 10:07 nigoroll