- Python
- Node js web server to show statistics
- Dynamic docker-compose file for adding replicas to web server
- nginx as a load balancer
The Makefile supports the following command:
Starts the service.
Options:
workers
: Specifies the number of workers.
Example:
make run workers=4 # Starts 4 web workers
Tests the load balancing by displaying the stats from the workers.
Options:
count
: The number of http requests to send.
Example:
make test count=100 # Sends 100 http requests and displays the stats
Modifies the Load balancer config file and reloads the config in the container
Options:
worker
: Worker ID whose weight needs to be modified.weight
: The new weight.
Example:
make modify worker=3 weight=100 # Sets server3 weight to 100
Builds the worker image
Example:
make build
Stops and removes the containers and intermediate files
Example:
make clean