Skip to content

Conversation

@djmb
Copy link
Collaborator

@djmb djmb commented Jan 22, 2024

If the lifespan of a process is smaller than an expiry cycle then it may not trigger the expiry process often enough. We mitigate this a little bit by pre-filling the counter with a random number, but that means that on average a process still needs to survive for half an expiry cycle.

Instead lets trigger expiry randomly, but keep the same overall frequency. This will always give us an expiry rate proportional to the number of writes whatever the process length.

Fixes #91

If the lifespan of a process is smaller than an expiry cycle then it
may not trigger the expiry process often enough. We mitigate this a
little bit by pre-filling the counter with a random number, but that
means that on average a process still needs to survive for half an
expiry cycle.

Instead lets trigger expiry randomly, but keep the same overall
frequency. This will always give us an expiry rate proportional to the
number of writes whatever the process length.
@djmb djmb force-pushed the probabilistic-expiry branch from 39c8e92 to b7b14b7 Compare January 22, 2024 16:05
@djmb djmb merged commit 085f877 into main Jan 23, 2024
@djmb djmb deleted the probabilistic-expiry branch January 23, 2024 14:26
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.

Cache expiry might not be trigger by short lived processes

2 participants