eGCLB (eBPF in Go Customizable Load Balancer) is a flexible, high-performance load balancing framework built using eBPF (extended Berkley Packet Filter) and the ebpf library provided by the Cilium community. Designed for speed and configurability, eGCLB enables developers and operators to dynamically select between multiple load balancing algorithms at runtime without downtime or reloading the system.
-
Runtime Algorithm Selection: Swap between load balancing strategies (e.g., round robin, consistent hashing, etc.) on the fly.
-
Powered by eBPF: Kernel-space performance with minimal overhead.
-
Modular Design: Easily extend or plug in custom balancing strategies.
This project leverages the eBPF Library for Go. You can run the application in one of two ways:
- Using the
bpftoolCLI (usage may vary depending on the eBPF program type) - Building and running the Go binary with privileged permissions
Both methods require generating the eBPF object (.o) and Go (.go) files.
From the src directory, run:
cd src
go generateThese commands produce the required .o and .go files.
The application determines which load balancer logic to use based on the environment variable LOAD_BALANCER_TYPE.
Available values:
Sticky_RR_v1
If you prefer to use bpftool, attach the generated .o programs directly.
This approach bypasses the Go application entirely.
To run the Go executable, build and execute it from the src directory:
go build
sudo .-E /ebpf-go-lb <interface-name>-
Edge traffic routing
-
Performance-sensitive microservice mesh routing
-
Experimenting with new load balancing strategies in real-time
If you want to see similiar and interesting examples, please take a look at this repository.
