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 disqus, Django, Python
Preface
A couple of months ago, Daniel and I began drafting ideas for a new website. When it came down to choosing a language to begin our work, we had a tough decision to make. We both traditionally stuck to PHP for web development in the past, but we wanted to use a web framework for rapid development. The decision to use Django came from three things: it’s written in Python, there are proven real world examples of large-scale websites using Django (the developers kept performance in mind and implemented a nice caching framework), and the documentation is good.
While this primer will mainly aim at those with no Django experience (or experience with a web framework at all), I am assuming that you have some understanding of Python. I will go over the details for creating a simple blog application. While Django is still not at 1.0 yet (as of this writing), there are things which may change. I will do my best to make sure to this information stays up to date. I am also assuming you are using the latest development version (0.96-dev as of this writing). Installation of the development version will require Subversion and is documented on the official Django project website here.
Continue Reading »
Jason on March 11th 2007 in Django, Python