Jump to content

[SOLVED] MyISAM and InnoDB in RAM


Azu

Recommended Posts

I want all of the data in my mysql database to be loaded into memory at startup.

 

This way once it starts up, everything is done in memory, and there is no disk I/O overhead.

 

I would like any changes made to be committed to disk once in a while though, in case of a power problem.

And also committed to disk at shutdown.

 

Is this possible? Any help would be very appreciate :D

You can create a RAM disk, copy your database files to it, and start MySQL.  It doesn't do much for writing it back to disk, however.  You can write a script+cron to occasionally back it up/before shutdown.

 

Alternatively, you can (and this is almost needlessly complex) have two tables, one on disk, one in RAM -- created from disk at startup -- do just SELECTs from the in-RAM database and writes to both.  If you're truly strapped for performance and have a database with heavy read traffic, that might help.  In this way, writes are always committed to disk.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.