mailgun / groupcache

Clone of golang/groupcache with TTL and Item Removal support
Apache License 2.0
484 stars 72 forks source link

Question(s) #24

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hello,

Thank you for making this fork available!

Since there is very little documentation available on groupcache I thought I might get some insight from someone who is actually running it in production.

Basically, I want to know what happens when one or multiple groupcache running nodes goes offline temporarily. Will the groupcache cluster be able to recover and continue operating properly?

thrawn01 commented 3 years ago

Groupcache doesn't provided peer discovery or keep track of peer liveliness. You will need something that can do that for you, like kubernetes, etcd, consul, memberlist, such that when a node goes down or becomes unavailable it will notify you and your application can remove that peer from the groupcache peer list. We have used https://github.com/hashicorp/memberlist and etcd in the past with great success. Others have used kubernetes for this, you will have to write that yourself with your project needs in mind.

ghost commented 3 years ago

Thank you for the tips @thrawn01 . memberlist seems an interesting project and I plan to give it a spin.

I am aware that groupcache doesn't provide peer discovery nor does it keep track of peer liveliness out of the box, however based on the loading process described here, my assumption is that groupcache should tolerate nodes going offline without issues.

When the owner of a cached entry is offline and the entry is not hot on the node requesting it, the requester attempts a RPC call to the owner node, the call fails and the requester will retrieve the data itself. Based on this description, my assumption is that I can safely take groupcache nodes offline without destabilizing the cluster.

Can you confirm this assumption?

thrawn01 commented 3 years ago

Yes, your assumption is correct.

ghost commented 3 years ago

Thank you @thrawn01 !