Topic: Professional Cloud Architect topic 1 question 190

You have a Compute Engine application that you want to autoscale when total memory usage exceeds 80%. You have installed the Cloud Monitoring agent and configured the autoscaling policy as follows:
✑ Metric identifier: agent.googleapis.com/memory/percent_used
✑ Filter: metric.label.state = 'used'
✑ Target utilization level: 80
✑ Target type: GAUGE
You observe that the application does not scale under high load. You want to resolve this. What should you do?

A.
Change the Target type to DELTA_PER_MINUTE.
B.
Change the Metric identifier to agent.googleapis.com/memory/bytes_used.
C.
Change the filter to metric.label.state = 'used' AND metric.label.state = 'buffered' AND metric.label.state = 'cached' AND metric.label.state = 'slab'.
D.
Change the filter to metric.label.state = 'free' and the Target utilization to 20.

Re: Professional Cloud Architect topic 1 question 190

C is correct answer:
A. Change the Target type to DELTA_PER_MINUTE. (in this case the utlization tagret need to be in minutes which is not the case its percentage % and not time based.
B. Change the Metric identifier to agent.googleapis.com/memory/bytes_used. (not applicable)
C. Change the filter to metric.label.state = 'used' AND metric.label.state = 'buffered' AND metric.label.state = 'cached' AND metric.label.state = 'slab'. (this gives total memory used)
D. Change the filter to metric.label.state = 'free' and the Target utilization to 20. (you would still need to change the the percent_used to percent_free)

https://stackoverflow.com/questions/69267526/what-is-disk-data-cached-in-the-memory-usage-chart-metrics-of-gcp-compute-in

https://cloud.google.com/compute/docs/autoscaler/scaling-cloud-monitoring-metrics

Re: Professional Cloud Architect topic 1 question 190

TARGET_TYPE: the value type for the metric.
gauge: the autoscaler computes the average value of the data collected in the last couple of minutes and compares that to the utilization target.
delta-per-minute: the autoscaler calculates the average rate of growth per minute and compares that to the utilization target.
delta-per-second: the autoscaler calculates the average rate of growth per second and compares that to the utilization target. For accurate comparisons, if you set the utilization target in seconds, use delta-per-second as the target type. Likewise, use delta-per-minute for a utilization target in minutes.

Re: Professional Cloud Architect topic 1 question 190

In the real exam
"Filter: metric.label.state = 'used' AND metric.label.state = 'buffered' AND metric.label.state = 'cached' AND metric.label.state = 'slab'" is in the QUESTION.

The answer should be:
C. Change the filter to metric.label.state = 'used'

Re: Professional Cloud Architect topic 1 question 190

C is the correct approach. The current filter only considers memory in the "used" state. However, the operating system also uses memory for caching, buffering, and other purposes. By modifying the filter we ensure the autoscaling policy considers all memory states, providing a more accurate representation of total memory usage.

Re: Professional Cloud Architect topic 1 question 190

This question came in recent exam and default state already have all metric.label.state . Went with DELTE per minute option A

Re: Professional Cloud Architect topic 1 question 190

Question has a mistake
"Filter: metric.label.state = 'used'" is in option C

"Change the filter to metric.label.state = 'used' AND metric.label.state = 'buffered' AND metric.label.state = 'cached' AND metric.label.state = 'slab'."
is actually in the queston.


https://cloud.google.com/compute/docs/autoscaler/scaling-cloud-monitoring-metrics#autoscale_based_on_memory_usage
You should use: Filter: metric.label.state = 'used'

Re: Professional Cloud Architect topic 1 question 190

The question in actual exam is reverse. The filter in the question is metric.label.state = 'used' AND metric.label.state = 'buffered' AND metric.label.state = 'cached' AND metric.label.state = 'slab'.

and the option C is:
Filter: metric.label.state = 'used'

C is the correct answer in that case
https://cloud.google.com/compute/docs/autoscaler/scaling-cloud-monitoring-metrics#autoscale_based_on_memory_usage

Re: Professional Cloud Architect topic 1 question 190

Actually this question is kinda weird
We can discard A & B right away:
A: If you change to DELTA_PER_MINUTE it'll calculate the difference in memory used from one minute to the other, and if that difference is bigger* than 80%, it'll trigger. Not what we want.
B: If we change the metric to bytes_used, we must change the value of the gauge too. Not an option.
Now comes the messy part.
Following what is said in this page: https://cloud.google.com/monitoring/api/metrics_opsagent#agent-memory
The metric.label.state should be ONE of these: [buffered, cached, free, slab, used]
And it also states that: 'Summing the values of all states yields the total memory on the machine'. So, using a simple equation, if we remove the 'free' one from them, then that would give us the total memory that is being used. But remember, it said ONE of them, so that would discard it.

Re: Professional Cloud Architect topic 1 question 190

Now D, for me is the closest one to being true. If you ask only for the free percentage_used and change the target to 20, you should be done.
But a question I read here was very interesting, and connects with the * used above...
How does it know that it should scale when the metric is above or below? We don't set that filter. We can hope that the autoscaling is smart enough to know that when we use 'used' we mean more than and when using 'free' we mean less than.
I couldn't find any information about that, so if anyone gets any additional info, please share it.

Re: Professional Cloud Architect topic 1 question 190

C is the correct one

Re: Professional Cloud Architect topic 1 question 190

In the real exam, questions metric label state was mentioned as
"metric.label.state = 'used' AND metric.label.state = 'buffered' AND metric.label.state = 'cached' AND metric.label.state = 'slab'"
and "metric.label.state = 'used'" was given in answer C.

Re: Professional Cloud Architect topic 1 question 190

How does it work for autoscaling?
"AND" is considered as "OR"?
When you already have metric.label.state = 'used' in the problem statement and have an issue, then you trying to add more conditions and hope that this will solve the problem?!?
Strange....

Re: Professional Cloud Architect topic 1 question 190

https://cloud.google.com/monitoring/api/metrics_agent#agent-memory
percent_used
Current percentage of memory used by memory state. Summing percentages over all states yields 100 percent. Sampled every 60 seconds.
state: One of [buffered, cached, free, slab, used].

Re: Professional Cloud Architect topic 1 question 190

Option A : This is the best option because it will allow the autoscaler to scale the instance group based on the rate of change of the memory usage metric. This is more accurate than using the average utilization, as it takes into account the fact that the memory usage can change rapidly under high load.

Re: Professional Cloud Architect topic 1 question 190

I think it is D  . I recently passed the exam and got the same question but option C is not there in the Ans list, instead of that Option C is part of the question
So D seems to be better to me  and also i can confirm Option C is not correct

Re: Professional Cloud Architect topic 1 question 190

Answer should be A: The Gauge setting specifies that the autoscaler should compute the average value of the data collected over the last few minutes and compare it to the target value. By contrast, setting Target mode to DELTA_PER_MINUTE or DELTA_PER_SECOND autoscales based on the observed rate of change rather than an average value

Re: Professional Cloud Architect topic 1 question 190

C is not good because of "AND"
D is not good "Utilization target: If you want the autoscaler to maintain a metric at a specific value, configure a utilization target. The autoscaler creates VMs when the metric value is above the target and deletes VMs when the metric value is below the target"
https://cloud.google.com/compute/docs/autoscaler/scaling-cloud-monitoring-metrics
BandA and against the example found here:
https://cloud.google.com/compute/docs/autoscaler/scaling-cloud-monitoring-metrics#autoscale_based_on_memory_usage
I am pretty sure at the real test the question is a little different, because as presented here none of the options are ok.

Re: Professional Cloud Architect topic 1 question 190

Its D. Given the choices, the most suitable one is to monitor the amount of free memory and trigger autoscaling when the free memory drops below 20%, implying that 80% or more is being used.

Re: Professional Cloud Architect topic 1 question 190

D = "Change the filter to metric.label.state = 'free' and the Target utilization to 20"
It doesn't say BELOW 20.  So Threshold of 20 would match when it was 20, 30, 40+..., right?

Re: Professional Cloud Architect topic 1 question 190

Does anyone know if the current PCA exam still has questions covering the older material prior to question 115 from this Q&A.

Re: Professional Cloud Architect topic 1 question 190

In my exam I had question from the 103 onwards