No description
Find a file
2025-03-03 14:38:32 +05:30
cmd vgo-balancer 2025-03-03 13:53:48 +05:30
pkg vgo-balancer 2025-03-03 13:53:48 +05:30
tools updated benchmarking tool 2025-03-03 14:38:32 +05:30
.gitignore updated benchmarking tool 2025-03-03 14:38:32 +05:30
config.yaml vgo-balancer 2025-03-03 13:53:48 +05:30
docker-compose.yaml vgo-balancer 2025-03-03 13:53:48 +05:30
Dockerfile vgo-balancer 2025-03-03 13:53:48 +05:30
go.mod vgo-balancer 2025-03-03 13:53:48 +05:30
go.sum vgo-balancer 2025-03-03 13:53:48 +05:30
LICENSE added MIT LICENSE 2025-03-03 13:59:36 +05:30
README.md updated benchmarking tool 2025-03-03 14:38:32 +05:30

vgo-balancer

vgo-balancer is a Go-based load balancing solution designed to distribute network or application traffic across multiple servers efficiently. By using vgo-balancer, you can enhance the availability and reliability of your services, ensuring optimal performance and fault tolerance.

Features

  • Efficient Load Distribution: Balances incoming traffic across multiple servers to prevent overload on a single server.
  • High Availability: Ensures continuous service availability by redirecting traffic from failed or overloaded servers to healthy ones.

Installation

To install vgo-balancer, ensure you have Go installed on your system. Then, run:

go get -u github.com/rvarunrathod/vgo-balancer

Usage

  1. Clone the Repository:

    git clone https://github.com/rvarunrathod/vgo-balancer.git
    cd vgo-balancer
    
  2. Configuration:

    • Modify the config.yaml file to define your backend servers and load balancing preferences.
  3. Build and Run:

    • To build the application:

      go build -o vgo-balancer cmd/main.go
      
    • To run the application:

      ./vgo-balancer
      

Configuration

The config.yaml file allows you to specify:

  • Backend Servers: List of servers to distribute traffic to.
  • Load Balancing Algorithm: Choose from available algorithms like round-robin, weighted-round-robin, ip-hash, least-response-time.
  • Health Check Parameters: Define health check intervals and failure thresholds to monitor server health.

Docker Compose

If you have docker running in your local you can test there.

This command will build docker images for you,

docker compose build

And Run below command to run load balancer and servers

docker compose up

Benchmarking

A benchmarking script is included in the tools/benchmark directory. Run it with:

cd tools/benchmark && go run main.go -url http://localhost:8080 -c 10 -n 1000 -d 10s

Available flags:

  • -url: Target URL (default: "http://localhost:8080")
  • -c: Number of concurrent requests (default: 10)
  • -n: Total number of requests (default: 1000)
  • -d: Duration of the test (e.g., "30s", "5m")

Contributing

We welcome contributions! Please fork the repository and submit a pull request with your enhancements or bug fixes.

License

This project is licensed under the MIT License. See the LICENSE file for details.