This pull request implements autoscaling by creating & destroying Fly Machines. Previously, existing machines could be started or stopped but there was always a fixed pool to scale within. With this change, users can set a single threshold (created-machine-count) or a threshold range (min-created-machine-count & max-created-machine-count) to scale their machines by creating & destroying.
One limitation of this approach is that creation is performed by cloning an existing machine in the app so this scaler does not support scale to zero. You can still scale down your last machine by stopping it by using max-started-machine-count.
This pull request implements autoscaling by creating & destroying Fly Machines. Previously, existing machines could be started or stopped but there was always a fixed pool to scale within. With this change, users can set a single threshold (
created-machine-count
) or a threshold range (min-created-machine-count
&max-created-machine-count
) to scale their machines by creating & destroying.One limitation of this approach is that creation is performed by cloning an existing machine in the app so this scaler does not support scale to zero. You can still scale down your last machine by stopping it by using
max-started-machine-count
.Fixes https://github.com/superfly/fly-autoscaler/issues/18
Usage
To enable create/destroy scaling, you can set the related environment variables to an expression representing the desired number of machines:
or specify a range:
or you can specify these in your
fly-autoscaler.yml
file:or