PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, November 12, 2022

[FIXED] What Does Memcached's LRU Actually Mean?

 November 12, 2022     lru, memcached     No comments   

Issue

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.


Solution

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.



Answered By - Jon Skeet
Answer Checked By - Timothy Miller (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing