Runtime configuration and status of the transcoder instance auto-scaler.
GET /api/v1/scaler/config
Get the auto-scaler configuration in force in the serving process: the most recent runtime `PATCH` if one has been accepted since startup, otherwise the boot values — the persisted snapshot when the parameter store holds a readable one, else `ENCORE_MAX_INSTANCES` / `ENCORE_IDLE_TIMEOUT_MS`. It reads the live copy, never the parameter store; `sources` says per field whether a value is the deployment's environment value or an operator value (set by `PATCH` on this process, or restored at boot).
Report the auto-scaler settings this process is using. These are the live values: the most recent PATCH /api/v1/scaler/config if one has been accepted since startup, otherwise the boot values — the persisted snapshot of an earlier PATCH when the parameter store holds a readable one (#1078), else ENCORE_MAX_INSTANCES and ENCORE_IDLE_TIMEOUT_MS. This endpoint reads the live copy only — it never reads the store, so it cannot be used to check what is persisted. sources says, per field, whether the value is the deployment's environment value or was set through PATCH on this process (#1079). minInstances is reported from this endpoint's own record and is not the floor the scaler loops enforce (see the field description).
Response
The auto-scaler configuration this process is using right now. A value set by PATCH is written durably to the parameter store before it is applied, and is read back at boot (#1078), so a restarted process serves the persisted values and reports them with source: "runtime". The ENCORE_MAX_INSTANCES / ENCORE_IDLE_TIMEOUT_MS environment values apply only to a deployment never configured through this endpoint, or when the parameter store could not be read at boot (logged with the reason).
Response 200 (application/json)
{
"maxInstances": 0,
"minInstances": 0,
"idleTimeoutMs": 0,
"sources": {
"maxInstances": {
"source": "env",
"updatedAt": "string"
},
"minInstances": {
"source": "env",
"updatedAt": "string"
},
"idleTimeoutMs": {
"source": "env",
"updatedAt": "string"
}
}
}
Field notesmaxInstances — Upper bound on transcoder instances in one workspace pool. Applied to every running scaler loop as soon as it is set. Boot default: ENCORE_MAX_INSTANCES (3 when unset).minInstances — Warm floor of instances kept running while a pool is idle. NOTE: unlike the other two fields a PATCH to this one is only recorded — persisted and reported back here — and is NOT fanned out to the already-running scaler loops, which keep enforcing the floor they were created with. The persisted value IS applied at the next boot (#1078), where it takes precedence over ENCORE_MIN_INSTANCES, so a PATCH here takes effect on the running loops only after a restart.idleTimeoutMs — Idle time before an idle instance is torn down, in milliseconds (minimum 10000). Applied to every running scaler loop as soon as it is set. Boot default: ENCORE_IDLE_TIMEOUT_MS (300000 when unset).sources — Where each config value in this response came from (#1079).
PATCH /api/v1/scaler/config
Update auto-scaler configuration at runtime. `maxInstances` and `idleTimeoutMs` take effect on the next scaler tick with no restart; `minInstances` is persisted and echoed back but not applied to the already-running scaler — the persisted value is applied at the next boot, ahead of `ENCORE_MIN_INSTANCES`. The values are written to the parameter store before they are applied, so a `200` means saved and applied — `501` when no parameter store is configured and `503` when the write fails, with nothing applied in either case. The stored record is reloaded at boot, so a restart serves the persisted values; `ENCORE_MAX_INSTANCES` / `ENCORE_IDLE_TIMEOUT_MS` apply to a deployment never configured through the API, or to a boot where the store could not be read (warn-logged with the reason). There is no reset endpoint: send the environment values back explicitly.
Change the auto-scaler settings of the process serving this request. maxInstances and idleTimeoutMs take effect on the next scaler tick, with no restart.
**Storage.** The values are written to the parameter store first and applied second, as one complete snapshot of all three fields, so a 200 always means "saved AND applied". A deployment with no parameter store configured gets a 501 and nothing is applied; a store that rejects the write or cannot be reached gets a 503 and nothing is applied, so GET /api/v1/scaler/config still reports the previous values. The live copy is per process and is not pushed to other replicas.
**Precedence.** Three layers, in order: the most recent PATCH accepted by this process, else the persisted snapshot this process read from the parameter store at boot (#1078), else the environment values read at boot — ENCORE_MAX_INSTANCES (default 3) and ENCORE_IDLE_TIMEOUT_MS (default 300000). So the environment applies to a deployment never configured through this endpoint, or to a boot where the stored record was absent or unreadable.
**Restart.** The stored record survives a restart AND is read back at boot (#1078), so a restarted process serves the persisted values — for the config endpoint and for the scaler loops — without the PATCH being re-sent. If the parameter store cannot be read at boot the process starts on the environment values instead and logs a warning naming the reason, so a restored value must never be assumed without checking sources.
**Reset to the environment default.** There is no reset endpoint and no sentinel value. PATCH the environment values back explicitly, which overwrites the stored snapshot — and now that boot restores that snapshot (#1078), that is the only way back to the environment values: restarting no longer undoes a PATCH. GET /api/v1/scaler/config shows what is in force, and sources says per field whether the value was set through PATCH — on this process, or on an earlier one and restored at boot — or came from the environment (#1079). Note that PATCHing an environment value back still reports source: "runtime", because sources reports who set the value, not whether the number changed; a field reports source: "env" again only on a process that booted with no usable stored record.
**Caveats.** minInstances is recorded, persisted and echoed back but is not applied to the running scaler loops (see the field description). A PATCH sent while GET /api/v1/scaler/status reports scalerActive: false is accepted and reported back, but is not carried into the scaler that later activates against a newly provisioned stack — that activation uses the values this process resolved at boot (the persisted snapshot when one was loaded, else the environment values), so re-send the PATCH afterwards.
Request
Request body (application/json)
{
"maxInstances": 0,
"minInstances": 0,
"idleTimeoutMs": 0
}
Field notesmaxInstances — Upper bound on transcoder instances in one workspace pool. Applied to every running scaler loop as soon as it is set. Boot default: ENCORE_MAX_INSTANCES (3 when unset).minInstances — Warm floor of instances kept running while a pool is idle. NOTE: unlike the other two fields a PATCH to this one is only recorded — persisted and reported back here — and is NOT fanned out to the already-running scaler loops, which keep enforcing the floor they were created with. The persisted value IS applied at the next boot (#1078), where it takes precedence over ENCORE_MIN_INSTANCES, so a PATCH here takes effect on the running loops only after a restart.idleTimeoutMs — Idle time before an idle instance is torn down, in milliseconds (minimum 10000). Applied to every running scaler loop as soon as it is set. Boot default: ENCORE_IDLE_TIMEOUT_MS (300000 when unset).
Response
The auto-scaler configuration this process is using right now. A value set by PATCH is written durably to the parameter store before it is applied, and is read back at boot (#1078), so a restarted process serves the persisted values and reports them with source: "runtime". The ENCORE_MAX_INSTANCES / ENCORE_IDLE_TIMEOUT_MS environment values apply only to a deployment never configured through this endpoint, or when the parameter store could not be read at boot (logged with the reason).
Response 200 (application/json)
{
"maxInstances": 0,
"minInstances": 0,
"idleTimeoutMs": 0,
"sources": {
"maxInstances": {
"source": "env",
"updatedAt": "string"
},
"minInstances": {
"source": "env",
"updatedAt": "string"
},
"idleTimeoutMs": {
"source": "env",
"updatedAt": "string"
}
}
}
Field notesmaxInstances — Upper bound on transcoder instances in one workspace pool. Applied to every running scaler loop as soon as it is set. Boot default: ENCORE_MAX_INSTANCES (3 when unset).minInstances — Warm floor of instances kept running while a pool is idle. NOTE: unlike the other two fields a PATCH to this one is only recorded — persisted and reported back here — and is NOT fanned out to the already-running scaler loops, which keep enforcing the floor they were created with. The persisted value IS applied at the next boot (#1078), where it takes precedence over ENCORE_MIN_INSTANCES, so a PATCH here takes effect on the running loops only after a restart.idleTimeoutMs — Idle time before an idle instance is torn down, in milliseconds (minimum 10000). Applied to every running scaler loop as soon as it is set. Boot default: ENCORE_IDLE_TIMEOUT_MS (300000 when unset).sources — Where each config value in this response came from (#1079).
GET /api/v1/scaler/status
Current transcoder instance pool status. `maxInstances` and `idleTimeoutMs` are the values in force in the serving process — a runtime `PATCH` if one has been sent since startup, otherwise the boot-time environment values.
Response
Response 200 (application/json)
{
"workspaces": [
{
"workspaceId": "string",
"observed": true,
"instances": [
{
"instanceId": null,
"url": null,
"activeJobs": null,
"lastIdleAt": null,
"readyAt": null,
"draining": null
}
],
"connectionId": "string",
"unobservedReason": "string",
"queueDepth": 0,
"inflightDepth": 0,
"spawnFailure": {
"at": 0,
"attempts": 0,
"consecutiveFailures": 0,
"message": "string"
}
}
],
"connections": [
{
"stacks": [
"string"
],
"observed": true,
"connectionId": "string",
"unobservedReason": "string"
}
],
"maxInstances": 0,
"jobsPerInstance": 0,
"idleTimeoutMs": 0,
"scalerActive": true,
"sources": {
"maxInstances": {
"source": "env",
"updatedAt": "string"
},
"idleTimeoutMs": {
"source": "env",
"updatedAt": "string"
}
}
}
Field notesmaxInstances — Instance cap per workspace pool in force in this process: the most recent PATCH /api/v1/scaler/config value if one has been accepted since startup, otherwise the boot value — the persisted snapshot from an earlier PATCH when one is stored and readable, else ENCORE_MAX_INSTANCES (#1078). Reported even when scalerActive is false.idleTimeoutMs — Idle teardown timeout (ms) in force in this process: the most recent PATCH /api/v1/scaler/config value if one has been accepted since startup, otherwise the boot value — the persisted snapshot from an earlier PATCH when one is stored and readable, else ENCORE_IDLE_TIMEOUT_MS (#1078).sources — Where the config values in this response came from (#1079). Covers the values this endpoint reports that an operator can change; see GET /config for the full set, including minInstances.