Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/aksh-bansal-dev/load-balancer

A simple layer 4 load balancer with consistent-hashing support.
https://github.com/aksh-bansal-dev/load-balancer

Last synced: 25 days ago
JSON representation

A simple layer 4 load balancer with consistent-hashing support.

Awesome Lists containing this project

README

        

# Load Balancer
A simple layer 4 load balancer with sticky-sessions support.

It uses hashing for sticky sessions.

## Config file
```
// config.json

{
"lbport": "8080", // load balancer port
"type": "sticky", // "sticky" for sticky sessions or "random" (default).
"ports": [
{
"ip": "127.0.0.1",
"port": "5000"
},
{
"ip": "127.0.0.1",
"port": "8000"
},
{
"ip": "127.0.0.1",
"port": "3000"
}
]
}

```

## How to use
- Create a config.json file from above template.
- `npm run start ` to start load balancer.
> Note: you can use demo.js to test the load balancer. Just run `npm run demo ` to start a server on that port.