Re: [] Re: memcached - Errors and Solution - please provide comments!

2011-11-13 Thread ionic drive
Hello and thanks for the respond. My knowledge on caching was little. I used it, but I never programmed it my self. So I had no idea about how the keys would be stored. The solution was... I did not mess with my memcached.py or anything else. I just use it as everybody else is using it. The

Re: [] Re: memcached - Errors and Solution - please provide comments!

2011-11-12 Thread Russell Keith-Magee
On Sun, Nov 13, 2011 at 11:35 AM, Cal Leeming [Simplicity Media Ltd] wrote: > +1 on hashing the key. > Just my two cents worth but, the way our company does it as standard is > something like this: > import hashlib > def generate_key(*args, **kwargs): >    

Re: [] Re: memcached - Errors and Solution - please provide comments!

2011-11-12 Thread Cal Leeming [Simplicity Media Ltd]
+1 on hashing the key. Just my two cents worth but, the way our company does it as standard is something like this: import hashlib def generate_key(*args, **kwargs): return hashlib.sha224(pickle.dumps([args, kwargs])).hexdigest() Then you can do stuff like: lol = YourModel.objects.all()[0]

RE: [] Re: memcached - Errors and Solution - please provide comments!

2011-11-10 Thread Henrik Genssen
Hi inonc, >Why am I the only one who seems to be faced with such issues? >I thought millions out there do use memcached as their backend...? >Wouldn't be MD5 a great solution to all of us? The guys with small >sites, don't have issues with scaling, and the guys with big sites are >in the need of

Re: memcached - Errors and Solution - please provide comments!

2011-11-10 Thread ionic drive
ok, so removing the invalid keys is the best solution. great thank you guys! ionic On Thu, 2011-11-10 at 11:36 +, Tom Evans wrote: > On Thu, Nov 10, 2011 at 11:25 AM, ionic drive wrote: > > Yes Malcolm, > > > > thanks for the great and smart answer! > > You are

Re: memcached - Errors and Solution - please provide comments!

2011-11-10 Thread Tom Evans
On Thu, Nov 10, 2011 at 11:25 AM, ionic drive wrote: > Yes Malcolm, > > thanks for the great and smart answer! > You are totally right, this was the reason why I was asking for, I > already knew their could be coming up new troubles. > > two more questions: >

Re: memcached - Errors and Solution - please provide comments!

2011-11-10 Thread ionic drive
Yes Malcolm, thanks for the great and smart answer! You are totally right, this was the reason why I was asking for, I already knew their could be coming up new troubles. two more questions: -- We don't have troubles with > 255 keys. as we do not have such long keys. But we have

Re: memcached - Errors and Solution - please provide comments!

2011-11-10 Thread Malcolm Box
On 10 November 2011 08:54, ionic drive wrote: > Hello django friends, > > Problems: > > 1) MemcachedKeyCharacterError: Control characters not allowed > 2) MemcachedKeyLengthError: Key length is > 250 > > The obvious solution is not to generate keys with these

memcached - Errors and Solution - please provide comments!

2011-11-10 Thread ionic drive
Hello django friends, Problems: 1) MemcachedKeyCharacterError: Control characters not allowed 2) MemcachedKeyLengthError: Key length is > 250 We where conflicted with problem number one, but the solution should also work for the second error which did not happen on our system.