There are alternatives to LRU, which is generally chosen for being extremely simple to implement, fast, and has a reasonable hit rate. The Greedy-Dual-Size-Frequency policy may be more appropriate for memcached as it accounts a value's weight. I doubt that there's a lot of value of changing the current design, but there are alternatives to approaches that would need to be considered if GC was a serious consideration.
________________________________ From: Jakub Łopuszański <jakub.lopuszan...@nasza-klasa.pl> To: memcached@googlegroups.com Sent: Fri, July 23, 2010 12:16:16 AM Subject: Re: Using PCIe SSDs instead of RAM On Fri, Jul 23, 2010 at 8:47 AM, dormando <dorma...@rydia.net> wrote: I tried. > >Try the engine branch? > > > I guess, I'll have to at some point. Just wanted to say, that LRU was designed as an algorithm for a uniform cost model, where all elements are almost equally important (have the same cost of miss) and the only thing that distinguishes them is the pattern of accesses. This is clearly not a good model for memcache, where: some elements are totally unimportant as they have already expired, some elements are larger than the others, some are always processed in batches (multigets), and so on. In my opinion GC moves the reality closer to the model, by removing unimportant elements, so if you want LRU to work correctly you should at least perform GC. You could also try to modify LRU to model that one large item actually occupies space that could be better utilies by several small elements (this is also a simple change). If you fill comfortable without GC, I am OK with that, just do not suggest, that GC is against LRU.