My web application ruby on rails is getting more and more throughput. With New Relic, i got Apdex score < 0.7
My app is running on my Debian server(ex: ip pulic is 123.235.23.16) with Nginx and THIN. The codes and database mysql is all in this server.
My app has 3 app instances which are created by THIN (0.0.0.0:3000, 0.0.0.0:3001, 0.0.0.0:3002). And In Nginx http config, i use Load balancing methods:
upstream myapp1 {
server 127.0.0.1:3000;
server 127.0.0.1:3001;
server 127.0.0.1:3002;
}
server {
listen 80;
...
location / {
proxy_pass http://myapp1;
}
...
}
I want to know if I add another Debian server (ex: ip pulic is 123.235.23.17) to help the first server to hundle throughputs, Which server should be configured as nginx load balaancing server ? How to hundle mysql database io with two different servers and different app instances ? mysql remote ?