This add-on is operated by Sparkadvanced LLC
Lower your bill this month. Schedule fewer dynos when you don't need them.
FlightFormation Autoscale
Last updated December 02, 2024
Table of Contents
FlightFormation is an add-on for scaling Heroku dynos automatically on your schedule. FlightFormation is powerful yet uses a simple interface and requires no code changes to your application since we interface directly with the Heroku API.
Is FlightFormation right for you?
FlightFormation requires no code changes. You can use it right away.
FlightFormation fits best with applications that are:
- Running on Heroku (I guess that’s obvious?)
- Have “lumpy” traffic patterns (e.g. busy during the day, less busy at night)
- Would prefer higher performance during busy times and lower cost overall
Provisioning the add-on
Web Interface
FlightFormation can be provisioned via the Heroku addons marketplace here: FlightFormation
Command Line Interface (CLI)
FlightFormation can be attached to a Heroku application via the CLI:
$ heroku addons:create flightformation
-----> Adding flightformation to sharp-mountain-4005... done, v18 (free)
After you install FlightFormation, your application is ready to go! No changes to your application are needed.
Advanced Provisioning Options
More advanced provisioning options are available. Please refer to the Advanced Provisioning section of this article for more information.
Interface
The FlightFormation interface allows you to configure all your dyno scaling formations and scheduling.
You can access the interface via the CLI:
$ heroku addons:open flightformation
Opening flightformation for sharp-mountain-4005
or by visiting the Heroku Dashboard and selecting FlightFormation from the Add-ons menu.
Formations
FlightFormation uses dyno formations to automatically scale your application. This is the Heroku term for a set of dyno types and quantities that make up your application. We make it easy to create and manage these formations. A quick example of how easy it is to create a new formation: Read even more about scaling and formations here
Schedule
Creating a schedule is as simple as selecting a formation and setting the time and days you want it to run. Another examples, this time how to create a schedule for your Heroku application:
More documentation about using schedules to autoscale your application here
Advanced Provisioning Options
If you would like to provision FlightFormation with more control over the initial setup, you can pass additional parameters during provisioning. This can be useful if you are using a tool such as terraform to manage your infrastructure.
Timezone (timezone flag)
Set the timezone to use for your schedules, in the Olson tz format. FlightFormation will fuzzy search for the timezone if you provide a partial match.
Example: Setting timezone when provisioning
heroku addons:create flightformation --timezone="America/New_York"
Formations (formations flag)
Pass a JSON array of initial formations to create when the add-on is provisioned. Each formation should have a name and at least one process. Schedules can also be included in the formation object. See examples. These examples use JSON5 for easier reading, you can pass as JSON5 or regular old JSON if you want.
Example: Setting a simple formation when provisioning
heroku addons:create flightformation --timezone="America/New_York" \
--formations="[{name: 'my formation', processes: [{type: 'web', quantity: 1, size: 'Basic'}]}]"
A more complex example of what you could include in the formations
flag with scheduling is next (JSON5 only shown for easier reading, pass this like a string as shown above)
Example: Complex formations payload with schedules (not shown stringified for easier reading)
[
{
name: "Night Formation",
processes: [
{
type: "web",
quantity: 1,
size: "Standard-1X"
}
],
schedule: [
{
// days can be a list such as ["monday", "thursday"], or "all", "weekdays", or, "weekends"
days: "all",
type: "recurring", // "recurring" or "onetime"
time: "20:00", // use 24 hour time or "08:00 PM"
description: "Scale down at night" // optional
}
]
},
{
name: "Weekday Formation",
processes: [
{
type: "web",
quantity: 3,
size: "Standard-2X"
}
],
schedule: [
{
// days can be a list such as ["monday", "thursday"], or "all", "weekdays", or, "weekends"
days: "weekdays",
type: "recurring",
time: "08:00"
}
]
},
{
name: "Sale Formation",
processes: [
{
type: "web",
quantity: 5,
size: "Performance-M"
}
],
schedule: [
{
type: "onetime",
description: "Sale schedule", // optional description
start: "2025-01-01T09:00", // ISO 8601 date
end: "2025-01-01T17:00"
}
]
},
{
name: "Off/Maintenance Formation",
processes: [
{
type: "web",
quantity: 0,
size: "Basic"
}
]
}
]
Removing the add-on
You can remove FlightFormation via the CLI:
This will destroy all associated data and cannot be undone!
$ heroku addons:destroy flightformation
-----> Removing flightformation from sharp-mountain-4005... done, v20 (free)
More resources and documentation
- Documentation to quickly get going with FlightFormation
- QuickStart guide to get automatically scaling your application
- Overview of how FlightFormation autoscales your application
Support
All FlightFormation support and runtime issues should be submitted via one of the Heroku Support channels. Any non-support related issues or product feedback is welcome at contact@flightformation.com.