Schedule
Optimize Live observes new workloads for a set period of time, or learning period and generates recommendations at the interval defined by the schedule.
During a workload’s learning period, the recommmendations are considered preliminary and can only be viewed or applied manually. When the learning period is complete, recommendations can be deployed automatically if auto-deploy is enabled.
For more details and examples showing how these settings are related, see Learning period, schedule, and preliminary recommendations in the Concepts topic.
Recommendation settings:
Schedule
The schedule on which Optimize Live generates new recommendations for a workload.
Annotation | Default value |
---|---|
live.stormforge.io/schedule |
"@daily" |
Description
Recommendations are generated automatically for workloads on a schedule, defined by a schedule string.
The schedule also affects every recommendation’s TTL, or time-to-live. The TTL is how long the recommended values are considered valid for. After a recommendation’s TTL expires, the recommended values are replaced by new values from an updated recommendation.
The shortest valid recommendation schedule is once an hour.
Duration expressions
Valid ISO 8601 Duration strings can be specified.
Examples
PT1H
– Once an hourP1D
– Once a dayP7D
– Once a week
Cron expressions
Cron strings can be used to designate schedules with more specific requirements, such as day-of-week. Cron expressions should specify five fields. For day-of-week, friendly terms such as WED
or THU
are acceptable in place of numbers. Optimize Live recognizes the special value H
in a field to mean “hash” this value, and use a deterministic, but functionally random value for that field.
Cron times must always be specified in UTC.
Examples
H H * * THU
– Once every Thursday0 30 * * SAT,MON
– 12:30am each Saturday and each Monday UTCH H(0-2) * * *
– Every day between 12:00am and 2:59am UTCH H(7-9) * * SATL
- Between 7:00am and 9:59am UTC on the last Saturday of the month
Schedule macros
Macros are shorthand that can be used as syntactic sugar for common schedules. The available macros are described below and compared with their duration and cron equivalents.
Macro | Duration | Cron | Description |
---|---|---|---|
@never |
P0D |
N/A | Do not generate recommendations automatically |
@hourly |
PT1H |
H * * * * |
Once every hour |
@daily |
P1D |
H H * * * |
Once every day |
@weekly |
P7D |
H H * * H |
Once every week |
@midnight |
N/A | H H(0-2) * * * |
Every day between 12:00am and 2:59am UTC |
Key points
- Each workload can have one and only one schedule string defined for it, of either a duration, cron expression, or schedule macro.
- Exact times are not guaranteed for recommendation generation. For exact cron strings, recommendations are generated within an hour of the time specified.
- To avoid concentrated pod churn when new recommendations are applied, use schedules that spread optimization over a period of time. The
H
capability in cron expressions or using non-specific durations can both help achieve an appropriate scheduling distribution.
Learning period
Acts as an automation gate, defining how long Optimize Live observes a new workload before providing recommendations that can be auto-deployed.
Annotation | Default value |
---|---|
live.stormforge.io/learning-period |
"P7D" |
Description
During this observation or learning period, Optimize Live generates preliminary recommendations based on the metrics it has collected. Preliminary recommendations are not auto-deployed, but they can be applied on demand.
If you want to automatically deploy recommendations sooner-for example, for short-running workloads, branch-based deploys, or other ephemeral environments-you can shorten the learning period. Otherwise, it typically isn’t necessary to change this value.
The shortest valid duration is one day (P1D
).
Recommendations generated after the learning period is complete are deployed automatically if auto-deploy is enabled.
Duration expressions
Only valid ISO 8601 Duration strings can be specified.
Examples
- “
P1D
” – One day (minimum value) - “
P3D
” – Three days - “
P7D
” – One week (default)