Trying to 'dump' all data in memcache to disk

马程钟 chengzhong at staff.sina.com.cn
Tue Apr 24 02:54:42 UTC 2007


We use BerkeleyDB to sync Ram data to disk, and my data is even larger(more than 100 million items) & changed frequently.
You can try to edit assoc.c to scan all the items.If your data can be mergered, this way would be very effective.

Happy Labors' Day!

----- Original Message ----- 
From: "Sam Magister" <smagister at gmail.com>
To: <memcached at lists.danga.com>
Sent: Tuesday, April 24, 2007 9:17 AM
Subject: Trying to 'dump' all data in memcache to disk


> Hi all,
> 
> I'm running memcached v1.2.1 with the python API v 1.34. I'm keeping  
> a rather large number of key/object pairs in memcache (about 2  
> million) which take up about 2GB of space in RAM. It takes a long  
> time to load all the objects from a database. To expedite this, I  
> would like to load it once for the database and then transfer what's  
> in RAM to disk so I can load back into memcache in case of a crash.
> 
> So basically I'm looking for a way to dump the entire memcache to a  
> file and then load it back up again.
> 
> I found somthing to that effect here, but it seems like it actually  
> can't be done presently.
> http://lists.danga.com/pipermail/memcached/2007-April/003905.html
> 
> If anyone can tell me for sure it can't be done, that would be useful  
> so I can stop looking.
> 
> What I'm considering doing is grabbing all the objects key by key,  
> then appending them to a list in python, pickling that list and then  
> saving it to disk. Loading them would work the other way around.
> 
> But if it's possible to do this without python that would be very  
> convenient.
> 
> Thanks in advance,
> 
> Sam


More information about the memcached mailing list