MintCache (simple version)

MintCache is a caching scheme Disqus has recently implemented. We posted Disqus’ implementation of MintCache for others to use.

From the original MintCache posting:

The purpose of this caching scheme is to avoid the dog-pile effect. Dog-piling is what normally happens when your data for the cache takes more time to generate than your server is answering requests per second. In other words if your data takes 5 seconds to generate and you are serving 10 requests per second, then when the data expires the normal cache schemes will spawn 50 attempts a regenerating the data before the first request completes. The increased load from the 49 redundant processes may further increase the time it takes to generate the data. If this happens then you are well on your way into a death spiral

MintCache works to prevent this scenario by using memcached to to keep track of not just an expiration date, but also a stale date The first client to request data past the stale date is asked to refresh the data, while subsequent requests are given the stale but not-yet-expired data as if it were fresh, with the undertanding that it will get refreshed in a ‘reasonable’ amount of time by that initial request.

Link: MintCache (simple version)

Daniel on June 11th 2008 in Django, Python, disqus

Viewing 6 Comments

close Reblog this comment
blog comments powered by Disqus