curr_items never decreases

Steven Grimm sgrimm at facebook.com
Thu May 18 14:44:16 UTC 2006


Just Marc wrote:
> Definitely performance oriented but, if the counter exists and means 
> nothing, then there's no reason to keep it.

It means *something* -- it just doesn't mean exactly what you might 
think at first glance. I made heavy use of the curr_items stat while I 
was developing my memory efficiency improvements.

> There shouldn't be a significant performance penalty for keeping this 
> value properly up to date though...

Actually, yes there is. The problem is that it would require memcached 
to periodically scan for expired items (e.g. by keeping a time-ordered 
list of items and walking the list up to the present time.) It would be 
doing extra work that it's not doing now, which means more CPU usage. 
The way memcached works now, if an item is expired and nobody ever tries 
to fetch it, its presence causes no more  performance penalty than a 
non-expired item that falls off the end of the LRU list.

-Steve


More information about the memcached mailing list