On Tue, Apr 21, 2009 at 6:01 PM, tcbarrett <[email protected]> wrote:

>
> 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.


Always possible.


>
> 2. The size of the hash value is bigger than 'limit_maxbytes'


Actually, the largest a single item may be is about 1Mb (the size of the
largest "bucket"), not limit_maxbytes, which is 1.5G in your case. If your
items are larger, you can change the largest bucket limit (only by changing
the source code and rebuilding, look in slabs.c).


>
> 3. Something else is using up the memory, silently destroying my
> cache.


Unlikely.


> Or have I left something unconsidered?


4. You're running with a non-default flag that prevent memcached from
evicting
other items to insert the ones you want. I believe -M does that (sets
settings.evict_to_free=0).


>
> 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?
>



-- 
Anatoly Vorobey, [email protected]
http://avva.livejournal.com (Russian)
http://www.lovestwell.org (English)

Reply via email to