Question

I have an application for which I‌ want to set up a master/slave mysql database, because the current db struggles under high load.

I have two different servers for db replication. Lets call them A and B. A is the current db server.

Let's score the CPU power of A as 10 and B as 7. B has half the memory of A. Both servers run on SSD.

The read/write ratio is about 9 to 1.

Now, my question is which server should be master? and why?

Was it helpful?

Solution

In general (until very recent versions), it is better to make the Slave the beefier machine.

Originally, you could easily run queries in parallel on the Master, but they would be run purely sequentially on the Slave. If the system is busy enough, the Slave could get behind. Later versions have changed to RBR and added some parallelism on the Slave.

Also, if the Slave is getting 9 times as many queries (assuming of similar length), then it would be good to have a beefier Slave for that reason.

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