Welcome! Log In Create A New Profile

Advanced

Issue 145 in memcached: Items are recycled to soon

Posted by Anonymous User 
Anonymous User
Issue 145 in memcached: Items are recycled to soon
June 30, 2010 06:04PM
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 145 by bjourne: Items are recycled to soon
http://code.google.com/p/memcached/issues/detail?id=145

This is the output of the stats command on my memcached (1.4.5) instance:

STAT pid 5285
STAT uptime 37314
STAT time 1277897901
STAT version 1.4.5
STAT pointer_size 32
STAT rusage_user 1.678744
STAT rusage_system 3.600452
STAT curr_connections 5
STAT total_connections 12310
STAT connection_structures 8
STAT cmd_get 46556
STAT cmd_set 19295
STAT cmd_flush 0
STAT get_hits 27460
STAT get_misses 19096
STAT delete_misses 24097
STAT delete_hits 1519
STAT incr_misses 0
STAT incr_hits 0
STAT decr_misses 0
STAT decr_hits 0
STAT cas_misses 0
STAT cas_hits 0
STAT cas_badval 0
STAT auth_cmds 0
STAT auth_errors 0
STAT bytes_read 14514515
STAT bytes_written 14230840
STAT limit_maxbytes 134217728
STAT accepting_conns 1
STAT listen_disabled_num 0
STAT threads 4
STAT conn_yields 0
STAT bytes 3631844
STAT curr_items 8783
STAT total_items 19295
STAT evictions 0
STAT reclaimed 8690

As can be seen, only 3631844 bytes of 134217728 are being used. Yet items
are being reclaimed quickly. All items stored are set with an expiry time
of 86400 (1 day) but are sometimes being reclaimed after only a few
minutes. Using the "stats cachedump" command I can verify that the
timestamps are set correctly and that the problem must be a bug in
memcached.
Anonymous User
Re: Issue 145 in memcached: Items are recycled to soon
June 30, 2010 08:40PM
Comment #1 on issue 145 by dorma...@rydia.net: Items are recycled to soon
http://code.google.com/p/memcached/issues/detail?id=145

Can you please provide a script that reproduces this? How are you testing
it exactly? How long are you seeing items cached for before they expire? We
need all versions of the involved software as well.
Anonymous User
Re: Issue 145 in memcached: Items are recycled to soon
July 14, 2010 04:10PM
Comment #2 on issue 145 by bjourne: Items are recycled to soon
http://code.google.com/p/memcached/issues/detail?id=145

Well, I wrote this little script to reproduce it:

from memcache import Client
from random import randint, sample
from string import letters
client = Client(['localhost:11211'])
for x in range(1000000):
key = ''.join(sample(letters, 20))
value = randint(1, 10000)
client.add(key, value, 2592000)

And annoyingly, that works fine and does not exhibit the problematic
behaviour. However when I run the live system as normally, in which items
are set and retrieved much more randomly, the above described problem still
occurs. It is a django web site. I don't know how to debug it further.
Anonymous User
Re: Issue 145 in memcached: Items are recycled to soon
October 16, 2010 09:30AM
Updates:
Status: Invalid

Comment #3 on issue 145 by dorma...@rydia.net: Items are recycled to soon
http://code.google.com/p/memcached/issues/detail?id=145

Er, uh, duh.

Stuff can only really get "reclaimed" early if your system clock is going
haywire. Which you say happens in production under more load.

This'll be fixed but is part of another bug, and sorta isn't much of a bug
I guess. Run ntpd or fix your kernel options
Sorry, only registered users may post in this forum.

Click here to login