This project is a simple Load Balancer composed by:
- HaProxy
- FastAPI
- Docker
- K6 (to run load tests)
This project builds up a Load Balancer (HaProxy) and HTTP APIs.
The HaProxy has up to 9 APIs.
The docker-compose file that will set up the LB and 5 APIs (by default).
A file (scripts/instance_commands.sh) which is meant to start/stop each application individually.
- Docker 20.18.10+
- Docker-compose 1.27.4+
- Ubuntu
The following command will install K6:
$ sudo ./setup.sh
And if you want to install the Python dependencies related to this project, simply run:
$ sudo ./setup.sh dev
To run a new service instance, simply run the following command where X is the service id (between 1 and 9):
$ sh scripts/instance_commands.sh start X
To run a new service instance, simply run the following command where X is the service id:
$ sh scripts/instance_commands.sh stop X
$ k6 run dsd.js