Question

On a MySQL cluster, does it make sense to store MySQL database files and binlogs in different partitions?

(This is about partitions on the same physical disk. If they were on different physical disks, the answer would be yes -- so to allow parallel reads and writes.)

One could think that by separating datadir and binlog dir on different partitions, if one gets filled up the other continues to have free space. But actually this doesn't matter as any of these two events would stop the replication or the MySQL server altogether. On the other hand, a single partition for datadir and binlogs would allow them to share the available free space and therefore give them more room for expansion.

For this reason it doesn't seem there's any particular drawback in sharing a partition, while there may be some advantages. Is there something else to take into consideration?

Was it helpful?

Solution

For splitting a single physical drive into two partitions, I see only the big downside (as you pointed out): You could run out of space on one partition, while having space left on the other. (Many times I have seen this.)

For multiple drives, I recommend striping as being better than manually segregating this file/log/table/etc from that file/etc. In many cases the actions are sequential (first scan the index, then reach into the data), making the manual split of no benefit. And striping avoids the "out of space, but not really" problem.

Let's approach your question from a different angle... Why give yourself more work (partition maintenance) when the benefit is questionable?

If you have one HDD and one SSD, then put the logs (sequential access) on the HDD and the data+indexes (random access) on SSD.

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top