Open synth opened 7 years ago
So given that this was asked in 2017... was there any conclusion to this? Aside from how frequently is this being refreshed, in a typical rails app the config will be initialise on restart, how do I even call .refresh outside of production.rb?
This is a good question and I plan to write up some documentation shortly. Some quick notes:
Dalli::Client
. That is, refreshing the Dalli::Elasticache
set will have no impact on caching behavior for existing clients, including those configured for the Rails cache and session stores. Dalli requires enhancements to take advantage of node updates. Those may make it into Dalli 4.0.
The README states how you can refresh the client, but it does not state how often this should occur or by what means.
I couldn't find much documentation on how often or why Elasticache nodes might drop off or join. The only thing the AWS docs mention is that:
What are users of this gem expected to implement in terms of refreshing? I see in the Dalli-Elasticache docs that it refreshes upon app server restart. However, should we implement a refresh as a cron? Every 30minutes? Sample code would be most appreciated!
I've also posted a similar question on Stack overflow: https://stackoverflow.com/questions/47170376/how-to-refresh-clustered-redis-elasticache-nodes-in-a-rails-app Thanks.