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

Limit total cache size #29

Open
nschoellhorn opened this issue Feb 6, 2021 · 0 comments
Open

Limit total cache size #29

nschoellhorn opened this issue Feb 6, 2021 · 0 comments

Comments

@nschoellhorn
Copy link
Owner

The cache currently doesn't care what the capacity setting is. We should implement limiting the total cached amount by adding eviction of older items that weren't accessed for a longer time.
The database model already supports that, offering a last_read and last_write column to mark when chunks were last accessed. Those values need to be updated in read() and write() and then checked when initializing new chunks. When the new chunk would exceed the allowed size, it needs to find the chunk with the oldest last_read and last_write times and evict that chunk from the cache.

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