|Version 1 (modified by otherjacob, 3 years ago) (diff)|
Tickets #12427 and #11675 are opened with different by related goals: get rid of cmemcache (which had gone the way of the broken-as-heck dodo) and add support for a new libmemcached wrapper pylibmc (respectively).
Email thread seen here begins: http://groups.google.com/group/django-developers/browse_thread/thread/4eb685ca5b305f18/
Ticket is put in for 1.2 to put use of cmemcache as FuturePendingDeprecation, while adding support for pylibmc was greenlit for 1.3
Discussion re-started with three key points to debate:
- Pylibmc 1.1 doesn't play that nice with mod_wsgi due to it's use of the Simplified GIL API (see: http://www.dctrwatson.com/2010/09/beware-of-using-pylibmc-1-1-and-mod_wsgi/). Probably just need to make note of it in the documentation, but it's worth noting.
- The suggested use of using query-string for client-specific options and libmemcached 'behaviors' eventually leading to massive client strings, and the use of a CACHE_SETTINGS dictionary may be a better solution.
- Because it bypasses the GIL, pylibmc isn't thread safe. There are a few different solutions, the most apparent being to use pylibmc's ThreadMappedPool. More info here: http://lericson.blogg.se/code/2009/september/draft-sept-20-2009.html and http://blog.sendapatch.se/2009/september/pooling-with-pylibmc-pt-2.html .
Another post of note with regards to multithreading [ala, celery] here: http://www.dctrwatson.com/2010/09/python-thread-safe-does-not-mean-fork-safe/#more-48