How best to deal with lots of small objects - currently failing?

dormando dormando at rydia.net
Thu Feb 21 07:52:37 UTC 2008


What's your cache eviction rate?

Do you get errors when set'ing new variables into the instance? Out of
memory, etc?

The big deal with memcached so far as exacerbating memory loss is when
you change the item profile over time. Extra slab pages are assigned out
of main ram as necessary. So if you initially assign 50% into some small
slabs, and 50% into some big slabs by usage, then become 90% small
slabs, your small slabs will be more likely to get evictions.

Also, I swear there's a bug somewhere. Which is why I asked the above
questions :)

Also, I second the stuff brian moon said.

-Dormando

Ben [skiddle.com] wrote:
> Hi
> 
>  
> 
> I need to cache a string (only about 120 bytes but requires lots of
> lookups to generate) – the string will always be small, and there will
> be up to 40,000 of them
> 
>  
> 
> I’m presuming that each memcached daemon only has a limited number of
> ‘slots’ for each size of data?? Is that correct?
> 
>  
> 
> At the moment I only have 1 large memcached daemon running (2.5Gb) – the
> problem I have is that after a while, even though the daemon is only
> using about 500mb out of its 2.5Gb allocation, these strings stop
> getting cached (ie its always a miss, I then cache it and next time i
> get a miss again – even with a long expiration time) – this is annoying
> as there is obviously enough memory available so I presume the problem
> must be the number stored rather than memory allocated?
> 
>  
> 
> I also need to store a range of other data, so would it be best to setup
> a memcached daemon that’s somehow (?) tuned for this size of string and
> push all request through to that, leaving another daemon for general use?
> 
>  
> 
> Thanks
> 
>  
> 
> *Ben Sebborn***
> 
>  
> 



More information about the memcached mailing list