Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
The Windowing
field in a study specifies the windowing policy to be adopted to score the experiments of an optimization study.
The two available windowing strategies have different structures:
Trim windowing: trim the temporal interval of a trial, both from the start and the end of a specified temporal amount - this is the default strategy
Stability windowing: discard temporal intervals in which a given metric is not stable and selects the temporal interval in which a metric is maximized or minimized.
In case the windowing strategy is not specified, the entire time window is considered.
Optimization goals and constraints are defined using a YAML manifest with the following structure:
where:
objective
String
minimize
maximize
Yes
How Akamas should evaluate the goodness of a generated configuration: if it should consider good a configuration generated that maximizes function
, or a configuration that minimizes it.
function
Object
It should have a structure like the one described in Goal function
Yes
The specification of the function to be evaluated to assess the goodness of a configuration generated by Akamas. This function is a function of the metrics of the different Components of the System under test.
constraints
List of objects
It should have a structure like the one described in Goal constraints
No
A list of constraints on aggregated metrics of the Components of the System under test for which a generated configuration should not be considered valid.
The function
field of the Goal of a Study details the characteristics of the function Akamas should minimize or maximize to reach the desired performance objective.
The function
field has the following structure:
Where:
formula
String
See formula
Yes
The mathematical expression of what to minimize or maximize to reach the objective of the Study.
variables
Object
See below
No
The specification of additional variables present in the formula
.
The formula
field represents the mathematical expression of the performance objective for the Study and contains variables and operators with the following characteristics:
Valid operators are: +
-
*
/
^
sqrt(variable)
log(variable)
max(variable1, variable2)
min(variable1, variable2)
Valid variables are in the form:
<component_name>.<metric_name>, which correspond directly to metrics of Components of the System under test
<variable_name>, which should match variables specified in the variables
field
Each metric that is directly or indirectly part of the formula of the function of the Goal is aggregated by default by average; more specifically, Akamas computes the average of each metric within the time window specified by the windowing strategy of the Study.
The variables
field contains the specification of additional variables present in the formula, variables that can offer more flexibility with respect to directly specifying each metric of each Component in the formula
.
Notice: each subfield of variables specifies a variable with its characteristics, the name of the subfield is the name of the variable.
The variable subfield has the following structure:
metric
String
should match the name of a metric defined for the Components of the System under test
Yes
The name of the metric of the Components of the System under test that maps to the variable.
labels
A set of key-value pairs
No
A set of filters based on the values of the labels that are attached to the different data points of the metric
. One of these labels is componentName, which contains the name of the Component the metric refers to.
aggregation
String
MAX
MIN
AVG
No
AVG
The strategy through which data points of the metric
should be aggregated within the window produced by the application of the selected windowing strategy. By default, an average is taken.
It is possible to use the notation <component_name>.<metric_name> in the metric
field to automatically filter the metric’s data point by that component name is applied.
The constraints
field specifies constraints on the metrics of the components of the system under test that need to be satisfied for a configuration to be valid with respect to the defined goal.
Constraints always consider the average value of specified metrics within the time window specified by the windowing strategy of the Study.
Constrainst may be absolute or relative. Absolute constraints set a fixed limit that should not be overcome. Relative constraints set a percentage value (calculated from the baseline value after the baseline experiment runs). Then each constraint (absolute or relative) has a name and a formula. The formula has the same syntax as the goal formula so refer to "formula" section above.
The following example refers to a study whose goal is to optimize the throughput of a Java service (jpetstore), that is to maximize the throughput (measured as elements_per_second) while keeping errors (error_rate) and latency (avg_duration, max_duration) under control (absolute values):
The following example refers to a study whose goal is to optimize the memory consumption of Docker containers in a microservices application, that is to minimize the average memory consumption of Docker containers within the application of appId="app1" by observing memory limits, also normalizing by the maximum duration of a benchmark (container_benchmark_duration).
The MetricSelection
field in a study specifies the metrics of the system. Such selection has only the purpose to specify which metrics need to be tracked while running the study and does not affect the optimization.
In case this selection is not specified, all metrics are considered.
A metrics selection can either assume the value of all
to indicate that all the available metrics of the system of the study should be tracked, or can assume the value of a list of the names of metrics of the system that should be tracked prepended with the name of the component.
The following fragment is an example:
A windowing policy of type trim trims the temporal interval of a trial, both from the start and from the end of a specified temporal amount (e.g., 3 seconds).
The trim windowing has the following structure:
In case a windowing policy is not specified, the default windowing corresponding to trim[0s,0s]
is considered.
The following fragment shows a windowing strategy of type "trim" where the time window is specified to start 10s after the beginning of the trial and to end immediately before the end of the trial:
The ParameterSelection
field in a study specifies which parameters of the system should be tuned while running the optimization study.
In case this selection is not specified, all parameters are considered.
A parameter selection can either assume the value of all
to indicate that all the available parameters of the system of the study should be tuned, or can assume the value of a list with items of the shape like the one below:
Notice that, by default, every parameter specified in the parameters selection of a study is applied. This can be modified, by leveraging the options.
The following fragment is an example:
A windowing policy of type stability discards temporal intervals in which a given metric is not stable, and selects, among the remaining intervals, the ones in which another target metric is maximized or minimized. Stability windowing can be sample-based or time-frame based.
The stability windowing has the following structure:
and for the comparison metric section
The following fragment is an example of stability windowing (time-frame based):
type
string
{trim}
TRUE
the type of windowing strategy
trim
array of strings
The length of the array should be two.
Valid values should have the form of a whole number followed by either "s", "m", or "h"
TRUE
How to trim the temporal interval of a trial to get the window. ["0s", "10m"] means trim 0 seconds from the start of the interval, 10 minutes from the end. ["0s", "1h"] means trim 0 seconds from the start, 1 hour from the end
task
string
The name of a task of the workflow associated with the study
FALSE
If the field is specified, the trim offset calculation for the window will be applied from the start time of the assigned task. Otherwise, it will be calculated from the start time of the trial.
name
string
should match the following syntax:
component_name.parameter_name
where component_name
is an existing component, where parameter_name
is an existing parameter that is associated with the component-type of the component component_name
TRUE
The name of the parameter to be tuned including the name of the component it refers to
domain
array of numbers
should be of size 2, contain either all integers or real numbers(do not omit the "."), be set only if the parameter has a domain of type integer
or real,
and be compatible with the domain defined in the component-type the component_name
refers to
FALSE
A custom domain for the parameter to be used only for the study
categories
array of string
should be set only if the parameter has a domain of type categorical
, and be compatible with the domain defined in the component-type the component_name
refers to.
FALSE
A custom set of categories for the parameter to be used only for the study.
type
string
{stability}
TRUE
The type of windowing.
stability->metric
string
It should match the name of an existing metric monitored by AKAMAS
TRUE
The metric whose stability is going to be verified to exclude some temporal intervals over the duration of a trial.
stability->labels
set of key-value pairs
FALSE
A set of key-value pairs that represent filtering conditions for retrieving the value of the metric
. This conditions can be used to consider the right metric of the right component, you can in fact filter by componentName or by other custom properties defined in the components of the system of the study.
stability->resolution
string
Valid values are in the form 30s
40m
2h
where s
refers to seconds, m
to minutes, h
to hours
FALSE
0s
The temporal resolution at which Akamas aggregate data points to determine feasible windows.
stability->width
integer string
stability->width
> 1
Valid values are in the form 30s
40m
2h
as specified in stability->resolution
TRUE
The width of temporal intervals over the duration trial which are checked for the stability of the metric
.
Width can be sample-based (integer) or time frame-based (string).
stability->maxStdDev
double
TRUE
The stability condition, i.e, the maximum amount of standard deviation among the value of the data point of the metric tolerated for a temporal interval of size width
, otherwise, the temporal interval will be discarded
metric
string
It should match the name of an existing metric monitored by Akamas
TRUE
The metric whose value is analyzed to include or exclude temporal intervals over the duration of a trial, when another reference metric is stable.
labels
set of key-value pairs
FALSE
A set of key-value pairs that represent filtering conditions for retrieving the value of the metric
. This conditions can be used to consider the right metric of the right component, you can in fact filter by componentName or by other custom properties defined in the components of the system of the study.
is
string
{min,max}
TRUE
If the value of the metric should be maximum or minimum to include or exclude temporal intervals over the duration of a trial when another reference metric is stable.
The kpis
field in a study specifies which metrics should be considered as KPI for an offline optimization study.
In case this selection is not specified, all metrics mentioned in the goal and constraint of the optimization study are considered.
A KPI is defined as follows:
name
string
should match a component metric
no
<metric_name>
Label that will be used in the UI
formula
string
Must be defined as <component_name>.<metric_name>
yes
The metric name associated to a component
direction
string
minimize
, maximize
yes
The direction corresponding to the metric
aggregation
string
min
, max
, avg
, sum
, p95
, ...
no
avg
A valid metric aggregation
Notice that the textual badge displayed in the Akamas UI use "Best name
".
The following fragment is an example of a list of KPIs:
A baseline step performs an experiment (a baseline experiment) and marks it as the initial experiment of a study. The purpose of the step is to build a reference configuration that Akamas can use to measure the effectiveness of an optimization conducted towards a system.
When a bootstrap step imports an experiment from another study, the step copies not only the experiment but also its trials and the system metrics generated during its execution.
The bootstrap step has the following structure:
type
string
bootstrap
yes
The type of the step, in this case, bootstrap
name
string
yes
The name of the step
runOnFailure
boolean
true
false
no
false
The execution policy of the step:
false
prevents the step from running in case the previous step failed
true
allows the step to run even if the previous step failed
from
array of objects
Each object should have the structure described below
yes
The experiments to import in the current study
In case this is not set, this step imports every experiment of a study
where the from
field should have the following structure:
with:
study
contains the name or id of the study from which to import experiments
experiments
contains the numbers of the experiments from which to import
The following is an example of a bootstrap step that imports four experiments from two studies:
You can also import all the experiments of a study by omitting the experiments
field:
The Steps
field in a study specifies the sequence of steps executed while running the study. These steps are run in exactly the same order in which they will be executed.
The following types of steps are available:
Baseline: performs an experiment and sets it as a baseline for all the other ones
Bootstrap: imports experiments from other studies
Preset: performs an experiment with a specific configuration
Optimize: performs experiments and generates optimized configurations
Notice that the structure corresponding to the steps is different for the different types of steps.
Optimization studies are defined using a YAML manifest with the following structure:
with the following mandatory properties:
system
object reference
TRUE
The system the study refers to
name
string
TRUE
The name of the study
goal
object
TRUE
kpis
list
FALSE
numberOfTrials
integer
FALSE
1
The number of trials for each experiment - see below
trialAggregation
string
MAX
, MIN
, AVG
FALSE
AVG
The aggregation used to calculate the score across multiple trials - see below
parametersSelection
list
FALSE
all
metricsSelection
list
FALSE
all
workloadsSelection
object array
FALSE
windowing
string
FALSE
trim
workflow
object reference
TRUE
The workflow the study refers to
steps
list
TRUE
Some of these optional properties depend on whether the study is an offline or live optimization study.
It is possible to perform more than one trial per experiment in order to validate the score of a configuration under test, e.g. to take into account noisy environments.
The following fragment of the YAML definition of a study sets the number of trials to 3:
Notice: This is a global property of the study which can be overwritten for each step.
The trial aggregation policy defines how trial scores are aggregated to form experiment scores.
There are three different types of strategies to aggregate trial scores:
AVG: the score of an experiment is the average of the scores of its trials - this is the default
MIN: the score of an experiment is the minimum among the scores of its trials
MAX: the score of an experiment is the maximum among the scores of its trial
The following fragment of the YAML definition of a study sets the trial aggregation to MAX:
The following system refers to an offline optimization study for a system modeling an e-commerce service, where a windowing strategy is specified:
The following offline study refers to a tuning initiative for a Cassandra-based system (ID 2)
The following offline study is for tuning another Cassandra-based system (ID 3) by acting only on JVM and Linux parameters
A preset step performs a single experiment with a specific configuration. The purpose of this step is to help you quickly understand how good is a particular configuration.
A preset step offers two options when selecting the configuration of the experiment to be executed:
Use a configuration taken from an experiment of a study (can be the same study)
Use a custom configuration
The preset step has the following structure:
type
string
preset
yes
The type of the step, in this case, preset
name
string
yes
The name of the step
runOnFailure
boolean
true
false
no
false
The execution policy of the step:
false
prevents the step from running in case the previous step failed
true
allows the step to run even if the previous step failed
from
array of objects
Each object should have the structure described below
no
The study and the experiment from which to take the configuration of the experiment
The from
and experiments
fields are defined as an array, but it can only contain one element
This can be set only if values
is not set
values
object
The keys should match existing parameters
no
The configuration with which execute the experiment
This can be set only if from
is not set
doNotRenderParameters
string
this cannot be used when using a from option since no experiment is actually executed
no
renderParameters
string
this cannot be used when using a from option since no experiment is actually executed
no
where the from
field should have the following structure:
with
study
contains the name or id of the study from which to take the configuration. in case this is omitted, the same study of the step is considered for experiments from which taking configurations
experiments
contains the number of the experiment from which to take the configuration
You can provide a custom configuration by setting values
:
You can select a configuration taken from another study by setting from
:
You can select a configuration taken from the same study by setting from
but by omitting the study
field:
Notice: the from
and experiments
fields are defined as an array, but can only contain one element.
The renderParameters
and doNotRenderParameters
can be used to specify which configuration parameters should be rendered when doing experiments within a step.
Parameter rendering can be defined at the step level for baseline, preset, and optimize steps. This is not possible for bootstrap steps as bootstrapped experiments are not executed.
The following baseline step specifies that every parameter of the component 'os' should not be rendered while the parameter 'cpu_limit' of the component 'docker' should be rendered:
The following preset step specifies that the parameter 'cpu_limit' of the component 'docker' should be rendered:
The following optimize step specifies that every parameter of the component 'os' should not be rendered:
The workloadsSelection
is a structure used to define the metrics that are used by Akamas to model workloads as part of a live optimization study.
with the following fields:
Notice that, while the domain
can be used to specify the maximum and minimum values for a workload metric, it is not recommended to specify static workloads domains as Akamas can dynamically define them by using the observed minimum and maximum value of the metric.
Also notice that workload metrics must have been defined in the metricsSelection
.
The following refers to a workload represented by the metric transactions_throughput
of the konakart
component:
A baseline step performs an experiment (a baseline experiment) and marks it as the initial experiment of a study. The purpose of the step is to build a reference configuration that Akamas can use to measure the effectiveness of an optimization conducted towards a system.
A baseline step offers three options when it comes to selecting the configuration of the baseline experiment:
Use a configuration made with the default values of the parameters taken from the system of the study
Use a configuration taken from an experiment of another study
Use a custom configuration
The baseline step has the following structure:
where the from
field should have the following structure:
with
study
contains the name or id of the study from which to take the configuration
experiments
contains the number of the experiment from which to take the configuration
Default values for the baseline configuration only require setting the name
and type
fields:
The configuration taken from another study to be used as a baseline only requires setting the from
field:
Notice: the from
and experiments
fields are defined as an array, but can only contain one element.
The custom configuration for the baseline only requires setting the values
field:
An optimize step generates optimized configurations according to the defined optimization strategy. During this step, Akamas AI is used to generate such optimized configurations.
The optimize step has the following structure:
The optimizer
field allows selecting the desired optimizer:
AKAMAS
identifies the standard AI optimizer used by Akamas
SOBOL
identifies an optimizer that generates configurations using
RANDOM
identifies an optimization that generates configurations using random numbers
Notice that SOBOL and RANDOM optimizers do not perform initialization experiments, hence the field numberOfInitExperiments
is ignored.
For offline optimization studies, the optimizerOptions
field can be used to specify whether beta-warping optimization (a more sophisticated optimization that requires longer time) should be used for how many experiments (as a percentage):
where experimentsWithBeta
can be:
A percentage between 0 and 100%
A number less than or equal to numberOfExperiments
For live optimization studies, the optimizerOptions
field can be used to specify several important parameters governing the live optimization, which can be defined at the study level and also overridden at the step level (only for steps of type optimize):
The onlineMode
field specifies how the Akamas optimizer should operate:
RECOMMEND
: configurations are recommended to the user by Akamas and are only applied after having been approved (and possibly modified) by the user;
FULLY AUTONOMOUS MODE
: configurations are immediately applied by Akamas.
The safetyMode
field describes how the Akamas optimizer should evaluate the goal constraints on a candidate configuration for that configuration to be considered valid:
GLOBAL
: the constraints must be satisfied by the configuration under all observed workloads in the configuration history - this is the value taken in case onlineMode
is set to RECOMMEND
;
LOCAL
: the constraints are evaluated only under the workload selected according to the workload strategy - this should be used with onlineMode
set to FULLY_AUTONOMOUS
.
Notice that when setting the safetyMode
to LOCAL
, the recommended configuration is only expected to be good for the specific workload selected under the defined workload strategy, but it might violate constraints under another workload.
The workloadOptimizedForStrategy
field specifies the workload strategy that drives how Akamas leverages the workload information when looking for the next configuration:
MAXIMIN
: the optimizer looks for a configuration that maximizes the minimum improvements for all the already observed workloads;
MEDIAN
: for each workload, a median of all its values is considered - this works well to find a configuration that is good for the median of all the workloads;
MOST_VIOLATED
: for each workload, the workload of the configuration which results in most violations is considered.
The safetyFactor
field specifies how much the optimizer should stay on the safe side in evaluating a candidate configuration with respect to the goal constraints. A higher safety factor corresponds to a safer configuration, that is a configuration that is less likely to violate goal constraints.
Acceptable values are all the real values ranging between 0 and 1, with (safetyFactor
- 0.5) representing the allowed margin for staying within the defined constraint:
0 means "no safety", as with this value the optimizer totally ignores goal constraints violations;
0.5 means "safe, but no margin", as with this value the optimizer only tries configurations that do not violate the goal constraints, by remaining as close as possible to them;
1 means "super safe", as with this value the optimize only tries configurations that are very far from goal constraints.
For live optimization studies, 0.6 is the default value, while for offline optimization studies, the default value is 0.5.
The explorationFactor
field specifies how much the optimizer explores the (unknown) optimization space when looking for new configurations. For any parameter, this factor measures the delta between already tried values and the value of a new possible configuration. A higher exploration factor corresponds to a broader exploration of never tried before parameter values.
Acceptable values are all the real values ranging between 0 and 1, plus the special string FULL_EXPLORATION
:
0 means "no exploration", as with this value the optimizer chooses a value among the previously seen values for each parameter;
1 means "full exploration, except for categories", as with this value the optimizer for a non-categorical parameter any value among all its domain values can be chosen, while only values (categories) that have already been seen in previous configurations are chosen for a categorical parameter;
FULL_EXPLORATION
means "full exploration, including categories" as with this value the optimizer chooses any value among all its domain values, including categories, even if not already seen in previous configurations.
An optimize step is fault-tolerant and tries to relaunch experiments when they fail. Nevertheless, the step imposes a limit on the number of failed experiments: if too many experiments fail, then the entire step fails too. By default, at most 30 experiments can fail while Akamas is optimizing systems. An experiment is considered failed when it either failed to run (i.e., there is an error in the workflow) or violated some constraint.
An optimize step launches some initialization experiments (by default 10) that do not apply the AI optimizer and are used to find good configurations. By default, the step performs 10 initialization experiments.
Initialization experiments take into account bootstrapped experiments, experiments executed in preset steps, and baseline experiments.
The following fragment refers to an optimization study that runs 50 experiments using the SOBOL optimizer:
The following fragment refers to an optimization where 50% of the experiments need to use the beta-warping option, which enables a more sophisticated but longer optimization:
The goal and constraint description - see
The KPIs description - see
The list of parameters to be tuned - see
The list of metrics - see
The list of defined workloads - this only applies to live optimization studies - see
The windowing strategy - this only applies to offline optimization studies - see
The description of the steps - see
Parameters not to be rendered. - see
Parameters to be rendered. - see
Please notice that also the safetyFactor
option discussed in the context of live optimization studies can be applied to offline optimization studies.
Notice that while available as independent options, the optimizer options onlineMode
(described ), workloadOptimizedForStrategy
() and the safetyFactor
() works in conjunction according to the following schema:
All these optimizer options can be changed at any time, that is while the optimization study is running, to become immediately effective. The page in the reference guide provides these specific update commands.
LAST
: for each workload, the last observed workload is considered - this works well to find a configuration that is good for the last workloads - this is often used in conjunction with a LOCAL safety mode (see );
In case the desired explorationFactor
is 1 but there are some specific parameters that also need to be explored with respect to all its categories, then PRESET steps (refer to the page) can be used to run an optimization study with these values. For an example of a live optimization study where this approach is adopted see .
RECOMMEND
GLOBAL
MAXIMIN
FULLY_AUTONOMOUS
LOCAL
LAST
type
string
optimize
yes
The type of the step, in this case, optimize
name
string
yes
The name of the step
runOnFailure
boolean
true
false
no
false
The execution policy of the step:
false
prevents the step from running in case the previous step failed
true
allows the step to run even if the previous step failed
numberOfExperiments
integer
numberOfExperiments
> 0 and
numberOfExperiments
>= numberOfInitExperiments
yes
The number of experiments to execute - see below
numberOfTrials
integer
numberOfTrials
> 0
no
1
The number of trials to execute for each experiment
numberOfInitExperiments
integer
numberOfInitExperiments
< numberOfExperiments
no
10
The number of initialization experiment to execute - see below.
maxFailedExperiments
integer
maxFailedExperiments
> 1
no
30
The number of experiment failures (as either workflow errors or constraint violations) to accept before the step is marked as failed
optimizer
string
AKAMAS
SOBOL
RANDOM
no
AKAMAS
The type of optimizer to use to generate the configuration of the experiments - see below
optimizerOptions
object
see below
no
Some options for the AKAMAS
optimizer - see below
doNotRenderParameters
string
no
Parameters not to be rendered. - see Parameter rending
renderParameters
string
no
Parameters to be rendered. - see Parameter rending
renderParameters
Array of strings
should contain strings in the form component.parameter or component.
component. means every parameter of the component
No
Which configuration parameters should be rendered or applied when doing experiments/trials in addition to ones in the parameters selection or in the values if the step is of type baseline or preset
doNotRenderParameters
Array of strings
should contain strings in the form component.parameter or component.
component. means every parameter of the component
No
Which configuration parameters should not be rendered or applied when doing experiments/trials
name
string
should match the following syntax:
component_name.metric_name
where component_name
is an existing component, and metric_name
is an existing metric associated with the component-type of the component component_name
TRUE
The metric of the component that represents the workload
domain
array of numbers
should be of size 2, contain either all integers or real numbers (do not omit the "."), be set only if the metric has a domain of type integer
or real,
and be compatible with the domain defined in the component-type the component_name
refers to
FALSE
A custom domain for the metric to be used by the optimization study
type
string
baseline
yes
The type of the step, in this case, baseline
name
string
yes
The name of the step
runOnFailure
boolean
true
false
no
false
The execution policy of the step:
false
prevents the step from running in case the previous step failed
true
allows the step to run even if the previous step failed
from
array of objects
Each object should have the structure described below
no
The study and the experiment from which to take the configuration of the baseline experiment
The from
and experiments
fields are defined as an array, but it can only contain one element
This can be set only if values
is not set
values
object
The keys should match existing parameters
no
The configuration with which execute the baseline experiment
This can be set only if from
is not set
doNotRenderParameters
string
this cannot be used when using a from option since no experiment is actually executed
no
Parameters not to be rendered. - see Parameter rending
renderParameters
string
this cannot be used when using a from option since no experiment is actually executed
no
Parameters to be rendered. - see Parameter rending