Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Here is my problem. I have a busy Drupal site struggling under high load. After applying all caches I see that, no surprisingly, database is the bottleneck. I have two servers to handle the site: A and B, on the same rack/subnet. The server A is frontend web server and is set to handles all database queries to the server B. Currently there is no detabase set up on A. The database on B is MariaDB 10. CPU-wise, The server A is much less powerful than B, but has the same amount of RAM. The load on server A is very low (< 0.5) The load on server B is not low (> 5)

So my questions are:

-Are there any benefit in defining master/slave database on these two servers?

-If is good idea to go master/slave route, how do you arrange the servers? (which server should be the master? Which one should be the frontend?)

share|improve this question
1  
Did you already analyze the cause of the slowness on the DB? Is it I/O, CPU, slow queries?. Also what kind of tuning did you do on the DB? –  ghm1014 May 30 '13 at 22:06
    
Well there are plenty of expensive queries which produce +2500qps. I did optimize database and indexed it as much as I could throughout the time and I don't think I can get more of a single database. So wondering why not blend in the computational power of server A to handle some queries. –  alfish May 30 '13 at 22:16
    
What about duplicate the Apache in B and have MySQL master/master on both servers. Then a load balancer in front of the Apaches –  ghm1014 May 30 '13 at 22:21
    
I'm open to all arrangements that may give the best performance. As for master/master, not sure how it could be better in my scenario when two servers specs are not the same. –  alfish May 30 '13 at 22:31

1 Answer 1

It should have benefit by setting up slave database on server A. Server A has a lower loading and it would has less network overhead from the frontend to the slave database.

Server B should be used as the master database as it has more resource/power. However, Server B could be serve as a slave database with the same instance as well. By defining both server A and B as slaves, loading from select queries can be shared between server A and B.

Reference on setting up multiple slaves, https://drupal.org/node/310071

share|improve this answer
    
Which server should be the front-end in this arrangment? Thanks –  alfish May 31 '13 at 14:31
    
Server A because Drupal's also consume CPU power. –  neo Jun 2 '13 at 16:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.