# Defining workloads

For a live optimization study, it is required to specify which component metrics represent the different workloads observed on the target system. A workload could be represented by either a metric directly measuring that workload, such as the application throughput, or a proxy metric, such as the percentage of reads and writes in your database.

The [Workload selection](/akamas-docs/3.3.1/akamas-reference/construct-templates/study-template/workload-selection.md) page of the [Study template](/akamas-docs/3.3.1/akamas-reference/construct-templates/study-template.md) section in the reference guide describes how to define the corresponding structure.

Akamas features automatic detection of workload contexts, corresponding to different patterns for the same workload. For example, workload context could correspond to the peak or idle load, or to the weekend or weekday traffic. This allows Akamas to recommend safe configurations based on the observed behavior of the system under similar workload conditions.

Akamas provides several parameters governing how the Akamas optimizer operates and leverages the workload information while a live optimization study is being executed. The most important parameter is the **online mode** (see [here below](#online-mode)) as it related to whether the human user is part of the approval loop when the Akamas AI recommends a configuration to be applied.

Moreover, Akamas also provides customizable safety policies that drive the Akamas optimizer in evaluating candidate configurations with respect to defined goal constraints.

### Online mode

Live optimizations can operate in one of the following online modes:

* **recommendation (or manual) mode** (the default mode): Akamas does not immediately apply a configuration identified by Akamas AI: a new configuration is first recommended to the user, who needs to approve it, possibly after modifying it, before it gets applied - this is also referred to as **human-in-the loop** scenario;
* **fully autonomous (or automatic) mode**: new configurations are immediately applied by Akamas as soon as they are generated by the Akamas AI, without being first recommended to (and approved by) the user.

It is worth noticing that under a recommendation mode, there might be a significant delay between the time a configuration is identified by Akamas and the time the recommended changes get applied. Therefore, the Akamas AI leverages the workload information differently when looking for a new configuration, depending on the defined online mode:

* in the **recommendation mode**, Akamas takes into account all the defined workloads and looks for the configuration that best satisfies the goal constraints for all the observed workloads and provides the best improvements for all of them
* in the **fully autonomous mode**, Akamas works on a single workload at each iteration (based on a customizable **workload strategy** - see below) and looks for an optimized configuration for that specific workload to be immediately applied in the next iteration, even if it might not be the best for the different workloads

The online mode can be specified at the study level and can also be overridden at the step level (only for steps of type "optimize" - see section [Defining optimization steps](/akamas-docs/3.3.1/using-akamas/preparing-optimization-studies/creating-optimization-studies/defining-optimization-steps.md)). The [Optimize step](/akamas-docs/3.3.1/akamas-reference/construct-templates/study-template/steps/optimize-step.md) page of the [Study template](/akamas-docs/3.3.1/akamas-reference/construct-templates/study-template.md) section in the reference guide describes how to define the corresponding structure. This can be done either from the Akamas command line (see page [Optimizer option commands](/akamas-docs/3.3.1/akamas-reference/cli-reference/optimizer-options-commands.md)) or from the Akamas AI (see the following figure).

<figure><img src="/files/h3ryC0br1HOF5f0SHT6P" alt=""><figcaption><p>Changing from automatic to manual mode</p></figcaption></figure>

Notice that the online mode can be changed at any time, that is while the optimization study is running, to become immediately effective. For example, a live optimization could initially operate in recommendation mode and then be changed to fully autonomous mode afterward.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.akamas.io/akamas-docs/3.3.1/using-akamas/preparing-optimization-studies/creating-optimization-studies/defining-workloads.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
