Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Research groupcache as alternative cache client to memcached #2962

Closed
bwplotka opened this issue Jul 30, 2020 · 16 comments
Closed

Research groupcache as alternative cache client to memcached #2962

bwplotka opened this issue Jul 30, 2020 · 16 comments

Comments

@bwplotka
Copy link
Member

I think something which would easy up Thanos deployment with cache is https://github.com/golang/groupcache This is project done my Memcached author and it's replicated in mem cache. The only tradeoff is gossip between replicas which is not that basd to setup.

To research and benchmark (:

@stale
Copy link

stale bot commented Aug 29, 2020

Hello 👋 Looks like there was no activity on this issue for last 30 days.
Do you mind updating us on the status? Is this still reproducible or needed? If yes, just comment on this PR or push a commit. Thanks! 🤗
If there will be no activity for next week, this issue will be closed (we can always reopen an issue if we need!). Alternatively, use remind command if you wish to be reminded at some point in future.

@stale stale bot added the stale label Aug 29, 2020
@kakkoyun kakkoyun removed the stale label Aug 31, 2020
@kakkoyun
Copy link
Member

I have started experimenting with groupcache.

@stale
Copy link

stale bot commented Oct 30, 2020

Hello 👋 Looks like there was no activity on this issue for the last two months.
Do you mind updating us on the status? Is this still reproducible or needed? If yes, just comment on this PR or push a commit. Thanks! 🤗
If there will be no activity in the next two weeks, this issue will be closed (we can always reopen an issue if we need!). Alternatively, use remind command if you wish to be reminded at some point in future.

@stale stale bot added the stale label Oct 30, 2020
@kakkoyun kakkoyun removed the stale label Oct 31, 2020
@stale
Copy link

stale bot commented Dec 31, 2020

Hello 👋 Looks like there was no activity on this issue for the last two months.
Do you mind updating us on the status? Is this still reproducible or needed? If yes, just comment on this PR or push a commit. Thanks! 🤗
If there will be no activity in the next two weeks, this issue will be closed (we can always reopen an issue if we need!). Alternatively, use remind command if you wish to be reminded at some point in future.

@stale stale bot added the stale label Dec 31, 2020
@bwplotka
Copy link
Member Author

Needed!

@stale stale bot removed the stale label Dec 31, 2020
@stale
Copy link

stale bot commented Mar 5, 2021

Hello 👋 Looks like there was no activity on this issue for the last two months.
Do you mind updating us on the status? Is this still reproducible or needed? If yes, just comment on this PR or push a commit. Thanks! 🤗
If there will be no activity in the next two weeks, this issue will be closed (we can always reopen an issue if we need!). Alternatively, use remind command if you wish to be reminded at some point in future.

@stale stale bot added the stale label Mar 5, 2021
@stale
Copy link

stale bot commented Mar 19, 2021

Closing for now as promised, let us know if you need this to be reopened! 🤗

@stale stale bot closed this as completed Mar 19, 2021
@GiedriusS GiedriusS reopened this Jun 7, 2021
@stale stale bot removed the stale label Jun 7, 2021
@GiedriusS
Copy link
Member

I'm working on this.

@GiedriusS
Copy link
Member

GiedriusS commented Jun 23, 2021

My semi-working branch: https://github.com/GiedriusS/thanos/tree/experiment/groupcache_caching_bucket.

Some thoughts after working on this:

There is no way to remove a group after it has been registered with groupcache without changing groupcache's code itself. This means that if we were to use it at the Thanos Query level where we'd have to dynamically register/unregister groups (lists of StoreAPI nodes that they can see), groupcache's would need to be improved.

Another huge limitation is that groupcache doesn't serialize multiple requests into one HTTP request. When opening a bigger dashboard, lots of requests are made and it can easily lead to:

2021/06/23 07:15:12 http: Accept error: accept tcp [::]:9091: accept4: too many open files; retrying in 10ms
2021/06/23 07:15:12 http: Accept error: accept tcp [::]:9091: accept4: too many open files; retrying in 20ms

This is also quite ineffective. Again, groupcache's code would need to be improved to be able to ask for multiple keys at once. This is probably the biggest thing hindering further progress.

What's more, Thanos code assumes that all caches follow the same load/store model whereas groupcache loads everything during the load() phase. This is a bit awkward for us and we can work around this easily in almost all cases without changing our own caching interface besides the iter:... keys where the value is encoded before being stored in the cache. This means that our groupcache layer would need to know about the codec as well and in this way adding a dependency on the upper layer, making things a bit less clear. Hence, some smarter abstractions need to be made.

Finally, vanilla groupcache doesn't have support for TTLs but that can be worked around by using some kind of fork such as https://github.com/mailgun/groupcache.

@GiedriusS
Copy link
Member

Yep, and for now, I would only focus on the caching bucket. Then we could move on to the other types of cache that we have in Thanos. This is because the latter is more involved since you'll have to inevitably change the internal cache interface a bit.

@kernelpanic77
Copy link

kernelpanic77 commented Aug 17, 2021

Hello @GiedriusS ! I am relatively new to the Thanos project, but would love to get involved and potentially contribute. Any pointers or resources for me to get started with Thanos and understand this issue better ?

Thanks,
Ishan

@akshatdalton
Copy link

Hola! Thanos team. I am a newbie here, but I have other Open Source experience. I would love to contribute here along with learning about new technologies. It feels great that my contribution will be useful to many. I love to take on challenges. If this is an active issue I can work on, please do let me know. Or, if there is any other challenge that I need to complete first, I am ready for that. Looking forward to contributing here actively.

Thank You
Akshat
Open Source Enthusiast

@stale
Copy link

stale bot commented Oct 30, 2021

Hello 👋 Looks like there was no activity on this issue for the last two months.
Do you mind updating us on the status? Is this still reproducible or needed? If yes, just comment on this PR or push a commit. Thanks! 🤗
If there will be no activity in the next two weeks, this issue will be closed (we can always reopen an issue if we need!). Alternatively, use remind command if you wish to be reminded at some point in future.

@stale stale bot added the stale label Oct 30, 2021
@yeya24
Copy link
Contributor

yeya24 commented Oct 30, 2021

Still valid

@stale stale bot removed the stale label Oct 30, 2021
@stale
Copy link

stale bot commented Jan 9, 2022

Hello 👋 Looks like there was no activity on this issue for the last two months.
Do you mind updating us on the status? Is this still reproducible or needed? If yes, just comment on this PR or push a commit. Thanks! 🤗
If there will be no activity in the next two weeks, this issue will be closed (we can always reopen an issue if we need!). Alternatively, use remind command if you wish to be reminded at some point in future.

@stale stale bot added the stale label Jan 9, 2022
@GiedriusS
Copy link
Member

Already in Thanos. Follow up: #5037.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants