Find hotspots in your Spanner Omni database

This document describes how to diagnose hotspots in your Spanner Omni databases. These processes and diagnoses are largely identical to Spanner hotspot diagnosis, with the following distinctions:

  • The Spanner Omni system insights dashboard is available in Grafana. For more information on how to set up this dashboard, see set up Grafana.

  • Instead of going to the Google Cloud console to query SPANNER_SYS.* tables, you will need to query your database directly using the Spanner Omni CLI. For example, the following query shows the busiest data splits over the past 5 hours in DATABASE_ID, and ranks them by most CPU usage:

    spanner sql \
    --database DATABASE_ID --execute \
    "SELECT * \
    FROM SPANNER_SYS.SPLIT_STATS_TOP_MINUTE \
    WHERE INTERVAL_END > TIMESTAMP_SUB(CURRENT_TIMESTAMP(), \
    INTERVAL 5 HOUR) \
    ORDER BY CPU_USAGE_SCORE DESC"
    

Known issues

  • If the total compute capacity of your Spanner Omni deployment is less than 3.5 vCPU per server, the split usage scores in the SPANNER_SYS.* tables might be lower than the scores shown on the system insights dashboard. The dashboard shows the correct split CPU usage scores, but you need to query the SPANNER_SYS.* tables to identify the splits corresponding to those high scores.