例如,假设表的行键架构是 [user_id]#[event_timestamp],用户 ID 和时间戳由井号分隔。获取热片列表可帮助您确定特定用户 ID 或事件时间戳是否会导致热点。通过确定访问模式,您可以采取进一步措施,例如重新设计行键或表,以在键空间中更均匀地分布使用情况。在此示例中,如果用户 ID 因单调递增并导致热点,您可以按其他顺序分配用户 ID,或改用通用唯一标识符 (UUID)。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[[["\u003cp\u003eBigtable uses "hot tablets" to identify overutilized tablets within a cluster, which can cause latency and replication delays due to imbalanced CPU usage.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eListHotTablets\u003c/code\u003e method, accessible through the Google Cloud CLI, Cloud Bigtable Admin API, and client libraries, returns data on hot tablets, including their name, associated table, CPU usage, start/end times, and key ranges.\u003c/p\u003e\n"],["\u003cp\u003eIdentifying hot tablets is useful for troubleshooting performance issues by pinpointing problematic row keys, observing hotspots with minute-level granularity, and identifying problematic tables within a cluster.\u003c/p\u003e\n"],["\u003cp\u003eHotspots are often caused by application access patterns that frequently access rows near each other, indicating a potential need for schema redesign or different key usage to evenly distribute access.\u003c/p\u003e\n"],["\u003cp\u003eWhile Key Visualizer provides a broad view of key-space access patterns, \u003ccode\u003eListHotTablets\u003c/code\u003e offers finer granularity in both key and time space, enabling identification of short-lived hotspots and problematic tables within a multi-table cluster.\u003c/p\u003e\n"]]],[],null,["Hot tablets\n\nTo help you troubleshoot performance issues, Bigtable provides the\nability to identify and observe hot tablets in a cluster. This page describes\nhot tablets, tells you how to get a list of hot tablets, and discusses\nsituations when identifying hot tablets is helpful. Before you read this page,\nyou should read the\n[Bigtable overview](/bigtable/docs/overview#load-balancing).\n\nThe name of the method that you use to get a list of hot tablets varies\ndepending on the language used. For simplicity, in this document the method is\nreferred to by its RPC Cloud Bigtable Admin API name, `ListHotTablets`. You are able to get a list\nof hot tablets by using the following:\n\n- [The Google Cloud CLI](/sdk/gcloud/reference/bigtable/hot-tablets/list)\n- [The Cloud Bigtable Admin API](/bigtable/docs/reference/admin/rpc)\n- [The Cloud Bigtable client libraries](/bigtable/docs/reference/libraries)\n\nIdentifying hot tablets can help you with the following tasks:\n\n- [Identifying problematic row keys](#problematic-row-keys)\n- [Observing hotspots with minute-level granularity](#minute-level-granularity)\n- [Identifying problematic tables within a cluster](#problematic-tables)\n\nUnderstand hot tablets\n\nA Bigtable table is sharded into blocks of contiguous rows,\ncalled *tablets* , to help balance the workload of queries. Each tablet is\nassociated with a node, and operations on these rows are performed on the node.\nTo optimize performance, tablets are split or moved to a different node\ndepending on access patterns. Based on user access patterns --- read, write, and\nscan operations --- tablets are rebalanced across the nodes. For details on load\nbalancing, see\n[How Bigtable optimizes your data over time](/bigtable/docs/performance#optimization).\n\nA *hot tablet* is a tablet that exhibits overutilization of the node CPU\nbecause the tablet uses a disproportionately large percentage of CPU compared to\nother tablets. This imbalanced node usage can cause latency and replication\ndelays.\n\nAmong the most frequent causes of hot tablets are hotspots, which occur when\nyour application frequently accesses rows that are near each other in the table.\nHotspots are often the result of a schema design that is not optimized to spread\nyour application's access patterns across the table. To learn how to design your\nrow keys so that hotspots don't occur, see\n[Schema design best practices](/bigtable/docs/schema-design).\n\nTo get a list of hot tablets, you must be assigned to a role that has the\n`bigtable.viewer` permission.\n\nOutput\n\nThe `ListHotTablets` method returns the following data for a given cluster in an instance.\n\n- **Tablet name.** The unique ID assigned by Bigtable to the hot tablet. This field is not displayed by the gcloud CLI.\n- **Table.** The ID of the table associated with the hot tablet.\n- **CPU usage.** The average CPU utilization of the node associated with the hot tablet, expressed as a percentage, during that one-minute interval. This percentage is the average of the sum of Write CPU and Read CPU from start time to end time.\n- **Start time.** The start time of the hot tablet period.\n- **End time.** The end time of the hot tablet period.\n- **Start key.** The first row key in the hot tablet.\n- **End key.** The last row key in the hot tablet. A suffix of `\\000` is appended when the start and end key are the same, indicating that the tablet spans a single row.\n\nKeys are lexicographically sorted within a tablet, so any key between the start\nkey and end key is contained in that hot tablet.\n\nHotspots are calculated on a one-minute resolution, and a tablet might reappear\nin the output. In other words, a single tablet might be considered hot for\nmultiple minutes.\n\nBy default, `ListHotTablets` searches the past 24 hours. To search within a\nspecific time range, provide a start time and end time.\n\nThe maximum number of hot tablets returned is 50. To change this, provide a\npage size.\n\nThe method returns an empty list if none of the tablets in the cluster are hot.\n\nExample using the gcloud CLI\n\nBefore you copy this example,\n[install the `gcloud` CLI](/bigtable/docs/installing-cloud-sdk).\n\nTo view a list of hot tablets for a given cluster, run the\n[`hot-tablets list`](/sdk/gcloud/reference/bigtable/hot-tablets/list)\ncommand in the Cloud Shell or your local terminal window. \n\n gcloud bigtable hot-tablets list \u003cvar translate=\"no\"\u003eCLUSTER_ID\u003c/var\u003e --instance \u003cvar translate=\"no\"\u003eINSTANCE_ID\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eCLUSTER_ID\u003c/var\u003e: the permanent identifier for the cluster\n- \u003cvar translate=\"no\"\u003eINSTANCE_ID\u003c/var\u003e: the permanent identifier for the instance\n\nIf any tablets in the cluster are hot, the terminal displays output similar to\nthe following. Hot tablets in a cluster are listed in descending order of CPU usage. \n\n```\nTABLE CPU_USAGE START_TIME END_TIME START_KEY END_KEY\ntest-data 89.3 2021-12-14T01:19:57+00:00 2021-12-14T01:20:57+00:00 user29333893046… user29333893046…\ntest-data 22.8 2021-12-14T01:04:59+00:00 2021-12-14T01:06:59+00:00 user29333893046… user29345657428…\ntest-data 20.9 2021-12-14T01:18:56+00:00 2021-12-14T01:20:56+00:00 user54519105346… user545293\ntest-data 16.5 2021-12-14T01:18:56+00:00 2021-12-14T01:20:56+00:00 user49196524328… user49206\n```\n\nUse cases for hot tablets data\n\nIdentifying hot tablets in a cluster can help you troubleshoot performance\nissues. You can use the `ListHotTablets` method in combination with other\nmonitoring tools, such as the\n[Key Visualizer](/bigtable/docs/keyvis-overview)\ndiagnostic tool for Bigtable.\n\nIdentifying problematic row keys\n\nYou can use `ListHotTablets` to identify specific row keys and row ranges. This\ncan provide observability into access patterns that might be causing hotspots.\n\nFor example, suppose that a table's row key schema is\n`[user_id]#[event_timestamp]`, user IDs and timestamps separated by a hash\nsymbol. Getting a list of hot tablets can help you determine if specific user\nIDs or event timestamps are causing hotspots. Identifying the access patterns\nlets you take further action, such as redesigning row keys or tables to spread\nusage more evenly across the key space. In this example, if user IDs are\nmonotonically increasing and causing hotspots for that reason, you might assign\nuser IDs in a different order or use universally unique identifiers (UUID)\ninstead.\n\nWhen the start and end row key are the same, and the end row key is appended\nwith a `\\000` suffix, it creates a single row tablet. When this tablet receives\na disproportionately large amount of traffic, it leads to hotspots.\n| **Note:** Hot tablets output is available for tables that contain at least 1 GB of data per cluster. It can take up to an hour after a table reaches that size for lists of hot tablets to be available.\n\nObserving hotspots with minute-level granularity\n\nYou can use a list of hot tablets in combination with Key Visualizer's\n[heatmaps](/bigtable/docs/keyvis-exploring-heatmaps).\nWhile Key Visualizer is a good tool to observe the larger picture of key-space\naccess patterns, `ListHotTablets` provides greater granularity.\n\nAfter inspecting heatmaps in Key Visualizer, you can further explore specific\nhotspots. Because Key Visualizer runs over a period of weeks, its data for\nhotspots is aggregated in 15-minute intervals. Additionally, multiple tablets\nmight be combined in the same Key Visualizer key space.\n\nAfter you've used Key Visualizer to identify the time range that the hotspots\noccurred, you can run `ListHotTablets` for greater granularity in both key and\ntime space. Greater granularity is particularly useful for\n[periodic usage](/bigtable/docs/keyvis-patterns).\n`ListHotTablets` can identify short-lived hotspots that KeyVisualizer cannot.\n\nIdentifying problematic tables within a cluster\n\nBecause Key Visualizer operates at the table level, it's not always the best\nchoice for troubleshooting an issue in a cluster that has multiple tables.\n`ListHotTablets` operates at the cluster level, so you can use it to identify\ntables with high CPU usage and narrow down the problem.\n\nWhat's next\n\n- [Understand Bigtable performance.](/bigtable/docs/performance)\n- [Learn more about Bigtable monitoring.](/bigtable/docs/monitoring-instance)\n- [Work through a tutorial on performance benchmarking.](https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/tree/master/tutorials/bigtable_walkthrough)"]]