https://github.com/codegasms/sisyphus
Tiny load balancer in Go
https://github.com/codegasms/sisyphus
go hacktoberfest load-balancer load-testing
Last synced: about 1 year ago
JSON representation
Tiny load balancer in Go
- Host: GitHub
- URL: https://github.com/codegasms/sisyphus
- Owner: codegasms
- License: mit
- Created: 2024-10-01T17:49:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-02T21:42:06.000Z (over 1 year ago)
- Last Synced: 2025-02-01T09:44:22.611Z (over 1 year ago)
- Topics: go, hacktoberfest, load-balancer, load-testing
- Language: Go
- Homepage:
- Size: 7.76 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sisyphus
A tiny load balancer in Go.
## Instructions
```console
# Build sisyphus, summit and zeus
$ make
# Format the entire project
$ make fmt
# Clean the built binaries
$ make clean
# Start sisyphus
$ PORT=8000 ./bin/sisyphus
# Start summit
$ PORT=3000 ./bin/summit
# Test using curl
$ curl localhost:8000/health
# Auto load-testing using zeus. Provide the address of the load-balancer (sisyphus).
$ HOST='localhost:8000' ./bin/zeus
```
## Load Balancer Configuration
```json
# Add a config.json file in /data directory with the following content structure:
{
"servers": [":", ":", ...],
"weights": [, , ...],
"strategy": ""
}
```
> Note that \ are placeholders. Replace them with the actual values.
```json
# Example config.json file:
{
"servers": ["127.0.0.1:3000", "127.0.0.1:3001", "127.0.0.1:3002", "127.0.0.1:3003"],
"weights": [1, 2, 3, 4],
"strategy": "round-robin"
}
```