fastcache icon indicating copy to clipboard operation
fastcache copied to clipboard

discuss about timing of getChunk()

Open ahfuzhang opened this issue 4 years ago • 0 comments

each bucket limit the memory as 1/512 of total. eg: I need 512MB cache, but each bucket only 1 MB. if many keys goes to one bucket, many data will over write when chunks full.

I don't have any data to show this will happen. but for logic, this will be better: don't limit bucket memory to 1/512 of total.

file fastcache.go, func (b *bucket) Set, line 335:

if chunkIdxNew >= uint64(len(b.chunks)) {  // len(b.chunks) here could use all buckets used chunks count

I wish I said clear with Chinglish. :-) thanks.

ahfuzhang avatar Jan 24 '22 10:01 ahfuzhang