RESOURCE CATALOG
Autoscale
Adjusts Compute replica count based on a metric.
type: "autoscale"analogous to an auto scaling groupDefinition
Scaling policy attached to a Compute. Keeps the average of the selected metric (CPU, memory, or requests per second) near the configured threshold, within the replica bounds declared on the target Compute.
When to use
- Loads with predictable variation (business hours, seasonality).
- Workers consuming queues with variable volume.
- APIs with non-constant traffic.
When not to use
- Constant loads — set replicas_min = replicas_max.
- Very low volume sites — keep fixed replicas.
Configuration fields
Each field is validated at creation time. Defaults apply when fields are omitted.
config · autoscale
| Campo | Tipo | Default · Opções |
|---|---|---|
alvo_recurso_id VM alvo | ref → compute | — |
metrica Métrica | enum | cpumemoriarequestsDefault cpu |
limiar Limiar (%) | int | Default 75 |
Examples
Full payloads for POST to /api/projetos/{id}/recursos:
Scale on CPU at 70%
json
{
"tipo": "autoscale",
"nome": "auto-api",
"config": {
"alvo_recurso_id": "<id_api>",
"metrica": "cpu",
"limiar": 70
}
}