Using HAProxy for load-balancing SQL Server 2008

淺唱寂寞╮ 提交于 2020-01-06 08:13:23

问题


Is it possible/feasible/reasonable to use HAProxy to load-balance three SQL Server 2008 database servers?

Here is our situation: we have two web servers that are load-balanced on Amazon EC2. We are currently using one production SQL Server 2008 DB server. That server is starting to get overloaded, so we would like to add two more DB servers, and implement a load-balancing solution.

In Amazon EC2, we are unable to use a Virtual IP address, which prevents us from being able to use Windows Network Load Balancing (NLB) or any other load-balancing method that requires a VIP.

Our application is read-heavy, but we are unable to separate reads from writes, so the load-balancing solution needs to account for this.

We are planning on using SQL Server's built-in replication feature to keep all three DB's current (we understand that there will be some lag time, but that is acceptable).

Any thoughts or suggestions are welcome, and thanks in advance for your help.


回答1:


Yes this is feasible. I've tried it in labs and it works well.

If you have a large enough farm of web servers you can make the session sticky by IP hashing which will solve the replication latency problem. The load won't be as evenly spread but the load probably won't be that even anyway given connection pooling (presume you are using .NET)

and if you use merge as your replication topology the solution should - in principle - scale well and be resilient enough that you can take individual servers down for maintenance so long as you are able to handle the odd dropped connection at application level.




回答2:


I'd be worried about how the write transactions make it to all of the SQL servers on the back end. You could try something like peer-to-peer replication, but that's a non-trivial setup.



来源:https://stackoverflow.com/questions/4922903/using-haproxy-for-load-balancing-sql-server-2008

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!