Postgres repeatedly going down despite little load

If you’re using a shared-cpu-1x single node cluster, the app automatically shuts down if there are no open connections in the last hour and usually starts up again if something tries to connect to it.

There’s a chance that there might be a setting in the machine running the postgres app that’s disabling autostart. A user noticed a similar issue, and made the postgres app start up on its own by running a machine update and setting the autostart flag to true → fly machines update <machine_id> --autostart=true --app <app_name>

Alternatively, you could try this fix and override the FLY_SCALE_TO_ZERO= secret so the app never scales to zero.