Skip to content

Keep the app machine running instead of suspending when idle - #148

Closed
fredrik wants to merge 1 commit into
mainfrom
keep-app-machine-running
Closed

fredrik wants to merge 1 commit into
mainfrom
keep-app-machine-running

Conversation

@fredrik

@fredrik fredrik commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Sets min_machines_running = 1 in fly.toml, and updates the comments and docs that said the machine suspends.

Why. With it at zero, every wake is a fresh CPU reservation on a shared host. On a full host the proxy retries that reservation forever, which took the site down on 2026-10-29, and the cloned replacement then needed eight attempts to resume at 07:54. Fly's Prometheus metrics for the preceding 48 hours:

Running 555 of 2,880 minutes, 19%
Wake-ups 56, about 1.2 per hour, around the clock
Typical session 9 minutes; 14 to 16 on the sync hour

The wakes are the hourly sync and the uptime probe, not readers. Suspend was saving about $2.60 a month on a shared-cpu-1x and costing 56 reservation rolls every two days. Holding the reservation removes both failure modes and changes nothing else about the one-machine design.

The src/db.rs reconnect stays, since Fly can still stop or migrate the machine; the docs now say that instead of "the machine suspends". Companion to #147, which documents the outage.

🤖 Generated with Claude Code

With min_machines_running = 0 every wake was a fresh CPU reservation on a
shared host, and on a full host the proxy retries that reservation forever,
which is how the site went down on 2026-10-29 and how the cloned machine
then needed eight attempts to resume. Fly metrics for the previous 48 hours
show the machine idle 81% of the time but woken 56 times, by the hourly
sync and the uptime probe rather than by anyone reading, so suspend was
saving about $2.60 a month in exchange for 56 chances to lose that roll.
Holding the reservation removes both failure modes.

The reconnect-on-dead-socket path in src/db.rs stays, since Fly can still
stop or migrate the machine, and the docs now say so rather than "the
machine suspends".

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

🧹 PR preview destroyed

The preview app and its volume were removed when this PR closed.

@fredrik

fredrik commented Oct 29, 2026

Copy link
Copy Markdown
Owner Author

Closing: keeping suspend-when-idle as is.

@fredrik fredrik closed this Oct 29, 2026
@fredrik
fredrik deleted the keep-app-machine-running branch October 29, 2026 08:05

This branch was successfully deployed

1 active deployment
pr-148 — 364500f4 Deployed Oct 29, 2026 by fredrik via Deploy preview #350
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant