You have reached the blog of Keith Elder. Thank you for visiting! Feel free to click the twitter icon to the right and follow me on twitter.

Raid MySQL Tables

Posted by Keith Elder | Posted in Linux, Open Source, PC Software, Programming | Posted on 15-05-2004

The following was taken from Linux Magazine from an article written by Jeremy Zawodny. It talks about a litlte known feature of the MyISAM tables in MySQL which allows you to create raid tables. The snippet of the article is publised below.

RAID Tables The final variety of MyISAM tables isn’t widely known, but can be useful in some circumstances. RAID tables are simply MyISAM tables whose data (.MYD) files have been broken into multiple files. CREATE TABLE mytable … TYPE=MyISAM RAID_TYPE=STRIPED RAID_CHUNKS=4 RAID_CHUNKSIZE=8 Running that SQL command breaks the MyISAM table into 4 separate files (chunks) that are written to in a round-robin fashion in 8 KB stripes. Why do that? If you’re using a filesystem that places a limit on how large a file can be (2 GB or 4 GB), RAID tables work around that limitation. (However, file size limits are becoming more and more rare, as recent Linux kernels don’t have size limits anywhere near that low.) Performance is another reason for RAID tables. By putting each chunk on a separate physical disk, you can spread the I/O work out more evenly. In most MySQL installations, the main bottleneck is disk I/O, so this isn’t very far fetched. However, if you have the option of using hardware RAID or even software RAID at the OS level, you’re probably better off doing so.

Reference: LAMP Post, by Jeremy Zawodny