CPU utilization metrics

This page describes the CPU utilization metrics that Spanner provides. You can view these metrics in the Google Cloud console and in the Cloud Monitoring console.

CPU utilization and task priority

Spanner measures CPU utilization based on the source and the priority of the task.

  • Source: A task can either be initiated by the user or the system.

  • Priority: The priority helps Spanner determine which tasks should execute first. The priority of system tasks is predetermined and cannot be configured. User tasks run at high priority unless otherwise specified. Many data requests, such as read and executeSql , let you specify a lower priority for the request. This can be useful, for example, when you are running batch, maintenance, or analytical queries that don't have strict performance SLOs.

    Higher-priority tasks are in general going to be executed ahead of lower-priority tasks. Spanner allows high-priority tasks to utilize up to 100% of the available CPU capacity even if there are competing lower-priority tasks. While lower-priority system tasks can be delayed in the short term, they must run eventually. Therefore, you must provision your instance with enough compute capacity to handle all tasks.

    If there are no high-priority tasks, Spanner will utilize up to 100% of the available CPU capacity to complete lower-priority tasks more quickly. Spikes in background usage are not a sign of a problem. Lower-priority tasks can yield to higher-priority tasks, including user tasks, almost instantly.

The following table shows examples for each task:

User tasks System tasks
High priority Includes data requests, such as read or executeSql, where either no priority or PRIORITY_HIGH is specified. Includes data splitting.
Medium priority Includes: Includes:
Low priority