How to scale out haproxy node itself?

As i am having one application in which architecture is as per below,

users ----> Haproxy load balancer(TCP Connection) -> Application server 1
-> Application server 2
-> Application server 3
Now i am able to scale out and scale in application servers. But due to high no of TCP connections(around 10000 TCP connections), my haproxy load balancer node RAM gets full, so further not able to achieve more no of TCP connections afterwords. So need to add one more node for happroxy itself. So my question is how to scale out haproxy node itself or is there any other solution for the same?

As i am deploying application on AWS. Your solution is highly appreciated.


Any how much RAM is that? And you can’t upgrade to a bigger instance on AWS?

You should really optimize and tune your current environment, before you start trying to scale in other directions, as it is way more complicated to do so.

If you want Amazon services, there is ELB, but scaling on your own becomes difficult when you don’t control the network.

When you do, anycast and ECMP are killers features that will help you, but careful, there are a lot of pitfalls with those technologies. You need to have network experts on your team for this.

Cheaper and faster is DNS based load-balancing (rr, geo, ratio, etc …). Amazon and Dyn surely have something for you there, or DIY.

1 Like

Hi @lukastribus thanks for your support. As i can’t use AWS ELB because it does not support least_connection routing policy and i have to have that for TCP connections. I can’t depend upon high RAM AWS instance, if that node gets down then entire system gets affected. As suggested by you, i can use AWS Route53 ratio policy but how to notify or change route53 configuration when any haproxy node gets added or removed by Auto Scaling group based on policy? because route53 must have idea about all nodes of Haproxy at any time.

I don’t know that, you would have to ask them.

But again, and I cannot stress this enough, tune and optimize your current setup first, before you try scaling horizontally.