> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orpheus.run/llms.txt
> Use this file to discover all available pages before exploring further.

# Autoscaling

> How Orpheus scales based on queue depth

## Queue-Depth Scaling

Orpheus scales on actual demand: how many requests are waiting.

Every 5 seconds:

```
utilization = (queued + processing) / workers

If utilization > 3.0 → add worker
If utilization < 0.5 → remove worker
```

## Why Not CPU-Based?

AI agents spend most time waiting (for LLM APIs, databases, etc). CPU stays low even when busy.

Queue-depth scaling adds workers when work piles up, regardless of CPU.

<img className="block" src="https://mintcdn.com/orpheussysteminc/hc-RHMSh1-Rpu87T/assets/auto-scalling.svg?fit=max&auto=format&n=hc-RHMSh1-Rpu87T&q=85&s=3b98f302477ec556afa47e99e5c5f742" alt="workers" width="16041" height="5111" data-path="assets/auto-scalling.svg" />

## Example

```
10 requests arrive
3 workers running
Queue depth = 10

utilization = 10/3 = 3.3
3.3 > 3.0 → scale up

New worker spawns
4 workers now handle the load
```

## Configuration

```yaml theme={null}
scaling:
  min_workers: 1      # Floor
  max_workers: 10     # Ceiling
```

## Monitor Scaling

```bash theme={null}
orpheus stats my-agent
```

Shows queue depth and worker count in real-time.
