go-load-balancer

command module
v0.0.0-...-6b2d2b5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 10 Imported by: 0

README

Go Load Balancer

A highly efficient, custom-built load balancer implemented in Go, designed to evenly distribute incoming network traffic across multiple servers. This load balancer helps ensure high availability and optimal resource utilization, making it ideal for scalable and fault-tolerant applications.

Features

  • Round-robin and Least Connections balancing algorithms
  • Health Checks to ensure only available servers receive traffic
  • Dynamic Server Pool for easy addition and removal of servers
  • Error Logging and Monitoring capabilities
  • High Performance with minimal latency

Requirements

  • Go 1.16 or higher
  • Compatible with any backend server pool

Installation

Clone this repository and navigate to the project directory:

git clone https://github.com/SusheelSathyaraj/go-load-balancer.git
cd go-load-balancer

go mod tidy

Usage

  • Configure Backend Servers: Update config.yaml to specify the servers for load balancing.
  • Run the Load Balancer: Execute the following command to start the load balancer:
  go run *.go -> to run all the .go extension files at once
  • Access Logs and Monitoring: Check logs in the logs/ folder for detailed information on traffic distribution and health checks.

Configuration

Modify the config.yaml file to specify server details and health check intervals. Example:

servers:
  - address: http://server1.com
  - address: http://server2.com
healthCheckInterval: 10s
loadBalancingAlgorithm: round-robin and least connections

Load Balancing Algorithms

  • Round-robin: Distributes requests sequentially among servers.
  • Least Connections: Directs traffic to the server with the fewest active connections.

Contributing

Contributions are welcome! Please fork this repository and submit a pull request for any changes you’d like to make.

License

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

Contact

For any queries, please open an issue or reach out via email.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL