________ ________ ___ ________ ________
|\ __ \|\ __ \|\ \ |\ __ \|\ ____\
\ \ \|\ /\ \ \|\ \ \ \ \ \ \|\ \ \ \___|_
\ \ __ \ \ __ \ \ \ \ \ _ _\ \_____ \
\ \ \|\ \ \ \ \ \ \ \____ __\ \ \\ \\|____|\ \
\ \_______\ \__\ \__\ \_______\\__\ \__\\ _\ ____\_\ \
\|_______|\|__|\|__|\|_______\|__|\|__|\|__|\_________\
\|_________|
L7 Load Balancer Implemented in Rust 🦀
This project is part of Tilde 3.0 HSP PESU-ECC's summer mentoring program.
To build the application locally, ensure you have the Rust compiler and Cargo package manager installed. Once installed, clone the repository and build the application using Cargo:
git clone https://github.com/homebrew-ec-foss/bal.rs
cd bal.rs
cargo buildFor a production-ready build, you can use:
cargo build --releaseAfter building, the main executable will be located in /target/debug or /target/release based on the build command used.
Navigate to the directory and type
Balrs helpin the terminal to get a list of available commands.
Alternatively, from the root directory of Bal.rs, you can use:
cargo run helpfor the same result.
The config.yaml file allows you to customize the Load Balancer settings:
- Load Balancer address: The URL of the Load Balancer(Default: http://localhost:8000)
- Algorithm: The load balancing algorithm to be used by Balrs(Default: round robin)
- Servers: List of server URLs to which Balrs can send requests
- Weights: List of weights of respective servers, used by weighted load balancing algorithms
- Max connections: List of the maximum number of connections each server is allowed to handle
- Timeout: Maximum time allowed for a server to respond before it is marked as dead
- Health check interval: Time interval at which server health checks are performed