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: docs/concepts/scaling.md
+20-1Lines changed: 20 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ Scaling is the process of adjusting the number of instances (or replicas) of a s
10
10
11
11
Scaling is a core concept in distributed systems and cloud-native applications. It ensures your system can handle varying workloads without degrading user experience or over-provisioning resources.
12
12
13
+
13
14
## Why Scale?
14
15
15
16
Scaling enables services to respond effectively under different conditions:
@@ -34,6 +35,23 @@ In most modern deployments, horizontal scaling is preferred because it aligns we
34
35
35
36
Instead of manually adding more instances when traffic increases, an auto-scaling system watches key indicators (like CPU usage) and takes action in real time.
36
37
38
+
### Example
39
+
40
+
With Defang a user, with a Pro and higher plan, can enable service level autoscaling by adding a _**x-defang-autoscaling**_ extension to the service which is to be autoscaled.
41
+
42
+
```yaml
43
+
services:
44
+
service-example:
45
+
x-defang-autoscaling: true #enable autoscaling for this service
46
+
build:
47
+
context: .
48
+
dockerfile: Dockerfile
49
+
ports:
50
+
- mode: ingress
51
+
target: 8080
52
+
published: 8080
53
+
```
54
+
37
55
### How It Works
38
56
39
57
Auto-scaling systems typically rely on:
@@ -62,4 +80,5 @@ Auto-scaling systems typically rely on:
62
80
63
81
- Ensure services are **stateless** or use **externalized state** (e.g., databases, caches) for smooth scaling. ([12 Factor App](https://12factor.net/processes))
64
82
- Test services under load to identify scaling bottlenecks.
65
-
83
+
84
+
See Tutorial page [Scaling Tutorial](/docs/tutorials/scaling-your-services)
0 commit comments