Home » Questions » Computers [ Ask a new question ]

Is there such a thing as a persistent ram drive?

Is there such a thing as a persistent ram drive?

I have a laptop with a LAMP setup. The HDD is slow, which causes my unit tests to run slowly.

Asked by: Guest | Views: 261
Total answers/comments: 4
Guest [Entry]

"You could write a simple rc script that does that. I remember doing a similar thing back in DOS days (with autoexec.bat) for fast access to some files.

You might consider buying an SSD or RAM drives with HDD interface instead."
Guest [Entry]

If your app is small enough, you could grab a 30gb solid state drive for your machine. Benchmarks show them doing 3x or 4x faster reads than traditional drives (and something like 2.4x as quickly as 10k rpm drives). The bigger drives cost a bundle, but the 30 gig ones are just under $200.
Guest [Entry]

"Though this is not directly related to ram disks, this may help you get around your problem ..

What you can do is run two mysql servers with one of them being a primary that exists on the ramdisk and the other being a slave that saves all data to an HDD.

This way, if you need to start up the ramdisk-based mysql server after it has been turned off or whatever, you can just ..

cat mysqldump -uroot -hslaveServer dbName | mysql -uroot -hramdiskServer dbName"
Guest [Entry]

"The OS already does that for regular file system accesses (buffers the writes to RAM and then flushes them later). But to be more robust, many databases then do a fsync() to force the OS to flush the buffers to disk which slows things down.

Controlling whether MySQL does a sync operation is done at the level of the underlying DB. I looked at InnoDB and it does not allow you to disable fsync.

But searching around I found libeatmydata which can disable fsync for a process which should give you the behavior you are looking for."