Skip to content

feat: cache eviction strategy #76

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

Merged
merged 4 commits into from
Aug 19, 2024
Merged

feat: cache eviction strategy #76

merged 4 commits into from
Aug 19, 2024

Conversation

jgoux
Copy link
Contributor

@jgoux jgoux commented Aug 15, 2024

We need a strategy to delete unused / old cached databases. We also need to delete cached databases if our ephemeral storage reach a threshold.

The strategy works on two metrics:

  • Disk usage: if the disk is 90% full, then we delete cached databases in old->newer order until we are back under the threshold
  • TTL: we delete the cached databases from the cache if they're older than 24 hours

We execute this strategy on every requests, but we save the last execution time to a file so the strategy is only applied once per hour.

@jgoux jgoux requested a review from gregnr August 15, 2024 11:03
@jgoux jgoux mentioned this pull request Aug 15, 2024
4 tasks
@jgoux jgoux merged commit 0250f74 into next Aug 19, 2024
1 check failed
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

Successfully merging this pull request may close these issues.

2 participants