Written in Go · Open Source

Custom
Load
Balancer

A production-ready HTTP/HTTPS load balancer with Round Robin, Weighted Round Robin, Health Checks, Sticky Sessions, TLS, and live JSON Metrics.

2
Algorithms
4
Shell Scripts
TLS
HTTPS Ready
/metrics
Live Metrics
⚠️

This is not a hosted service

This load balancer is a self-hosted Go application — there's nothing running here to visit. It's designed to sit in front of your own servers and route traffic between them.

To run it, clone the repo, configure your backends in configs.json, and start it with the provided shell script. Full instructions are in the README.

View Setup Instructions ↗
⚖️

Round Robin

Evenly distributes requests across all healthy backends in sequence.

🎯

Weighted Round Robin

Nginx-style smooth algorithm — route proportionally more traffic to stronger backends.

🩺

Health Checks

Background goroutine probes each backend. Auto marks UP/DOWN on failure or recovery.

🍪

Sticky Sessions

HttpOnly cookie pins a client to a backend, with configurable TTL and automatic expiry.

🔒

TLS / HTTPS

Drop-in TLS support. Point to your cert and key files and it just works.

📊

JSON Metrics

Live per-backend request counts, error rates, and average latency via /metrics.

bash
# Clone the repo
git clone https://github.com/nianod/Custom-Load-Balancer.git
cd Custom-Load-Balancer

# Edit configs.json with your backend URLs
nano configs.json

# Build and run
./scripts/run.sh

# Check all backends are healthy
./scripts/healthcheck.sh

# View live metrics
./scripts/metrics.sh http://localhost:8080