-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add docs for fly-autoscaler #1583
Conversation
@benbjohnson Made some smaller fixes from the original draft but left comments for you about bigger changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All your suggestions look good to me. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benbjohnson
Final final review!
- `FAS_CREATED_MACHINE_COUNT`: An [Expr](https://expr-lang.org/) expression to calculate the number of Machines to create or destroy. | ||
- `FAS_STARTED_MACHINE_COUNT`: An [Expr](https://expr-lang.org/) expression to calculate the number of Machines to stop or start. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that there are still some MIN
and MAX
versions of FAS_CREATED_MACHINE_COUNT
and FAS_STARTED_MACHINE_COUNT
. Do we include these in the reference or do we just use the Expr expression to calculate these values internally?
- `FAS_PROMETHEUS_QUERY`: The Prometheus query to run. | ||
|
||
|
||
### Temporal collector |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see a FAS_TEMPORAL_QUERY
variable, but it's not in the Fresh Produce or this doc? What is it and should we include it?
- `FAS_CREATED_MACHINE_COUNT`: An [Expr](https://expr-lang.org/) expression to calculate the number of Machines to create or destroy. | ||
- `FAS_STARTED_MACHINE_COUNT`: An [Expr](https://expr-lang.org/) expression to calculate the number of Machines to stop or start. | ||
|
||
### Prometheus collector |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see a FAS_PROMETHEUS_TOKEN
variable too. What is it and should we include it?
|
||
The metrics-based autoscaler scales an app's Machines based on any metric, such as pending work items or queue depth. Scaling on metrics other than requests or connections is useful for apps, like background workers, that aren't running web services. Apps with services that need to scale based on HTTP requests can use the built-in Fly Proxy [autostop/autostart feature](https://fly.io/docs/apps/autostart-stop/) for Machines. | ||
|
||
The autoscaler works by collecting metrics from different sources, such as Prometheus or Temporal, and computing the number of required Machines based on those metrics. This reconciliation process happens on a loop every 15 seconds by default. We use the [Expr language](https://expr-lang.org/) for defining target Machine counts, which gives a rich set of built-in arithmetic functions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we say how you can change the reconciliation interval in the yml config? Can you use a combination of yaml config and env variables?
@benbjohnson I'm going to publish as-is, since it's fairly complete, and we can revisit my questions when there's time. |
Summary of changes
Add docs for fly-autoscaler, the metrics-based autoscaler app.
Preview
Related Fly.io community and GitHub links
Notes