When I had such problems, it was always one of cases (1) or (2). I've never seen another process stealing memory from memcached.
You can check: 1. Data size (if an object is > 1Mb, it won't be cached). 2. Key length (the limit is 250 characters). 3. Invalid characters in key (space is an invalid character, for example). 4. Expiration. 5. Try to get an object immediately after you set it. 6. Try working with memcached directly (via telnet) with the same data. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of tcbarrett Sent: Tuesday, April 21, 2009 6:01 PM To: memcached Subject: Re: Measuring Memory Usage So, in short, you are saying that none of my cache inserts are being evicted. Which means that at any point where I am inserting into the cache, there is memory available to do so. Does this mean that my problem is one of 3 things: 1. My code is no good, and I am not actually inserting into the cache for some reason. 2. The size of the hash value is bigger than 'limit_maxbytes' 3. Something else is using up the memory, silently destroying my cache. Or have I left something unconsidered? T On Apr 21, 8:21 am, "Olga Khenkin" <[email protected]> wrote: > No. > > ________________________________ > > From: [email protected] [mailto:[email protected]] On > Behalf Of Kevin Amerson > Sent: Monday, April 20, 2009 9:42 PM > To: [email protected] > Subject: Re: Measuring Memory Usage > > I was thinking that as well, but the evictions above are 0 - but the > bytes used / available seem to indicate items are being evicted; Are > evictions incremented if items are expiring? > > On Mon, Apr 20, 2009 at 10:43 AM, Olga Khenkin <[email protected]> > wrote: > > Hi, > > When memcached uses all allocated memory, it starts to delete old > objects, which may not be expired yet. It deletes the least recently > used object from the slab (bucket). These deletes are called > 'evictions'. > > You can see the number of evictions in memcached 'stats' command. You > can also use two other commands: 'stats slabs' and 'stats items', which > will give you usage info per bucket. > > Olga. > > -----Original Message----- > From: [email protected] [mailto:[email protected]] On > > Behalf Of tcbarrett > Sent: Monday, April 20, 2009 2:08 PM > To: memcached > Subject: Measuring Memory Usage > > Hi > > I searched the group for 'measuring memory usage' with no hits. > > I am trying to determine how much memory my cached data is using. I > have some large data blocks that are not caching properly[1]. I am > assuming that is due to there being a smaller numer of large 'buckets' > and I have used all mine up? > > I am in the process of breaking it down into more sensible chunks > (e.g. one data hash has 1000s of subkeys that I can make into cache > hits on their own). However I would ideally like to know how much > memory I am using as I have absolutely no idea if I am near the > saturation point of allocated memory or not. > > I feel a bit dumb as this seems to be either a) common problem and I > am incapable of finding the answer myself or b) a stupid problem that > nobody ever thought someone would get into. > > This is running on a linux box (a few flavours), using perl. > > [1] By this I mean that sometimes, after a period of time, the cache > retrieval is empty (before expiry). Basically I don't know why. Could > it be some other application eating the memory? Or is it other large > keys being set, pushing it out? Or am I using up all the allocated > memory?
