My question is simple. Is it possible to load balance rds (master and read-replicas) using the same haproxy instance used for application load balancing?
This would mean that the IP of the application and the IP of the database would be the same. What would be a sample configuration for the mysql part?
For example for application load balancing there is something like this:
backend php_app_servers balance roundrobin option redispatch option forwardfor option httpchk GET /url.php server php-app1 10.100.2.40:80 weight 16 maxconn 160 check inter 10s server php-app2 10.81.4.104:80 weight 16 maxconn 160 check inter 10s server php-app3 10.100.129.162:80 weight 16 maxconn 160 check inter 10s
What settings should i pay attention to for mysql.
Also another issue I had is rds is performing pretty poorly compared to usual opsworks instances. The problem might be caused by the difference of availability zone between application servers and db server but the performance drop doesn't seem justified. We have a LOT of databases on a m3.2xlarge server. CloudWatch metrics show only low to average CPU, IO and memory usage metrics. The number of connections is also between 40 and 60 at any moment. Can such a difference be caused by the availability zone?