Austoscale vs Autostop

I’m looking for advice on deployment strategy for my specific scenario.

I have an app that has few users. But, it has high external data i/o requirements and peak usage times. In other words, I have high bandwidth usage for a very short time period by just a few users.

I’d like to use some auto scaling approach to increase the number of machines deployed in my peak window. Ideally, I could use a time based approach as we all access the app at about the same time of day.

Aside from the time approach, would autostart/autostop capture this scenario? The docs imply it’s based on user load, so, I’m not sure it would trigger autostarting machines with few users. Or, should I look at autoscale with metrics?

Thanks for any advice you can offer.

I believe you have to create your own metrics scaling: Autoscale based on metrics · Fly Docs
The autostop/start config only scales based on requests/connections (correct me if I’m wrong)

Thank you @khuezy .

I feel like I need someone way smarter than me to help figure this out. Do you or anyone else know if this code will work for autoscaling? I basically want to deploy one machine for every 2 concurrent connections.

app = "my-autoscaler"

[build]
image = "flyio/fly-autoscaler:0.3"

[env]
FAS_PROMETHEUS_ADDRESS = "https://api.fly.io/prometheus/my-org"
FAS_PROMETHEUS_METRIC_NAME = "fly_app_concurrency"
FAS_PROMETHEUS_QUERY = "sum(fly_app_concurrency{app='$APP_NAME'})"

FAS_APP_NAME = "my-target-app"
FAS_CREATED_MACHINE_COUNT = "max(1, concurrency / 2)"  # Ensure at least 1 machine is always running

[metrics]
port = 9090
path = "/metrics"

If you want to basic autoscaling based on connections: App configuration (fly.toml) · Fly Docs

But that isn’t the most optimized. If you want to autoscale based off bandwidth, you’ll have to look up the prometheus docs on the correct metrics, eg sum(rate(container_network_receive_bytes_total[5m])) by (instance)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.