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: articles/container-apps/java-metrics-scale-with-keda.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -163,17 +163,19 @@ This command adds a scale rule to your container app with the name `scale-with-a
163
163
## View scaling in Azure portal (optional)
164
164
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.
165
165
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
+
168
170
169
171
Here's a sample metric snapshot for the example scale rule.
170
172
171
173
:::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":::
172
174
173
175
1. Initially, there's one replica (the `minReplicas`) for the app.
174
176
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.
177
179
1. The http traffic is distributed across more replicas, reducing the average GC count.
178
180
1. The GC count further decreases when no requests are coming in.
179
181
1. After a cooldown period, KEDA scales the replica count down to `minReplicas=1`.
0 commit comments