이 페이지에서는 핫스팟 통계 대시보드를 사용하여 Spanner 데이터베이스의 핫스팟을 감지하는 방법을 설명합니다.
핫스팟 통계 개요
핫스팟으로 인해 Spanner 데이터베 이스에 지연 시간이 발생합니다. 핫스팟 통계 대시보드를 사용하면 핫스팟의 영향을 받는 분할을 감지할 수 있습니다. 핫스팟으로 인해 지연 시간이 발생하는지 확인하고 발생하는 경우 문제를 해결하는 방법을 알아보려면 다음 단계를 따르세요.
데이터베이스 필드의 목록에서 데이터베이스를 선택합니다. 대시보드에는 데이터베이스의 최대 분할 CPU 사용량 점수가 표시됩니다.
대시보드의 영역은 다음과 같습니다.
최대 분할 CPU 사용량 점수 그래프: CPU 사용량 점수가 높을수록(예: 100에 가까움) 분할이 많이 사용되고 낮은 점수에 비해 서버에 핫스팟이 발생할 가능성이 높습니다.
데이터베이스 필드: 특정 데이터베이스 또는 모든 데이터베이스의 핫 분할 정보를 필터링합니다.
시간 범위 필터: 최대 6시간까지 1분 단위로 최대 분할 CPU 사용량을 필터링합니다.
상위 N개 분할 테이블: 분할 CPU 사용량 점수순으로 정렬된 상위 분할 목록을 표시합니다.
핫스팟에 개입이 필요한지 확인
그래프에서 전체 지연 시간에 해당하는 급증 또는 상승이 표시되고 최대 분할 CPU 사용량 점수가 지속적으로 높으면 자세히 조사해야 할 수 있습니다.
그래프를 검토하여 다음 질문을 살펴보세요.
어떤 데이터베이스에서 지연 시간 악화가 발생하나요?데이터베이스 목록에서 다른 데이터베이스를 선택하여 지연 시간이 가장 긴 데이터베이스를 찾습니다. Google Cloud 콘솔에서 데이터베이스의 지연 시간 차트를 검토하여 부하가 가장 높은 데이터베이스를 확인할 수도 있습니다.
지연 시간이 긴가요? 지연 시간이 워크로드의 예상 지연 시간에 비해 과도하게 긴가요? 시간이 지남에 따라 그래프가 급증하거나 더욱 상승하나요? 지연 시간이 길지 않으면 핫스팟 문제가 아닙니다.
최대 분할 CPU 사용량 점수가 100%인가요? 시간이 지남에 따라 그래프가 급증하거나 더욱 상승하나요? 10분 이상 100%의 최대 분할 CPU 사용량 비율이 지속되지 않으면 핫스팟 문제가 아닐 수 있습니다.
최대 분할 CPU 사용량 비율이 10분 넘게 높은 경우 데이터베이스의 지연 시간이 예상보다 높은지 자세히 조사해 볼 수 있습니다.
최대 분할 CPU 사용량 비율이 100%로 10분 넘게 표시되면 핫스팟에 개입이 필요할 수 있습니다. 그런 다음 데이터베이스의 핫 분할을 식별하여 디버깅 여정을 계속할 수 있습니다.
문제가 있는 핫 분할 식별
핫스팟이 있는 문제가 될 수 있는 분할을 식별하려면 다음과 같이 Google Cloud 콘솔의 상위 N개 분할 섹션을 참고하세요.
상위 N개 분할 테이블은 선택한 기간 동안 핫일 수 있는 분할에 대한 개요를 제공하며, 가장 최근 분할부터 가장 이전 분할까지 정렬됩니다. 상위 N개 분할 수는 100개로 제한됩니다.
그래프의 경우 Spanner는 분 단위의 세부사항으로 상위 N개 분할 통계 테이블에서 데이터를 가져옵니다. 그래프의 각 데이터 포인트 값은 1분 간격의 평균 값을 나타냅니다.
테이블에는 다음 속성이 표시됩니다.
간격 종료: CPU 사용량이 가장 높았던 기간이 종료된 날짜 및 시간입니다.
분할 시작: 분할에서 행 범위의 시작 키입니다. 분할 시작이 <begin>인 경우 데이터베이스의 키 범위 시작을 나타냅니다.
분할 한도: 분할에서 행 범위의 한도 키입니다. 한도 키가 <end>이면 데이터베이스의 키 범위가 끝났음을 나타냅니다.
분할 CPU 사용량 점수: 단일 서버의 분할 내 행에 대한 액세스에서 사용한 CPU 양을 반영하는 0~100까지의 추상적인 점수입니다. CPU 사용량 점수를 사용하여 핫스팟이 있는지 평가하세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-11(UTC)"],[],[],null,["# Find hotspots in your database\n\nThis page describes how to use the Hotspot insights dashboard to\ndetect hotspots in your Spanner database.\n\nHotspot insights overview\n-------------------------\n\nHotspots cause latency in your Spanner database. The\nHotspot insights dashboard helps you detect the splits affected by\nhotspots. Use the following steps to determine if hotspots are causing latency\nand if it is, how to resolve the issue:\n\n1. [Open the dashboard.](/spanner/docs/find-hotspots-in-database#dashboard)\n2. [Determine whether hotspots needs your intervention.](#determine-intervention)\n3. [Identify problematic hot splits.](#identify-hot-splits)\n\nHotspot insights is available in single-region, multi-region, and\ndual-region configurations.\n\nPricing\n-------\n\nThere is no additional cost for Hotspot insights.\n\nData retention\n--------------\n\nThe maximum data retention for the Hotspot insights chart and table\nis 6 hours.\n\nFor the hottest splits table, data is taken from the\n`SPANNER_SYS.SPLIT_STATS_TOP_MINUTE` table, which has a maximum retention\nof 6 hours. For more information, see\n[Data retention](/spanner/docs/introspection/hot-split-statistics#data_retention_for_the_hot_split_statistics).\n\nRequired roles\n--------------\n\nYou might need different IAM roles and permissions, depending\non whether you are an IAM user or a fine-grained access control user.\n\n### Identity and Access Management (IAM) user\n\n\nTo get the permissions that\nyou need to view the **Hotspot insights** page,\n\nask your administrator to grant you the\nfollowing IAM roles on the instance:\n\n- [Cloud Spanner Viewer](/iam/docs/roles-permissions/spanner#spanner.viewer) (`roles/spanner.viewer`)\n- [Cloud Spanner Database Reader](/iam/docs/roles-permissions/spanner#spanner.databaseReader) (`roles/spanner.databaseReader`)\n\n\nThe following permissions in the [Cloud Spanner Database Reader](/iam/docs/understanding-roles#spanner.databaseReader) (`roles/spanner.databaseReader`) role are required to view the **Hotspot insights** page:\n\n\u003cbr /\u003e\n\n- `spanner.databases.beginReadOnlyTransaction`\n- `spanner.databases.select`\n- `spanner.sessions.create`\n\n### Fine-grained access control user\n\nIf you are a fine-grained access control user, ensure that you:\n\n- Have the [Cloud Spanner Viewer](/iam/docs/understanding-roles#spanner.viewer) (`roles/spanner.viewer`)\n- Have fine-grained access control privileges and are granted the `spanner_sys_reader` system role or one of its member roles.\n- Select the `spanner_sys_reader` or a member role as your current system role on the database **Overview** page.\n\n| **Note:** If you already have an IAM database-level permission, such as `spanner.databases.select`, the Google Cloud console assumes that you are an IAM user. You can't select the `spanner_sys_reader` or a member role on the database overview page as an IAM user.\n\nFor more information, see [fine-grained access control overview](/spanner/docs/fgac-about) and\n[Fine-grained access control system roles](/spanner/docs/fgac-system-roles).\n\nOpen the Hotspot insights dashboard\n-----------------------------------\n\nThe **Hotspot insights** dashboard shows the peak split CPU usage\npercentage. This metric is an abstract percentage of 0 to 100 that reflects the\namount of CPU used when rows within a split are accessed.\n\nTo view the **Hotspot insights** dashboard for a database, do the\nfollowing:\n\n1. In Google Cloud console, open the **Spanner** page.\n\n [Go to Spanner](https://console.cloud.google.com/spanner)\n2. Select an instance from the list.\n\n3. In the navigation menu, click the **Hotspot insights**\n tab.\n\n4. In the **database** field, select a database from the list. The dashboard\n shows the peak split CPU usage score for the database.\n\nThe areas of the dashboard include:\n\n- **Peak split CPU usage score** graph: a higher CPU usage score (such as near 100) indicates that the split is hot and very likely causing a hotspot on the server compared to lower scores.\n- **Database field**: filters the hot splits information on a specific database or all databases.\n- **Time range filter**: filters the peak splits CPU usage by 1-minute increments up to a total of 6 hours.\n- **TopN splits table**: displays the list of top splits sorted by split CPU usage scores.\n\nDetermine if hotspots need intervention\n---------------------------------------\n\nIf you see a spike or an elevation in the graph that corresponds to the overall\nlatency and a persistent high peak split CPU usage score, then you might need to\ninvestigate further.\n\nReview the graph to explore these questions:\n\n- **Which database is experiencing the latency degradation?** Select different\n databases from the **Databases** list to find the databases with the highest\n latency. To find out which database has the highest load, you can also\n review the [**Latency** chart](/spanner/docs/latency-metrics#overview) for\n databases in the Google Cloud console.\n\n- **Is the latency high?** Is the latency high as compared to the expected\n latency for the workload? Is the graph spiking or becoming more elevated\n over time? If you don't see high latency, then hotspots aren't a problem.\n\n- **Is the high peak split CPU usage score at 100%?** Is the graph spiking or\n becoming more elevated over time? If you don't see persistent 100% peak\n split CPU usage percentages for at least 10 minutes, then hotspots might not\n be a problem.\n If the peak split CPU usage percentage is high for longer than 10 minutes,\n then you might want to investigate further to see if the database has higher\n than expected latency levels.\n\nIf you see 100% peak split CPU usage percentages for longer than 10 minutes,\nthen hotspots might need your intervention. Next, you can continue the debugging\njourney by identifying the hot splits in your database.\n\nIdentify problematic hot splits\n-------------------------------\n\nTo identify a potentially problematic split that has hotspots, see the **TopN\nsplits** section in the Google Cloud console, as shown in the following.\n\nThe **TopN splits** table provides an overview of the splits that might be\nhot during the chosen time window, sorted from latest to earliest. The number of\nTopN splits is limited to 100.\n\nFor the graphs, Spanner fetches data from the TopN splits\nstatistics table, with a granularity of one minute. The value\nfor each data point in the graphs represents the average value over an interval\nof one minute.\n\nThe table shows the following properties:\n\n- **Interval end**: the date and time when the high peak CPU usage ends.\n- **Split start**: the starting key of the range of rows in the split. If the split start is \\\u003cbegin\\\u003e, it indicates the beginning of the key range of the database.\n- **Split limit**: the limit key of the range of rows in the split. If the limit key is \\\u003cend\\\u003e, it indicates the end of the key range of the database.\n- **Split CPU usage score**: an abstract score of between 0 and 100 that reflects the amount of CPU used by accesses to the rows within the split on a single server. Use the CPU usage score to help evaluate whether you have hotspots.\n- **Affected tables**: the tables whose rows might be in the split.\n\nWhat's next\n-----------\n\n- Learn about [Split hotspot statistics](/spanner/docs/introspection/hot-split-statistics)"]]