Skip to content

Commit cb6b321

Browse files
committed
fix
1 parent b0b7a53 commit cb6b321

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

articles/container-apps/java-metrics-scale-with-keda.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,17 +163,19 @@ This command adds a scale rule to your container app with the name `scale-with-a
163163
## View scaling in Azure portal (optional)
164164
Once your new revision is ready, [send requests](./tutorial-scaling.md#send-requests) to your container app to trigger auto scale with your Java metrics.
165165
1. Go to the `Metrics` blade in the Azure portal for your Azure Container Apps.
166-
1. Add your metric `jvm.gc.count`, with filter `Revision=<your-revision>` and split by `Replica`.
167-
1. Add the metric `Replica Count`, with filter `Revision=<your-revision>`.
166+
1. Add a chart, use the metric `jvm.gc.count`, with filter `Revision=<your-revision>`, aggregation using `Sum`, and split by `Replica`. You can see the `JvmGcCount` metric value for each replica in this chat.
167+
1. Add a chart, use the metric `jvm.gc.count`, with filter `Revision=<your-revision>` and aggregation using `Sum`. You can see the total aggregated `JvmGcCount` metric value for the revision in this chat.
168+
1. Add a chart, use the metric `Replica Count`, with filter `Revision=<your-revision>` and aggregation using `Max`. You can see the replica count for the revision in this chat.
169+
168170
169171
Here's a sample metric snapshot for the example scale rule.
170172

171173
:::image type="content" source="media/java-metrics-keda/keda-auto-scale-java-gc-portal.png" alt-text="Screenshot of KEDA scale with JVM metrics" lightbox="media/java-metrics-keda/keda-auto-scale-java-gc-portal.png":::
172174

173175
1. Initially, there's one replica (the `minReplicas`) for the app.
174176
1. A spike in requests causes the Java app to experience frequent JVM garbage collection (GC).
175-
1. KEDA observes the aggregated metric value for `jvm.gc.count` is increased, and calculates the `desiredReplicas` value.
176-
1. KEDA scales out the container app's replica count to 6.
177+
1. KEDA observes the aggregated metric value for `jvm.gc.count` is increased to `256`, and calculates the `desiredReplicas` value as `ceil(256/30)=9`.
178+
1. KEDA scales out the container app's replica count to 9.
177179
1. The http traffic is distributed across more replicas, reducing the average GC count.
178180
1. The GC count further decreases when no requests are coming in.
179181
1. After a cooldown period, KEDA scales the replica count down to `minReplicas=1`.
22.3 KB
Loading

0 commit comments

Comments
 (0)