I have two memcached servers setup running with 1GB memory each. I've
maxed out the two servers memory-wise. Then, I go to each one and
issue a flush_all. Now, I then insert elements with an expiration
time of 24 hours. However, it seems like the inserts are not sticking
-- it seems as though memcached is still taking out even the new
elements when it does its evictions. I've checked 'stats' and see that
the eviction counts are increasing, but I didn't think that memcached
would throw away my fresh inserts _after_ the flush? Any ideas?
Thanks,
Ryan
Using memcached 1.2.5 on CentOS 4.6 (64 bit).
I've isolated the test case to be the following:
1) Start up memcached servers 1 and 2 with 1024MB each.
2) Fill up the memcached instances to the point of overflow/eviction
with different keys all pointing to the same value (a 300K string of
characters)
3) Attempt to add 1000 times different types of objects to the
memcached. It looks like 1/4 of the items get stored into memcached,
but the others get evicted. How does the LRU/eviction work in this
case? I would have expected memcached to NOT evict the new items that
I'm inserting, but rather the older ones from step #2 above.
4) I issue a flush_all on both memcached servers.
5) I repeat step #3 above and I am still seeing the same behavior
where my newly inserted items are getting evicted.
Now, here's the VERY VERY strange part:
If I repeat step #2 above but use the same or event different keys, no
evictions occur! I can insert 1000 new entries using the same 300K
string, and none of the newly inserted items gets evicted. Why would
memcache behave in this way? I didn't think it treated any of the
existing values in a "special" way when executing the LRU algorithm?
As you can imagine, I'm a little lost here. Can anyone shed any light?
Thanks,
Ryan
Ryan