Apps v2 Autoscaling

Maybe I’ve missed it, but I see autoscaling documentation for v1 apps. How do I setup autoscaling for a v2 app? Or is this not available yet? If not available, is there an ETA?

Autoscaling in Apps V2 work a little differently. Machines will turn off by default, but will be started either when capacity is needed or when it’s closer geographically than other machines.

Therefore, to “autoscale” you provision X amount of machines depending on your needs. Think of this X amount as the upper limit of your autoscaling policy.

Hope I’ve explained this well enough.

1 Like

Hi @typytypytypy, on Apps V2, the Fly Proxy can start and stop Machines based on traffic and the service’s concurrency settings. This is only for Machines that have services defined in their configuration (e.g. a [[services]] or [http_service] block in fly.toml). More information on how this works and how to configure it on an app: Automatically Stop and Start Machines · Fly Docs

This is different from autoscaling, because it does not involve creating or destroying Machines. It’s also quite fast compared to V1 autoscaling. So as @simse said, you can create X Machines with, say, fly scale count, and that’s the upper limit to how many Machines can be running at once. You then get the Fly Proxy to wake them up and put them to sleep as needed.

When a Machine is stopped, we only charge for the space its rootfs takes up on disk, not its CPU or RAM provision. So the more time you keep it stopped, the cheaper each Machine is.

@catflydotio thank you! I appreciate you including the instructions for using fly scale count to set the maximum number of machines.

1 Like

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