Databases Reference
In-Depth Information
• Configure five RAID 1 mirrored pairs in the RAID controller, and let the operating
system address five volumes instead of one.
• Configure five RAID 1 mirrored pairs in the RAID controller, and then use software
RAID 0 to make the five volumes appear as one logical volume, effectively imple-
menting RAID 10 partially in hardware and partially in software.
Which option is best? It depends on how all the components in your system interact.
The configurations might perform identically, or they might not.
We've noticed serialization in various configurations. For example, the ext3 filesystem
has a single mutex per inode, so when InnoDB is configured with innodb_
flush_method=O_DIRECT (the usual configuration) there will be inode-level locking in the
filesystem. This makes it impossible to have concurrent I/O to the files, and the system
performs well below its theoretical ability.
In another case we saw, requests to each device were serialized with a 10-disk RAID 10
volume, the ReiserFS filesystem, and InnoDB with innodb_file_per_table enabled.
Switching to software RAID 0 on top of hardware RAID 1 gave five times more
throughput, because the storage system began to behave like five spindles instead of
one. This situation was caused by a bug that has since been fixed, but it's a good
illustration of the sort of thing that can happen.
Serialization can happen on any layer in the software or hardware stack. If you see this
problem occurring, you might need to change the filesystem, upgrade your kernel,
expose more devices to the operating system, or use a different mixture of software or
hardware RAID. You should check your device's concurrency and make sure it really
is doing concurrent I/O (more on this topic later in the chapter).
Finally, don't forget to benchmark when you set up a new server! This will help you
verify that you're getting the performance you expect. For example, if one hard drive
can do 200 random reads per second, a RAID 10 volume with eight hard drives should
do close to 1,600 random reads per second. If you're observing a much lower number,
such as 500 random reads per second, you should research the problem. Make sure
your benchmarks exercise the I/O subsystem in the same way MySQL will—for
example, use the O_DIRECT flag and test I/O performance to a single file if you're using
InnoDB without innodb_file_per_table enabled. We usually use sysbench for validat-
ing that new hardware is set up correctly.
RAID Configuration and Caching
You can usually configure the RAID controller itself by entering its setup utility during
the machine's boot sequence, or by running it from the command prompt. Although
most controllers offer a lot of options, the two we focus on are the chunk size for striped
arrays, and the on-controller cache (also known as the RAID cache ; we use the terms
interchangeably).
 
Search WWH ::




Custom Search