Jump to content

[SOLVED] MyISAM and InnoDB in RAM


Azu

Recommended Posts

Please tell me how to make it so that as soon as MySQL starts, all of my MyISAM and InnoDB tables are loaded into RAM so that after that they don't have to be read from disk (and any changes to them are made to the one in the RAM and also committed to disk)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.