curr_items never decreases

Just Marc marc at corky.net
Thu May 18 15:56:30 UTC 2006


Hi
>> 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.
>
Correct, so how about making it half-sane by updating it whenever an 
expired item is accessed?





More information about the memcached mailing list