Skip to content

Commit

Permalink
Update machine restart policy docs
Browse files Browse the repository at this point in the history
Add extra details to `on-fail` restart policy documentation:
- clarify that the `max_restart` value is configurable, with a default 10
- add detail that the max number of restarts is evaluated within a fixed 5-minute window
  • Loading branch information
wjordan authored Jan 17, 2025
1 parent d27e4d5 commit f509bcb
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The restart policies are:

- **`always`**: Always restart a Machine automatically and never let it enter a `stopped` state, even when the main process exits cleanly. `always` is the default when you create a Machine with `fly m run` and for Fly Postgres app Machines. Recommended for "always-on" apps with no services configured, since the Machine restarts regardless of the exit code.

- **`on-fail`** (or **`on-failure`** for the Machines API and when viewed in the Machine config): Try up to 10 times to automatically restart the Machine if it exits with a non-zero exit code, before letting it stop. Recommended for most Machines with services configured, since Fly Proxy can wake them on request. `on-fail` lets Machines be restarted if they crash, and allows your app Machines to effectively scale down by exiting cleanly. `on-fail` is the default when there's no explicit restart policy in a Machine's config, such as Machines created by `fly launch` and `fly deploy`. Machines with a schedule also default to the `on-fail` restart policy.
- **`on-fail`** (or **`on-failure`** for the Machines API and when viewed in the Machine config): Try up to `max_restart` (default 10) times within a 5-minute window to automatically restart the Machine if it exits with a non-zero exit code, before letting it stop. Recommended for most Machines with services configured, since Fly Proxy can wake them on request. `on-fail` lets Machines be restarted if they crash, and allows your app Machines to effectively scale down by exiting cleanly. `on-fail` is the default when there's no explicit restart policy in a Machine's config, such as Machines created by `fly launch` and `fly deploy`. Machines with a schedule also default to the `on-fail` restart policy.

## Check a Machine's restart policy

Expand Down

0 comments on commit f509bcb

Please sign in to comment.