> On Sat, Dec 12, 2009 at 10:18 PM, pub crawler <pubcraw...@gmail.com> wrote:
>> Steve,
>>
>> Thanks for the explanation on persistent cache and why expiration is
>> not a feature in memcachedb - for today.
>>
>> I fully understand the overhead issues in purging items in memcachedb
>> due to the database backend. Have you tried doing expiration with
>> memcachedb yet in your development? What sort of performance hit
>> have you seen? Imagine the IO issues would go down considerably with
>> SSDs and other memory based storage devices. We are going to attempt
>> to run memcachedb on some cheap memory based devices we have -
>> currently only 8GB of SATA storage.
>
> Expiration has not be implemented yet. It is only a planned feature of
> new version.
>
>>
>> Can you give me a simple example of how people are purging data from
>> memcachedb today? Or do you see it as a place to store data and late
>> update the data - thus always keeping the key entries and just
>> adjusting the values?
>>
> There are two way you can do,
> 1. Update your cache directly in your application, I mean when the
> source of data changes, change your cache too. (usually mysql trigger
> or double write in your application).
A variation of this is to parse through the binlogs, or even just write a log in your app..
run_sql(DELETE from sourcetable WHERE id='key1')
write_log_line(delete|memcache-01|key1)
This lets you have a "gentle" process that just goes looking for data to clean up. Unfortunately if the source keys are lost, then rget is the only way to cleanup orphaned keys.
> 2. Use extensive command rget to traversal the db in a non-block way.
> Compare the timestamp of your item, delete it if it expires. rget now
> only a patched libmemcached support it. See:
> http://memcachedb.googlecode.com/svn/clients/libmemcached-0.25-patch/
>
At one point I had to move about 12 million items from a memcachedb instance into tokyo tyrant using rget. It was *painfully* slow because of the slow random access on the source machine's slow SATA RAID1.