QuestionQ5

Ensuring solution and operations excellence

You have a Compute Engine application that should autoscale when total memory utilization exceeds 80%. You 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

The application does not scale during high load. You want to fix 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.
Explanation

The agent.googleapis.com/memory/percent_used metric is broken out by state (used, buffered, cached, slab, free) whose values sum to 100%. On Linux much RAM is reported as buffered/cached, so the strictly 'used' state can stay well below 80% even under heavy load, meaning a filter of state='used' with target 80 never triggers scaling. Filtering state='free' with a target of 20 correctly scales out when free memory drops below 20% (equivalent to total utilization exceeding 80%). Option C is invalid because a single metric label cannot equal several values simultaneously (the AND filter matches nothing), and DELTA_PER_MINUTE (A) is wrong for a gauge metric.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!