From 18e92032a443f453e7418894f0f5f5efb9768903 Mon Sep 17 00:00:00 2001 From: andie787 <4andie@gmail.com> Date: Fri, 16 Aug 2024 10:03:44 -0400 Subject: [PATCH] edits re autostop --- blueprints/autoscale-machines.html.md | 11 +++++++---- blueprints/autostart-internal-apps.html.md | 12 ++++++------ blueprints/resilient-apps-multiple-machines.html.md | 4 ++-- launch/autostop-autostart.html.markerb | 8 +++++--- reference/fly-proxy-autostop-autostart.html.markerb | 2 +- 5 files changed, 21 insertions(+), 16 deletions(-) diff --git a/blueprints/autoscale-machines.html.md b/blueprints/autoscale-machines.html.md index 7fe1842c2b..718a2b778e 100644 --- a/blueprints/autoscale-machines.html.md +++ b/blueprints/autoscale-machines.html.md @@ -13,13 +13,13 @@ Machines during the period of low traffic. This blueprint will guide you through the process of configuring the [`fly-autoscaler` app](/docs/launch/autoscale-by-metric/) in conjunction with [Fly Proxy autostop/autostart](/docs/launch/autostop-autostart/) to -always keep a fixed number of stopped Machines ready to be quickly started +always keep a fixed number of Machines ready to be quickly started by Fly Proxy. ## Configuring automatic start and stop First, we will configure the app to allow Fly Proxy to automatically start and -stop Machines based on traffic demand. The auto start and stop settings apply +stop or suspend Machines based on traffic demand. The auto start and stop settings apply per service, so you set them within the `[[services]]` or `[http_service]` sections of `fly.toml`: @@ -27,7 +27,7 @@ sections of `fly.toml`: ... [[services]] ... - auto_stop_machines = true + auto_stop_machines = "stop" auto_start_machines = true min_machines_running = 0 ... @@ -35,7 +35,10 @@ sections of `fly.toml`: With these settings Fly Proxy will start an additional Machine if all the running Machines are above their concurrency `soft_limit` and stop running -Machines when the traffic decreases. In the next section we will configure +Machines when the traffic decreases. You can set Machines to `"suspend"` rather than +`"stop"`, for even faster start-up, but with some [limitations on the type of Machine](https://community.fly.io/t/new-feature-in-preview-suspend-resume-for-machines/20672#current-limitations-and-caveats-8). + +In the next section we will configure and deploy `fly-autoscaler` to ensure that the app always has a spare stopped Machine for Fly Proxy to start. diff --git a/blueprints/autostart-internal-apps.html.md b/blueprints/autostart-internal-apps.html.md index 60fc92947c..60cf736bc8 100644 --- a/blueprints/autostart-internal-apps.html.md +++ b/blueprints/autostart-internal-apps.html.md @@ -8,7 +8,7 @@ You have a private, or internal, app that communicates only with other apps on y To use Fly Proxy autostop/autostart you need to configure services in `fly.toml`, like you would for a public app. But instead of using a public Anycast address, you assign a Flycast address to expose those services only on your private network. -This blueprint focuses on using autostart and autostop to control Machines based on incoming requests. But when you use Flycast for private apps you also get other Fly Proxy features like geographically aware load balancing. +This blueprint focuses on using autostop/autostart to control Machines based on incoming requests. But when you use Flycast for private apps you also get other [Fly Proxy features](/docs/reference/fly-proxy/) like geographically aware load balancing. Learn more about [Flycast](/docs/networking/flycast/). @@ -49,9 +49,9 @@ v6 fdaa:2:45b:0:1::11 private global Mar 16 2024 18:20 v4 66.241.124.11 public (shared) Jan 1 0001 00:00 ``` -This example app has public IPv4 and IPv6 addresses. These are the addresses automatically assigned to an app on first deploy. +This example app has public IPv4 and IPv6 addresses. These public addresses are automatically assigned to an app with services on the first deploy. -Copy the public IP addresses and run the `release` command to remove them from your app: +Copy the public IP addresses and run the `fly ips release` command to remove them from your app: ``` fly ips release ... @@ -82,7 +82,7 @@ Here's an example `fly.toml` snippet: # must be false - Flycast is http-only force_https = false # Fly Proxy stops Machines based on traffic - auto_stop_machines = true + auto_stop_machines = "stop" # Fly Proxy starts Machines based on traffic auto_start_machines = true # Number of Machines to keep running in primary region @@ -94,7 +94,7 @@ Here's an example `fly.toml` snippet: ```
-**Important:** Set `force_https = false` since Flycast only works over HTTP. HTTPS isn't necessary because all your private network traffic goes through encrypted WireGuard tunnels. +**Important:** Set `force_https = false`; Flycast only works over HTTP. HTTPS isn't necessary because all your private network traffic goes through encrypted WireGuard tunnels.
Learn more about [Fly Launch configuration](/docs/reference/configuration/) and [Fly Proxy autostop/autostart](/docs/launch/autostop-autostart/). @@ -107,7 +107,7 @@ To be reachable by Fly Proxy, an app needs to listen on `0.0.0.0` and bind to th Run `fly deploy` for the configuration changes to take effect. -Other apps in your organization can now reach your private app using the [Flycast](/docs/networking/flycast/) IP address or `.flycast`. +Other apps in your organization can now reach your private app using the [Flycast](/docs/networking/flycast/) IP address or the `.flycast` domain. ## Read more diff --git a/blueprints/resilient-apps-multiple-machines.html.md b/blueprints/resilient-apps-multiple-machines.html.md index 03a03b16e4..6389442ba0 100644 --- a/blueprints/resilient-apps-multiple-machines.html.md +++ b/blueprints/resilient-apps-multiple-machines.html.md @@ -26,13 +26,13 @@ If your app doesn't already have multiple Machines with autostop/autostart confi #### 1. Set up autostop/autostart -Use [Fly Proxy autostop/autostart](/docs/launch/autostop-autostart/#apps-that-shut-down-when-idle) to automatically stop and start Machines based on traffic. Keep one or more Machines running in your primary region if you want to. Example from `fly.toml` config: +Use [Fly Proxy autostop/autostart](/docs/launch/autostop-autostart/) to automatically stop and start Machines based on traffic. Keep one or more Machines running in your primary region if you want to. Example from `fly.toml` config: ```toml [http_service] internal_port = 8080 force_https = true - auto_stop_machines = true # Fly Proxy stops Machines based on traffic + auto_stop_machines = "stop" # Fly Proxy stops Machines based on traffic auto_start_machines = true # Fly Proxy starts Machines based on traffic min_machines_running = 0 # No. of Machines to keep running in primary region [http_service.concurrency] diff --git a/launch/autostop-autostart.html.markerb b/launch/autostop-autostart.html.markerb index 32e0908272..009e3f8c5d 100644 --- a/launch/autostop-autostart.html.markerb +++ b/launch/autostop-autostart.html.markerb @@ -21,9 +21,11 @@ The autostop/autostart settings are part of each service in an app's `fly.toml` Autostop/autostart settings: -* **`auto_stop_machines`:** The action, if any, that Fly Proxy should take when the app is idle for several minutes. Options are `"off"`, `"stop"`, or `"suspend"`. If `"off"`, Fly Proxy will never stop Machines. If `"stop"`, Fly Proxy stops Machines when the app has excess capacity. If `"suspend"`, Fly Proxy suspends Machines (if possible) when the app has excess capacity. Starting a Machine from a `suspended` state is faster than starting a Machine from a `stopped` state, but there are [some caveats](https://community.fly.io/t/autosuspend-is-here-machine-suspension-is-enabled-everywhere/20942) that you should know about. -* **`auto_start_machines`:** Whether Fly Proxy should automatically start Machines based on requests and capacity. -* **`min_machines_running`:** The minimum number of Machines to keep running in the primary region when `auto_stop_machines` is set to `"stop"` or `"suspend"`. +- **`auto_stop_machines`:** The action, if any, that Fly Proxy should take when the app is idle for several minutes. + - The options are `"off"` (equivalent to `false`), `"stop"` (equivalent to `true`), or `"suspend"`. + - If `"off"`, Fly Proxy will never stop Machines. If `"stop"`, Fly Proxy stops Machines when the app has excess capacity. If `"suspend"`, Fly Proxy suspends Machines (if possible) when the app has excess capacity. Starting a Machine from a `suspended` state is faster than starting a Machine from a `stopped` state, but there are [some caveats](https://community.fly.io/t/autosuspend-is-here-machine-suspension-is-enabled-everywhere/20942) that you should know about. +- **`auto_start_machines`:** Whether Fly Proxy should automatically start Machines based on requests and capacity. +- **`min_machines_running`:** The minimum number of Machines to keep running in the primary region when `auto_stop_machines` is set to `"stop"` or `"suspend"`. Example configuration: diff --git a/reference/fly-proxy-autostop-autostart.html.markerb b/reference/fly-proxy-autostop-autostart.html.markerb index e3a8df6113..a6bb66b958 100644 --- a/reference/fly-proxy-autostop-autostart.html.markerb +++ b/reference/fly-proxy-autostop-autostart.html.markerb @@ -10,7 +10,7 @@ nav: firecracker With Fly Proxy autostop/autostart, you can scale your app for peak loads and run those Machines only when needed to save on resource costs; you [don't pay for Machine CPU and RAM](/docs/about/pricing/#stopped-fly-machines) when they're in a `stopped` or `suspended` state. Fly Proxy automatically stops (or suspends) and starts existing Machines based on incoming requests to your app, and you have the option to keep a minimum number of machines running at all times in your primary region. -Autostop/autostart works for Fly Apps with a service configured in the `fly.toml` file, which generally covers publicly available apps that accept requests from the internet. But you can also use Fly Proxy autostart/autostart for private apps by setting up services and using a Flycast private IPv6 address. See [Flycast - Private Fly Proxy Services](/docs/networking/flycast/) and [Autostop/autostart private apps](/docs/blueprints/autostart-internal-apps/). +Autostop/autostart works for Fly Apps with a service configured in the `fly.toml` file, which generally covers publicly available apps that accept requests from the internet. But you can also use autostart/autostart for private apps by setting up services and using a Flycast private IPv6 address. See [Flycast - Private Fly Proxy Services](/docs/networking/flycast/) and [Autostop/autostart private apps](/docs/blueprints/autostart-internal-apps/). For apps that [shut down automatically when idle](/docs/launch/autostop-autostart/#apps-that-shut-down-when-idle) and don't need autostop, the Fly Proxy can still restart your app's Machines when there's traffic.