On Saturday, October 15, 2011, Cal Leeming [Simplicity Media Ltd] < [email protected]> wrote: > Hey all, > Today, we had a client getting around 600k webapp requests per hour (avg 6k/min), and had to do some emergency perf hotfixes (CodeIgniter+PHP) > In the end, we monkey-patched the code so raw SQL statement was used to generate a cache key, and we performed a lookup on that. It was absolutely great at preventing snowballing of things like tmp tables causing connection backlog - and resolved the problem completely. > Anyway, it got me thinking that it would be nice if Django could do this out of the box. Sure, the Django query cache works great, but when you have a large cluster of servers, and large queries causing tmp tables, something like this would be perfect. > Something like a DATABASE_CACHE='memcache://127.0.0.1:11211' > Does anyone have any thoughts about doing a feature request for this? If feedback is positive, I'll put in a feature request and put some time aside to write the patch.
It sounds to me like you've just rediscovered Django ticket #17. We've made the decision that this sort of caching would fundamentally change the design contract of the ORM, and there isn't a single obvious way to solve the problem that we could provide as an optional behavior (cache setting is fine; it's cache invalidation where problems arise). However, the good news is that it can be handled as an external extension to the ORM. There are a number of external model caching libraries that address this problem; for example Johnny Cache and Cache Machine. Yours, Russ Magee %-) -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
