Scale to zero timer setting

Hi, in the documentation it says:

When auto_stop_machines = true in your fly.toml, the proxy looks at Machines running in a single region and uses the concurrency soft_limit setting for each Machine to determine if there’s excess capacity. If the proxy decides there’s excess capacity, it stops exactly one Machine. The proxy repeats this process every few minutes, stopping only one Machine per region, if needed, each time

So there is now way to control how long a machine should have zero incoming connections before it scales down?
I would love to set a timer setting, ex 5 minutes from last connection before it gets killed.

I know in most other situations you probably want to scale down as fast as possible to save money, but in my situation I am running a service that receives a file (few seconds short connection). Then it does some processing/conversions on the file and uploads it elsewhere… But the processing can perhaps take up to 5 minutes in worst cases. So I don’t want the machine to be scaled down to zero during the first 5 minutes from the last incoming connection.

Is there a way to have a scale down timer setting?

You can set the setting to false and simply shut down the machine from your code when you’re done.

I have a similar use case with machines doing audio encodings. In Node I simply do:

process.exit();
2 Likes

Okay new day, fresh mind!

So I wasn’t able to follow your advice @pier, although a smart solution, because I’m running a sftp server(sftpgo). I was able to configure the sftpgo to run the upload hook synchronously, so the upload simply waits for the hooks to finish running, thus not terminating the connection until it’s finished.
So problem solved in another way.

But with that said, it wouldn’t hurt to have a timeout or cooldown setting for the auto scaling.
Perhaps this would be a feature request.

1 Like

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