Re: Django & memcache hashing

2008-11-21 Thread Johan Bergström
On Nov 20, 8:58 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2008-11-20 at 07:20 +0300, Ivan Sagalaev wrote: > > Malcolm Tredinnick wrote: > > > Okay. If we go this path, it's something to include in Django, rather > > > than recommending yet another caching package. We either

Re: Django & memcache hashing

2008-11-20 Thread Eric Holscher
Just wanted to say that we ran into this exact issue at work the other day as well. We had the C and Python versions of memcache running, and it was hashing things differently (to different servers or something as I understand it). This caused us a good couple hours of confusion. We eventually

Re: Django & memcache hashing

2008-11-20 Thread Ludvig Ericson
On Nov 20, 2008, at 05:20, Ivan Sagalaev wrote: > What concerns me is that this will break the usage of memcached > without > Django's cache API. I had the need a couple of times to do plain > instantiation of memcache.Client and work with it. If it won't see the > cache the same way as Django

Re: Django & memcache hashing

2008-11-19 Thread Malcolm Tredinnick
On Thu, 2008-11-20 at 07:20 +0300, Ivan Sagalaev wrote: > Malcolm Tredinnick wrote: > > Okay. If we go this path, it's something to include in Django, rather > > than recommending yet another caching package. We either make it a > > configuration option to force python-memcache or cmemcache or

Re: Django & memcache hashing

2008-11-19 Thread Ivan Sagalaev
Malcolm Tredinnick wrote: > Okay. If we go this path, it's something to include in Django, rather > than recommending yet another caching package. We either make it a > configuration option to force python-memcache or cmemcache or we just > "Do The Right Thing", with the latter being preferable.

Re: Django & memcache hashing

2008-11-19 Thread Ludvig Ericson
On Nov 20, 2008, at 00:55, Malcolm Tredinnick wrote: > Okay. If we go this path, it's something to include in Django, rather > than recommending yet another caching package. We either make it a > configuration option to force python-memcache or cmemcache or we just > "Do The Right Thing", with

Re: Django & memcache hashing

2008-11-19 Thread Malcolm Tredinnick
On Thu, 2008-11-20 at 00:46 +0100, Ludvig Ericson wrote: > On Nov 20, 2008, at 00:11, Malcolm Tredinnick wrote: > > That's possible. The hash function in the pure-Python memcached > > wrapper > > is replaceable (it's an attribute), so I was looking at replacing it > > with the version from

Re: Django & memcache hashing

2008-11-19 Thread Ludvig Ericson
On Nov 20, 2008, at 00:11, Malcolm Tredinnick wrote: > That's possible. The hash function in the pure-Python memcached > wrapper > is replaceable (it's an attribute), so I was looking at replacing it > with the version from cmemcached. Using a third hashing algorithm > would > be a bit silly,

Re: Django & memcache hashing

2008-11-19 Thread Malcolm Tredinnick
On Wed, 2008-11-19 at 03:26 -0800, taleinat wrote: [...] > What about having Django's memcached cache backend implement its own > hashing algorithm? This could be the "standard" one used in > libmemcache and cmemcache, or perhaps a consistent hashing algorithm > [1] such as libketama[2]. That's

Re: Django & memcache hashing

2008-11-19 Thread Ludvig Ericson
On Nov 19, 2008, at 12:26, taleinat wrote: > What about having Django's memcached cache backend implement its own > hashing algorithm? This could be the "standard" one used in > libmemcache and cmemcache, or perhaps a consistent hashing algorithm > [1] such as libketama[2]. As I said in the

Re: Django & memcache hashing

2008-11-19 Thread taleinat
On Oct 8, 10:54 am, Malcolm Tredinnick wrote: > On Wed, 2008-10-08 at 10:37 +0200, Ludvig Ericson wrote: > > Hello, > > I had issues with Django opting to use cmemcache and secondarily   > > python-memcached. > > > This behavior is extremely dangerous-- lest you be aware, cmemcache   > > and

Re: Django & memcache hashing

2008-10-08 Thread Ludvig Ericson
On Oct 8, 2008, at 10:54, Malcolm Tredinnick wrote: > Could you create a documentation patch, or at least open a ticket > about > this, please, so that somebody else creates a documentation patch? > This > is definitely worth recording in the docs. It's ultimately a > configuration issue

Re: Django & memcache hashing

2008-10-08 Thread Malcolm Tredinnick
On Wed, 2008-10-08 at 10:37 +0200, Ludvig Ericson wrote: > Hello, > I had issues with Django opting to use cmemcache and secondarily > python-memcached. > > This behavior is extremely dangerous-- lest you be aware, cmemcache > and python-memcached disagree on how to choose memcached in a

Django & memcache hashing

2008-10-08 Thread Ludvig Ericson
Hello, I had issues with Django opting to use cmemcache and secondarily python-memcached. This behavior is extremely dangerous-- lest you be aware, cmemcache and python-memcached disagree on how to choose memcached in a list. Now set up four-five machines with slightly varying needs,