https://github.com/bripkens/load-balancing-example
A load balancing example with Nginx, HAProxy and Node.js
https://github.com/bripkens/load-balancing-example
Last synced: 10 months ago
JSON representation
A load balancing example with Nginx, HAProxy and Node.js
- Host: GitHub
- URL: https://github.com/bripkens/load-balancing-example
- Owner: bripkens
- Created: 2014-12-05T12:51:50.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-12-06T06:00:28.000Z (over 11 years ago)
- Last Synced: 2025-06-16T03:41:53.209Z (about 1 year ago)
- Language: Shell
- Size: 117 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Load Balancing example
This project illustrates what a possible setup with HAProxy and Nginx could look
like. Requests are load balanced after they have been proxied by Nginx and are
then passed to one of two configured web servers, i.e. Node.js processes. To
illustrate the setup:
```
+--------------+ +--------------+
| | | |
| Nginx +----------> HAProxy |
| | | |
+--------------+ +-+----------+-+
| |
| |
+---------v--+ +v-----------+
| | | |
| Node | | Node |
| | | |
+------------+ +------------+
```
Each web server supports simple HTTP endpoints to change the health status of
the web servers. This health status is recognized by HAProxy. You can set
the web server health by using the `set-health` script
```
./set-health lb-app1 false
```
Application health can be inspected via `http://$DOCKER_IP:8001`. The
load balanced application itself is available via
`http://$DOCKER_IP:8000`. There is also an SSI test located at
`http://$DOCKER_IP:8000/userspace.html`.
## Limitations
- only one Nginx instance
- only one HAProxy instance
- web servers have to be registered manually, i.e. there is no service discovery