Trying to 'dump' all data in memcache to disk

Sam Magister smagister at gmail.com
Tue Apr 24 01:17:49 UTC 2007


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