Fix initial pg machine config for scaling to zero #3354
+4
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change Summary
What and Why:
I was kicking the tires on Fly Postgres and this caught my eye:
But, it didn't look like my single-instance cluster was ever actually scaling down to zero.
I found this post on community.fly.io that recommended editing the
fly.toml
to setauto_stop_machines = true
.Making the change to
fly.toml
and re-deploying worked for me, so I headed to Github to make this PR.How:
I looked at the changes in #2282 and believe that setting
Autostop
along withAutostart
should do the trick.I tried to look at the GraphQL schema to see if
Autostop
was a valid input, but it looks like theconfig
input is as far as the schema goes:I did not yet attempt writing an integration / "preflight" test (my Go is a bit rusty), but would happy to do so if desired.
Related to: