On Apr 22, 12:09 pm, Anatoly Vorobey <[email protected]> wrote:
> > 1. My code is no good, and I am not actually inserting into the cache
> > for some reason.
>
> Always possible.

I've done the horrible thing, made a wrapping class and logging every
get and set (I've got some stupid keys).

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

OK. So how do I measure whether this is happening? Does set() fail?
Can I measure how big my cache value is going to be before attempting
to set it?

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

I do hope and pray that you are correct. I have Apache and mod_perl
running, and the values from 'top' and 'free' are just all over the
place.

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

It was a standard installlation (memcached 1.2.6), and is a fairly
simple invocation like so:
/usr/local/bin/memcached -u nobody -d -m 1536 -l 127.0.0.1 -p 11211 -
P /tmp/memcached.pid

Running the code on a test machine, killing memcache and to re-
starting it, then pre-loading as much cache as I can think of at the
moment: looking at stats()->{total}->{bytes_written} ... I only appear
to be using ~100M.

I have absolutely no measuring stick and would be delighted beyond
words if this was true. Because if it is then I can't believe the
amount data I can keep in cache (if I can get it working). And I
should probably upgrade to a more recent version, but I don't think
this will change my current problem.

Reply via email to