MySQL Forums
Forum List  »  Router & Proxy

Re: Want to know more about the load-balancing
Posted by: Jan Kneschke
Date: July 08, 2007 04:00AM

Let's say we have:

2x [ app ] -> 1x [ proxy ] -> 2x [ mysqld ]

* 2 application-servers with a local proxy
* 1 proxy as load balancers
* 2 mysqld servers we want to load balance across

This the most basic setup for the proxy as load balancers.

As there is only one load-balancer, it is a SPOF (Single Point of Failure).

2x [ app ] -> 2x [ proxy ] -> 2x [ mysqld ]

Adding a second proxy solves the problem. But it open the question how to does the app access the second proxy in case the first one fails:

1) VRRP and move the virtual IP to the new server
2) if the app uses JDBC let it fail-over itself (if proxy1 is not reachable, it picks proxy2)
3) put a proxy next to the application and let it detect that the LB-proxies are down and failover

2x [ app -> proxy ] -> 2x [ proxy ] -> 2x [ mysqld ]

This way the app can stay unchanged and just connects to a local proxy. It will know which of the proxies is up by tracking the connect() calls for success or failure and send the requests to the proxy which is up.

$ mysql-proxy \
--proxy-backend-addresses=10.0.0.2:3306 \
--proxy-backend-addresses=10.0.0.3:3306

The proxy is tracking the availability of its backends for the normal load balancing. If one of the backends is unavailable, it is take out of the rotation for a while and check back again later. This is transparent to the clients.

Using VRRP saves to setup the proxies on the app servers and means less latency as only one proxy has to be passed.

Jan

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Want to know more about the load-balancing
3497
July 08, 2007 04:00AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.