CLOUD-DATABASE-ENGINEER practice question 14 of 25

You support a consumer inventory application that runs on a multi-region instance of Cloud Spanner. A customer opened a support ticket to complain about slow response times. You notice a Cloud Monitoring alert about high CPU utilization. You want to follow Google-recommended practices to address the CPU performance issue. What should you do first?

Full set: 141 questions
Answer options
A: Increase the number of processing units. Correct answer
B: Modify the database schema, and add additional indexes.
C: Shard data required by the application into multiple instances.
D: Decrease the number of processing units.
Correct Answer:
A. Increase the number of processing units.
Explanation

The Cloud Monitoring alert for high CPU utilization indicates that the Cloud Spanner instance lacks sufficient compute resources to handle the current workload, leading to slow response times. According to Google-recommended practices, the first and most direct action to alleviate this bottleneck is to scale the instance horizontally by increasing its processing units (or nodes). This provides immediate relief by distributing the load across more resources, improving performance while allowing time for deeper investigation into potential query or schema inefficiencies.

Why Incorrect

B. Modify the database schema, and add additional indexes. This is a valid optimization strategy, but it is a reactive, complex, and time-consuming process, not the recommended first step for an immediate performance issue.
C. Shard data required by the application into multiple instances. Cloud Spanner is designed as a single, horizontally scalable database that manages data distribution (splits) internally. Manually sharding data across multiple instances is not a standard or recommended pattern.
D. Decrease the number of processing units. This action would reduce the available compute resources, further exacerbating the high CPU utilization and worsening the performance degradation.

References

1. Google Cloud Documentation - Cloud Spanner - Alerts: In the section "CPU utilization," the documentation for the "High priority CPU utilization" metric explicitly states: "If this value is consistently above the recommended maximum, you should increase the compute capacity in your instance." This directly supports increasing processing units as the primary response.

Source: Google Cloud Documentation, "Alerting for Cloud Spanner", Section: "CPU utilization".

2. Google Cloud Documentation - Cloud Spanner - Performance overview: This guide outlines performance tuning, emphasizing the balance between compute capacity and workload. It notes that if CPU utilization is high, the instance is a candidate for scaling up.

Source: Google Cloud Documentation, "Cloud Spanner performance overview", Section: "CPU utilization".

3. Google Cloud Documentation - Update an instance: This page details the procedure for modifying an instance's compute capacity. It states, "You can change the compute capacity of an instance after you create it... If you find that you need more or less compute capacity, you can change the number of nodes or processing units in the instance." This confirms that scaling is the intended mechanism for managing resource needs.

Source: Google Cloud Documentation, "Create and manage instances", Section: "Update an instance".

Scroll to Top