This stack demonstrates the use of orbiter to scale services up/down on a docker swarm. The stack consists of,
- orbiter - Swarm Service Scaler
- Docker HAProxy - Load Balancer
- Docker Hello World - Sample App
- Prometheus - Collect Metrics
- HAProxy Exporter - Provide HA Proxy metric endpoint
- AlertManager - Alert Processing
- Unsee - Alert Dashboard
- Grafana - Metric Dashboard
Clone this repository and run the stack:
git clone https://github.com/askulkarni2/swarm-autoscaling-demo.git
docker stack deploy -c docker-compose.yml orbiterDemo
./vegeta.sh
The sample load is generated by vegeta.sh
. The script exerts load on the HA proxy in increments of 25 requests per second upto 150 and the decrements the load in decrements of 25. The central assumption of this simulation test is that one task of the app
service can serve 25 requests with a 100% HTTP 200 response at an acceptable mean latency of ~ 4 ms. Given this we would expect that the number of tasks be as follows
RPS | Tasks |
---|---|
25 | 1(min) |
50 | 1 |
75 | 2 |
100 | 2 |
125 | 3 |
150 | 3 |
125 | 3 |
100 | 2 |
75 | 2 |
50 | 1 |
Without much tuning of the prometheus configuration the actual grafana plot for #desired vs #actual is as follows: