You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But apparently (TIL) there is a better practice by using consistent hashing.
Unfortunately, this particular approach suffers from a fatal flaw due to the way that
modulo works. As the number of cache nodes scales up, most hash keys will get
remapped to new nodes with empty caches, as a side effect of using modulo. You can
calculate the number of keys that would be remapped to a new cache node by dividing
the old node count by the new node count. For example, scaling from 1 to 2 nodes
remaps half (½) of your cache keys; scaling from 3 to 4 nodes remaps three-quarters
(¾) of your keys; and scaling from 9 to 10 nodes remaps 90 percent of your keys to
empty caches
From a quick look it seems like deciding to what node the key goes is based on
crc32
hash and modulo.But apparently (TIL) there is a better practice by using
consistent hashing
.From https://d0.awsstatic.com/whitepapers/performance-at-scale-with-amazon-elasticache.pdf
Am I understanding correctly that
gomemcache
doesn't have consistent hashing?Thanks
The text was updated successfully, but these errors were encountered: