In truth, I took that verbatim from the Wiki page I pointed him to,
but it looks in items.c (
http://github.com/dustin/memcached/blob/master/items.c ) that it walks
the first 50 items in the LRU tail, and will reclaim the first expired
slab it finds, but doesn't do any more exhaustive searching beyond
that.

- Marc

On Thu, Mar 25, 2010 at 5:25 PM, Perry Krug <[email protected]> wrote:
> Can you explain how the memcache server knows which items are expired in
> order to evict them first?
> It was my understanding that memcache does not keep a list of keys (expired
> or otherwise) nor does it track expired keys.
> Thus, expired keys would not necessarily be the first to get evicted when
> space is needed.
> Am I incorrect?
> Thanks!
> On Thu, Mar 25, 2010 at 10:10 AM, Marc Bollinger <[email protected]>
> wrote:
>>
>> There's no actual 'housecleaning' per se, just lazy expiration and
>> eviction. If an item's expiration time is reached, the next time its
>> key is requested, the lookup fails. If the server is out of memory,
>> it'll evict expired items first, but if nothing's expired, will start
>> evicting things in a least-recently-used fashion. More info is on the
>> Google Code wiki:
>>
>>
>> http://code.google.com/p/memcached/wiki/FAQ#When_do_expired_cached_items_get_deleted_from_the_cache?
>>
>> - Marc
>>
>> On Thu, Mar 25, 2010 at 9:50 AM, Jens <[email protected]> wrote:
>> > Hi, memcached is really great and easy to start working with. Maybe i
>> > haven't fully understood your concept, but i don't understand how
>> > housekeeping is performed. As it is possible to set a memory limit, i
>> > assume that some kind of housekeeping which keeps the amount of
>> > entries under the memory limit must be performed at some point. Is
>> > this solely done on the basis to expire times? Is the expire time
>> > reset to retrieval? I there a details description of available
>> > anywhere?
>> >
>> > To unsubscribe from this group, send email to
>> > memcached+unsubscribegooglegroups.com or reply to this email with the words
>> > "REMOVE ME" as the subject.
>> >
>>
>> To unsubscribe from this group, send email to
>> memcached+unsubscribegooglegroups.com or reply to this email with the words
>> "REMOVE ME" as the subject.
>
> To unsubscribe from this group, send email to
> memcached+unsubscribegooglegroups.com or reply to this email with the words
> "REMOVE ME" as the subject.
>

To unsubscribe from this group, send email to 
memcached+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to