You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: deploy/configuration-as-code/services/autoscaling.mdx
+35-8Lines changed: 35 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,9 +41,36 @@ For high availability, set `minInstances` to at least 3. See [High Availability
41
41
42
42
When either CPU or memory usage exceeds your configured threshold, Porter automatically adds replicas. When usage drops, replicas are removed (down to your minimum).
43
43
44
-
For example, with an 80% CPU threshold:
45
-
- If average CPU across pods exceeds 80%, new replicas are added
46
-
- If average CPU drops below 80%, excess replicas are removed
44
+
### Example: Autoscaling in Action
45
+
46
+
Consider an API service with this configuration:
47
+
48
+
```yaml
49
+
autoscaling:
50
+
enabled: true
51
+
minInstances: 2
52
+
maxInstances: 10
53
+
cpuThresholdPercent: 60
54
+
memoryThresholdPercent: 80
55
+
```
56
+
57
+
Here's how the autoscaler responds to changing load:
58
+
59
+
| Time | Avg CPU | Avg Memory | Replicas | What Happens |
| t=6 | 35% | 45% | 2 | Continue scaling down to minimum |
68
+
69
+
Key behaviors:
70
+
- **Either metric triggers scaling**: If CPU *or* memory exceeds its threshold, replicas are added
71
+
- **Both must be low to scale down**: Replicas are only removed when both CPU and memory are below their thresholds
72
+
- **Respects bounds**: Replicas never drop below `minInstances` (2) or exceed `maxInstances` (10)
73
+
- **Gradual changes**: The autoscaler adjusts incrementally, not all at once, to avoid oscillation
47
74
48
75
## Custom Metrics Autoscaling (Prometheus)
49
76
@@ -78,11 +105,15 @@ Custom metrics autoscaling requires Prometheus to be accessible in your cluster.
78
105
79
106
Scale Temporal workflow workers based on task queue depth. Porter monitors your Temporal task queues and automatically adjusts worker count.
80
107
108
+
<Info>
109
+
Temporal autoscaling requires a Temporal integration to be configured. See [Temporal Autoscaling](/configure/temporal-autoscaling) for setup details.
110
+
</Info>
111
+
81
112
| Field | Type | Description |
82
113
|-------|------|-------------|
83
114
| `temporalAutoscaling.temporalIntegrationId` | string | UUID of the Temporal integration |
84
115
| `temporalAutoscaling.taskQueue` | string | Name of the Temporal task queue to monitor |
85
-
| `temporalAutoscaling.targetQueueSize` | integer | Target number of tasks in queue per replica |
116
+
| `temporalAutoscaling.targetQueueSize` | integer | How many queued tasks each replica should handle (e.g., set to 10 with 100 tasks queued → 10 replicas) |
86
117
87
118
```yaml
88
119
services:
@@ -98,10 +129,6 @@ services:
98
129
targetQueueSize: 10
99
130
```
100
131
101
-
<Info>
102
-
Temporal autoscaling requires a Temporal integration to be configured. See [Temporal Autoscaling](/configure/temporal-autoscaling) for setup details.
103
-
</Info>
104
-
105
132
## Related Documentation
106
133
107
134
- [Autoscaling Overview](/configure/autoscaling) - UI-based configuration and concepts
0 commit comments