(First of all, my English is not very good, please)
As we know, memcached provides lazy expiration, and "replaces" LRU data in its slabs, however I'm not very clear how it does this. For example, if a slab is full, but some data in this slab are expired, what will happen when data are added to the slab?
- Does memcached find some expired data and replace them with the added data, or
- does it replace the LRU data, or
- does it do something else?
As far as I know, the lazy expiration is such that memcached is not actively removing expired data from each slab, but instead only removing expired entries when the key of the expired entry is referenced. This is a waste of resources, isn't it?