The scale to zero feature is only available for new Postgres clusters that use the Development configuration. The one hour timeout is not configurable.
You might need to configure any apps that connect to your Postgres app to scale to zero as well, otherwise your Postgres database will never have zero connections and will never scale down. Your app might also need to be able to wait for the database to start back up. You can learn more about making apps exit when idle.
Turn off the scale to zero feature
The scale to zero feature is controlled by theFLY_SCALE_TO_ZERO environment variable.
To turn off scale to zero, you first need to get and save the fly.toml file locally, since the automated Postgres creation process doesn’t generate a fly.toml file in the working directory.
fly.toml file and remove the following line from the [env] section: