Skip to content
New issue

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

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

Already on GitHub? # to your account

freecache why not introduce singleflight for hot key issue? #103

Open
beijingzhangwei opened this issue Dec 7, 2021 · 3 comments
Open

Comments

@beijingzhangwei
Copy link

freecache why not introduce singleflight for hot key issue? or any reason?

@coocood
Copy link
Owner

coocood commented Dec 7, 2021

Can you be more specific about the hot key issue?

@beijingzhangwei
Copy link
Author

beijingzhangwei commented Dec 7, 2021

My business has a scenario :where a large number(10Kqps) of requests for access to the same key data will be made in the same time.

1:
If the data not in cache and not in remote storage, the request will penetrate to the downstream business, which will increase the pressure on the downstream business. This is a Unusual case...
2:
Freecache use segment lock, pending all other requests . But, if the segment lock release by the first goroutine, other goroutines need query the key from memory cache again. I think why not just give the first goroutine's result to other pending goroutines.

@lypee
Copy link

lypee commented May 28, 2022

觉得这个提案很好

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants