Here is the documentation of when autostart should occur:
Fly Proxy determines when to start a Machine as follows:
- The proxy waits for a request to your app.
- If all the running Machines are above their
soft_limit
setting, then the proxy starts a stopped or suspended Machine in the nearest region (if there are any stopped or suspended Machines).- The proxy routes the request to the newly started Machine.
I have an app where I set soft_limit = 10_000, primary_region = "ord"
, but I also have machines configured in several other regions. Looking at grafana, the app concurrency has not gone above 20 in the last 24 hours for any machine, but I see that machines are currently running in 4 regions.
Based on the documentation above, I would only expect a machine to be running in the primary region: when a request comes in from any edge, the proxy should check “all the running Machines” (that is, the one machine in the primary region), see that it is not “above [its] soft_limit
setting”, evaluate false
, and not “start a stopped […] Machine in the nearest region”.
I wonder if the documentation should instead read, “if all the running machines in the nearest region are above their soft_limit
”. With that text, I would expect the proxy to check only machines in the nearest region, see that they are all stopped, and start one. This behavior seems like exactly what one would want for running apps close to users.