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

discuss about timing of getChunk() #64

Open
ahfuzhang opened this issue Jan 24, 2022 · 0 comments
Open

discuss about timing of getChunk() #64

ahfuzhang opened this issue Jan 24, 2022 · 0 comments

Comments

@ahfuzhang
Copy link

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.

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

No branches or pull requests

1 participant