pythondjangomemcachedpylibmc

Alternative for pylibmc cache backend in django 1.7


I have recently migrated from django 1.6 to 1.7 which has the following changes:

If you instantiate cache backends directly, be aware that they aren’t thread-safe any more, as django.core.cache.caches now yields different instances per thread.

Since I use uwsgi in production with threads, I've started getting errors from pylibmc (which is not thread-safe).

I want to ask if there is any substitution for pylibmc backend. I know there is another backend served with django (python-memcached), but i've read that it is not suitable for highload solutions since it's quite slower than pylibmc.


Solution

  • Here is thread-safe alternative of pylibmc, you could try the gist https://gist.github.com/mrts/334682