freecache icon indicating copy to clipboard operation
freecache copied to clipboard

freecache why not introduce singleflight for hot key issue?

Open beijingzhangwei opened this issue 4 years ago • 3 comments

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

beijingzhangwei avatar Dec 07 '21 10:12 beijingzhangwei

Can you be more specific about the hot key issue?

coocood avatar Dec 07 '21 11:12 coocood

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.

beijingzhangwei avatar Dec 07 '21 13:12 beijingzhangwei

觉得这个提案很好

lypee avatar May 28 '22 21:05 lypee