Schedule
Optimize Live observes new workloads for a set period of time before it is ready to create and automatically apply complete recommendations to it. During this learning period, Optimize Live generates preliminary recommendations based on the metrics collected so far.
You can choose to set the learning period shorter or longer according to your needs. For example, in test or sandbox environments, or for short-lived workloads, you might choose to reduce the learning period to 1 day. Preliminary recommendations can be applied on demand, but cannot be auto-deployed.
When the learning period is complete, Optimize Live generates complete recommendations on a schedule that you define (once daily by default). If auto-deploy is enabled, these recommendations are deployed automatically.
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 UTC
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 at all |
@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
Defines 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 observeration 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.
You can shorten the duration of this learning period, which is helpful for short-running workloads, branch-based deploys, or other ephemeral environments.
The shortest valid duration is one day (P1D
).
Recommendations generated after the learning period completes (referred to as complete recommendations) 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)