# Cost optimization

### Configuring Manual Optimization

After completing all the previous steps, clicking 'reload' will list all capacities created and which ones the PowerEmbedded-App has permission to access.

After that, a button will be displayed, allowing you to manually turn it on and off. On this same screen, you can already view some important capacity information.

<figure><img src="/files/Ca8iJX3q47WW67NcU3x6" alt=""><figcaption></figcaption></figure>

### Configuring On-Demand Cost Optimization

By clicking the actions button and selecting "Edit", you can define the cost optimization settings in the portal.

**Enable cost optimization (Pause and start automatically):**

* When this optimization is enabled, only users with user-level or group-level permissions will be able to view a report if the capacity is turned off. If the capacity is turned off and the user has permission to reactivate it, they will be able to access the report automatically.
* If a user without permission to automatically activate the capacity tries to access a report while the capacity is turned off, they will not be able to view the report.
* You can define the number of minutes during which your capacity can remain idle (i.e., without any open reports). When the system detects that no report has been accessed during that period, the capacity is automatically paused.
* During the period when the capacity is paused, you will not be charged. Although reactivating the capacity is quick and nearly imperceptible, some users may find the process inconvenient. To minimize this impact, you can schedule the capacity reactivation.

<figure><img src="/files/QfuteijHDUn5UVgusRbM" alt=""><figcaption></figcaption></figure>

### Configuring Schedule-Based Cost Optimization

On the "Cost Optimization" screen, you will find the option to "Set schedule for cost optimization".

<figure><img src="/files/v0QQtKuEpDnvbAEBrV4f" alt=""><figcaption></figcaption></figure>

In this tab, you can schedule the times and days of the week when your capacity should turn on and off, or even change its size.

By clicking "Add", two fields will be displayed: time and action. Here you can schedule the times to turn the resource on and off.

{% hint style="info" %}
Use the "Copy to" option to apply the same configuration to other days of the week and save your time.
{% endhint %}

{% hint style="warning" %}
**Attention:** During the defined interval, the capacity will always be on, regardless of whether users are accessing reports or not.

Outside of this time, the capacity will work based on demand. For example, if you set the capacity to turn on at 08:00 and off at 17:00, it will remain on during that period. Before 08:00 and after 17:00, the capacity will work based on demand.

If a user tries to access a report outside of the scheduled time and they have the active permission in the user or group registration, the capacity will be turned on, and when it reaches the inactivity time you defined, it will be turned off.
{% endhint %}

### Automatic Resizing

{% hint style="info" %}
If you need to automatically change the SKU (Size) of the capacity at defined times, access [Automatic Resizing](https://github.com/dirceuresende/docs-power-embedded-english/blob/main/administration-portal/artifacts/capacities/redimensionamento-automatico.md).
{% endhint %}


---

# 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.powerembedded.com/administration-portal/artifacts/capacities/cost-optimization.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.
