Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is there temporary file system (or ramdisk) that behaves like redis/memcache?

so if there is not enough memory, i will dump to disk, when the computer restarted, it could read back from disk

share|improve this question
1  
No there is not. –  Ulrich Dangel Mar 16 '13 at 12:17

2 Answers 2

You may want to look at anything-sync-daemon, which attempts to do this by repeatedly syncing data between an in-memory filesystem and an on-disk filesystem.

share|improve this answer

Please look at tmpfs filesystem.enter link description here Tmpfs is a filesystem.It use ram and swap as block device. You can install your sql server into tmpfs filesystem.For example,you can move your table files of mysql into tmpfs,and then start mysql server.Your mysql will be faster,because the data is stored into ram rather than disk! Before you shutdown computer,you should cp the table files of mysql into your filesystem on real block device.Otherwise,you will lost all your data!

If you do not like this way,you should use redis to store file into redis and retrive file,but you must write more codes.I know some Chinese companies use redis to save and retrive little files.But they do not open the source code.

share|improve this answer
    
tmpfs is not persistent across reboots (in fact, it is specifically meant to not be persistent across reboots), so this fails to meet the OP's criteria as stated in the second paragraph ("when the computer restarted, it could read back from disk"). If you're going to be copying files back and forth, any in-RAM file system type will almost certainly do as well as any other. (And do note that you shouldn't blindly copy MySQL - or any database - files while the database is running; depending on the DBMS' error recovery capabilities, you risk serious data corruption or data loss.) –  Michael Kjörling Aug 19 '13 at 8:46
    
So you should copy the db files into persistent filesystem before shutdown system.If you do not like this option,you should use redis to store file into redis and retrive file,but you must write more codes. –  Edward Shen Aug 19 '13 at 8:51
1  
Of course,I do not copy db files at db running.Use tmpfs will accelerate the speed of io. I use tmpfs to accelerate my virtual machines. –  Edward Shen Aug 19 '13 at 8:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.