Databases Reference
In-Depth Information
distribution from Oracle, there are still steps you can take to optimize your server for
flash storage. You should use innodb_file_per_table , and place the data directory on
your flash device. Then move the ibdata1 and log files, and all other log files (binary
logs, relay logs, etc.), to a RAID volume as discussed previously. This will concentrate
the random I/O workload on your flash device and move as many of the write-heavy,
sequentially written files off this device as possible, so you can save space on your flash
device and reduce wear.
In addition, for all versions of the server, you should ensure that hyperthreading is
enabled. It helps a lot when you use flash storage, because the disk is generally no longer
the bottleneck, and tasks become more CPU-bound instead of being I/O-bound.
Choosing Hardware for a Replica
Choosing hardware for a replica is generally similar to choosing hardware for a master,
though there are some differences. If you're planning to use a replica for failover, it
usually needs to be at least as powerful as the master. And regardless of whether the
replica is acting as a standby to replace the master, it must be powerful enough to
perform all the writes that occur on the master, with the extra handicap that it must
perform them serially. (There's more information about this in the next chapter.)
The main consideration for a replica's hardware is cost: do you need to spend as much
on your replica's hardware as you do on the master? Can you configure the replica
differently, so you can get more performance from it? Will the replica have a different
workload from the master, and potentially benefit from very different hardware?
It all depends. If the replica is a standby, you probably want the master and replica to
have the same hardware and configuration. But if you're using replication solely as a
cheap way to get more overall read capacity from your system, you can take a variety
of shortcuts on a replica. You might want to use a different storage engine on the replica,
for example, and some people use cheaper hardware or use RAID 0 instead of RAID 5
or RAID 10. You can also disable some consistency and durability guarantees to let the
replica do less work.
These measures can be cost-efficient on a large scale, but they might just make things
more complex on a small scale. In practice, most people seem to use one of two strate-
gies for replicas: they use identical hardware everywhere, or they buy new hardware
for the master and use the master's old hardware for a replica.
Using solid-state drives on a replica can make a lot of sense when the replica is having
a hard time keeping up with the master. The fast random I/O helps ease the single-
threaded replication thread's handicap.
 
Search WWH ::




Custom Search