Add Split::Cache to reduce load on Redis#648
Conversation
amangup
left a comment
There was a problem hiding this comment.
I think for merging it to main branch, we need to make a few more changes, but for us it works (except the winner caching). I will test it out.
Yeah. I'm not sure about |
|
Thanks for working on this ✨ I haven't tested this fully, but I like where this is going. I have some plans to reduce/refactor some calls on split codebase to reduce the amount of Redis calls. But until that happens, having this cache around would be nice. |
Happy to contribute. We use your gem like crazy. Have about 50+ experiments and we're bucketing into every experiment on every request, due to some dubious architectural choices. We just pushed this logic cherry-picked onto 3.4.1 to our production servers today, and our average Redis burn dropped from ~60m to ~30ms. Still too high, but a lot better ;-) |
|
Awesome, good to know @rdh ! I wanna release v4 soon, this PR would be a great addition :) |
|
OK. I've added minimal docs, so this is discoverable. I think this PR hangs together, and is already doing good stuff for us. I think it's mergeable "as is" and can convert to real PR, if you're cool with it. Some possible additions:
|
I'll review it fully tomorrow, and I'll let you know if find anything else. I think it's ok to convert to a PR too.
Agreed. It's also disabled by default. We can improve it later
I think it's fine for now 👍 |
The
Split.configuration.cacheboolean value will enable in memory caching of infrequently changing values from Redis. Changes to these values will not be reflected until restart, or whenSplit::Cache.clearis called.