allen8807 / memcached

Automatically exported from code.google.com/p/memcached
0 stars 0 forks source link

memcached breakdown when the memory close to run up #242

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Start memcached with -L and max memory : /usr/local/memchached/bin/memcached 
-d -m 256 -p 11211 -u root -C -L  
2.set some same size items into one slab until the bytes is close to the 
limit_maxbytes.now,the memory run up and begin to LRU in this slab:

<?php
for($i=0;$i<3000000;$i++)
    $m->set('key'.microtime(true).rand(0,999),'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'.time());
?>

limit_maxbytes  :  268435456
bytes  :  253897218

(SLAB : 3)  
number 1765888
evicted 1231236

3.set one or two ... maybe three longer items into memcached:

$m->set('key'.microtime(true).rand(0,999),'aaaaaaaaa... 
....very_very_very_long....aaaaaaaaa'.time());

What is the expected output? What do you see instead?

I expected the items may be inserted successfully or memcached refuse the 
request.
But... the memcached is breakdown immediately.and the system log show:

Dec 23 11:24:32 bogon kernel: memcached[10354]: segfault at 0000000000000024 
rip 000000000040d5ba rsp 0000000041b64de0 error 4

What version of the product are you using? On what operating system?
centos 64bit/PHP538/memcached 1.4.10/pecl memcache and memcached client

Please provide any additional information below.
please help me!

Original issue reported on code.google.com by juns...@gmail.com on 23 Dec 2011 at 11:14

GoogleCodeExporter commented 9 years ago
Don't use -L if you can avoid it... it causes memory allocation to be a bit 
weird.

I'll see if we can reproduce this and convince it to stop segfaulting at least.

Original comment by dorma...@rydia.net on 29 Dec 2011 at 10:31

GoogleCodeExporter commented 9 years ago
the DONT_PREALLOC_SLABS define needs to be an option, which needs to be flipped 
to "on" by default if -L is specified.

Also, -L is deceptive. It tries to use the solaris method for grabbing 
hugepages, then falls back to a flat malloc without saying anything. So it 
should say something at least. As-is, -L is deceptive, nearly useless, and 
causes errors.

Going to punt on this for 1.4.12 though, as 1.4.11 is severely late. But I've 
researched the issue a bit and we'll get it soon.

Original comment by dorma...@rydia.net on 12 Jan 2012 at 5:11

GoogleCodeExporter commented 9 years ago
mark as accepted

Original comment by dorma...@rydia.net on 12 Jan 2012 at 5:11

GoogleCodeExporter commented 9 years ago
should be fixed in 1.4.14

Original comment by dorma...@rydia.net on 30 Jul 2012 at 9:21