Memory capacity overflow of memcached

262 views
Skip to first unread message

yashushi

unread,
Oct 18, 2010, 4:45:22 AM10/18/10
to memcached
Hi,

My team try to use memcached to provide PHP caching recently but we
find out there is a memory overflow problem.

Here is the steps we have tested.
(1)Create memcached with the max. memory is 4MB .
(2)Add 900KB data from web to memcached 3 times.
(3)Add 700KB data from web to memcached.
(4)Add 500KB data from web to memcached.
(5)Add 300KB data from web to memcached.
(6)The new data still can transfer to memcached when new data size is
greater than memcached remaining space size.

We use "stats" to check "bytes" and it shows the memory size is over
4MB.
Could you help to clarify what is going on?
Thank you.

Regards,
Yashushi

dormando

unread,
Oct 18, 2010, 4:50:54 AM10/18/10
to memcached

The lowest the memory limit can go is about 48M. It ignores anything
lower.

-Dormando

yashushi

unread,
Oct 20, 2010, 3:12:05 AM10/20/10
to memcached
Hi Dormando,

We have tried the setting with 48MB and 64MB, but the same problem
still comes out.
Please kindly help to clarify.
Thank you.

-Yashushi

dormando

unread,
Oct 20, 2010, 3:23:48 AM10/20/10
to memcached
Uhh, try 128MB? or higher?

Are you adjusting the slab factor size? The minimum amount of memory
memcached uses is 1MB * the number of slab classes + some misc stuff (the
hash table, buffers, etc). 48M should be enough tho...

Just in case; if you're asking if you set the memory limit to 128M, and
you store 256M of data, what happens? That should work, and you should see
'evictions' increasing in the 'stats' output. As it'll eject the oldest
data to make room for newer data. You can start it with -M I think if you
want to have it get pissed off once it's full.

Reply all
Reply to author
Forward
0 new messages