dump datas from memcached to database

Steven Grimm sgrimm at facebook.com
Thu Feb 15 01:52:17 UTC 2007

Basically you need to do the same thing that the "get" logic does, and 
I'd recommend following that code to see how it works -- the code 
explains itself more fully than I can. Briefly, though, there is a 
reference count on each item in the cache that gets incremented for each 
client that's currently requesting the item, and decremented when the 
item has been fully sent. An item won't be overwritten if its reference 
count is nonzero.

The reference count logic is a little bit different in the multithreaded 
version of the code, but the same basic principle holds (the major 
difference is that the MT version counts the item's inclusion in the 
item linked list as a reference; the "get" logic still adds/subtracts 
references as in the original code.)


Randy Wigginton wrote:
> I should have included disclaimers with the patch.  Its intended for 
> debugging.  My cache has about 20K entries and it does not lock up the 
> cache for any appreciable period.
> Steve, care to show me how to lock down the keys on their way out?

More information about the memcached mailing list