CPU-based routing with HAProxy agent-check on Amazon EC2

This note continues the previous one, where I set up HAProxy on an Amazon EC2 instance to route traffic to backend compute instances using Terraform. In that note, the algorithm was round-robin. HAProxy internally manages this as weighted round-robin, and since nothing was configured for the weights, traffic was split evenly across both instances. In … Continue reading CPU-based routing with HAProxy agent-check on Amazon EC2

Create an HAProxy load balancer with Amazon EC2 and Terraform

Load balancers route traffic to backend servers using algorithms such as round-robin, least-connections, or weighted routing based on server capacity. As of June 2026, AWS provides managed Application and Network Load Balancers, which abstract away routing logic so software engineering teams can focus on application development. However, engineering teams sometimes need full control over traffic … Continue reading Create an HAProxy load balancer with Amazon EC2 and Terraform