4 Feb 2026

High Performance - Load Balancer in C++

This project is a Layer 7 (Application Layer) load balancer that functions as a reverse proxy for HTTP/S traffic. It distributes incoming requests across a pool of backend servers using various balancing algorithms.

We'll try to implement the following functionalities for our load balancer:

1. Core Load Balancing:

This section will focus on core logic of load balancing strategies: a. Round robin strategy b. Least connection strategy

a. Round Robin Strategy:

b. Least Connection Strategy:

LLD Implementation:

strategy Pattern:

IRouteStrategy -> [RoundRobinStrategy, LeastConnectionStrategy]

Strategy Pattern


2. Metrics & Logging:

We need to implement this without touching the core logic and structure of our Load Balancer

LLD Implementation:

Decorator Pattern:

Decorator Pattern


3. Background Health Checks:

Employs multi-threaded, asynchronous health checks (healthChecker.cpp) to continuously monitor backend servers. Automatically removes unhealthy servers from the rotation and re-adds them upon recovery.


4. Dynamic Setup: TOML Config:


5. Hot Reloading:


You can check out the code on github: LoadBalancer-CPP

Made with 2026