tags:

views:

45

answers:

1

Memcached says it uses an LRU queue to do eviction (with a few rules based around slab sizes mixed in.) When they say least-recently-used, are they referring to least recently stored or least recently read? Their documentation seems ambiguous here.

+6  A: 

Everywhere I've seen the term used, LRU has referred to the last access (read or write) rather than the last store.

This article confirms it:

The LRU algorithm ensures that the object that is removed is one that is either no longer in active use or that was used so long ago that it’s data is potentially out of date or of little value.

It goes on to talk about items which are in "active use" - which to me strongly implies that it's access rather than storage... you wouldn't talk about something "actively being stored" unless you're halfway through actually writing it.

Jon Skeet
+1: Used = Read or Written
Ben S