Improve handling of cache stampeding / thundering herd #60781
Unanswered
Vectorial1024
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Currently Laravel does not really have anything effective against cache stampeding / thundering herd. When cache entry expires, we would have multiple Laravel processes trying to repopulate the cache entry. This could be a problem.
One way to deal with this is an opt-in lottery-based "read failures". By a low-probability lottery (opt-in), the Cache layer pretends that a cached value doesn't exist when the entry still has not expired yet. This allows a limited number of Laravel processes to update the cached entry before it expires. This should mitigate the above-mentioned stampede problem.
Perhaps Laravel can introduce this feature?
All reactions