Your organization runs an enterprise web application on a Compute Engine Managed Instance Group (MIG) configured with autoscaling. The application requires 4 minutes (240 seconds) after VM boot to download artifacts, initialize local caches, and pass health checks. During sudden load spikes, the autoscaler initiates multiple scale-out events in rapid succession before previously launched instances complete startup, leading to over-provisioning and resource instability. Furthermore, the operations team needs to collect detailed OS-level RAM usage metrics from these VM instances inside Cloud Monitoring. Which set of actions should you take to resolve both issues?
- Set the autoscaling policy cool-down period to at least 240 seconds, and install the unified Google Cloud Ops Agent on the VM instances.Answer
- BIncrease the target CPU utilization threshold in the autoscaling policy to 90%, and install the legacy Stackdriver Monitoring agent on the VM instances.
- CReconfigure the instance template to provision Spot VMs to accelerate instance creation times, and assign the primitive Owner role to the VM service account.
- DSubmit a GCP quota increase request for Compute Engine regional vCPUs, and perform an immediate hard reset on all instances in the MIG.
Answer
Configure the autoscaling policy cool-down period to at least 240 seconds (4 minutes) to allow new instances to complete application initialization before further scaling decisions are evaluated, and deploy the Google Cloud Ops Agent to collect guest OS memory metrics.
The correct approach requires setting the MIG autoscaling cool-down period (`--cool-down-period`) to match or exceed the 4-minute application startup duration. This ensures the autoscaler ignores instance metrics until initialization completes. Installing the Google Cloud Ops Agent is the recommended solution to collect OS-level memory metrics, as default Compute Engine metrics only cover hypervisor-visible metrics like CPU and disk I/O.
Step-by-Step Solution
Key Concept
Compute Engine MIG Autoscaling Cool-down Period and Telemetry Management