[[["易于理解","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。"],[],[],null,["# Troubleshoot high database load with AI assistance\n\n| **Preview**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| You can process personal data for this feature as outlined in the\n| [Cloud Data Processing\n| Addendum](/terms/data-processing-addendum), subject to the obligations and restrictions described in the agreement under\n| which you access Google Cloud.\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis document describes how you can use AI assistance in AlloyDB for PostgreSQL\nto troubleshoot high database load in AlloyDB.\nYou can use the AI assistance capabilities\nof AlloyDB\nand Gemini Cloud Assist to investigate, analyze, obtain recommendations,\nand finally implement those recommendations to optimize your queries in\nAlloyDB.\n\nBy accessing the **Query insights** dashboard in the Google Cloud console, you can\nanalyze your database and troubleshoot events when your system experiences a\nhigher database load than average. AlloyDB uses\nthe 24 hours of data that occurs prior to your selected time range to calculate\nthe expected load of your database. You can look into the reasons for the higher\nload events and analyze the evidence behind reduced performance.\nFinally, AlloyDB provides recommendations for optimizing your\ndatabase to improve performance.\n\nBefore you begin\n----------------\n\nTo troubleshoot high database load with AI assistance, do the following:\n\n1. [Review limitations with AI-assisted troubleshooting](/alloydb/docs/monitor-troubleshoot-with-ai#limitations).\n2. [Enable AI-assisted troubleshooting](/alloydb/docs/monitor-troubleshoot-with-ai#enable-ai-assisted-ts).\n\n### Required roles and permissions\n\nFor the roles and permissions required to troubleshoot high database load with AI assistance,\nsee\n\n[Monitor and troubleshoot with AI](/alloydb/docs/monitor-troubleshoot-with-ai#required-roles-permissions).\n\n\nUse AI assistance\n-----------------\n\nTo use AI assistance with troubleshooting high database load,\ngo to the **Instance Overview** page or the **Query insights** dashboard in\nthe Google Cloud console.\n\n### Instance overview page\n\nTroubleshoot high database load with AI assistance\nin the **Instance overview** page by using the following steps:\n\n1. In the Google Cloud console, go to the **Clusters** page.\n[Go to Clusters](https://console.cloud.google.com/alloydb/clusters)\n2. From the list of clusters and instances, click an instance.\n3. In the **Overview** page, from the **Chart** menu, select a metric for the database. You can select any metric.\n4. Optional: To select a specific analysis time period, use the **Time range** filter to select either 1 hour, 6 hours, 1 day, 7 days, 30 days or a custom range .\n5. You can zoom in to specific sections of the chart where you notice areas of high load that you want to analyze. For example, an area of high load might display CPU utilization levels closer to 100%. To zoom in, click and select a portion of the chart.\n6. Click **Analyze instance performance** to start troubleshooting high database load with AI assistance. This generates the [**Analyzing database load**](#analyze-high-database-load) page.\n\n### Query insights dashboard\n\nTroubleshoot high database load with AI assistance\nin the **Query insights** dashboard using the following steps:\n\n1. In the Google Cloud console, go to the **Clusters** page.\n[Go to Clusters](https://console.cloud.google.com/alloydb/clusters)\n2. From the list of clusters and instances, click an instance.\n3. Click **Query insights** to open the **Query insights** dashboard.\n4. Optional: Use the **Time range** filter to select either 1 hour, 6 hours, 1 day, 7 days, 30 days or a custom range.\n5. You can zoom in to specific sections of the chart where you notice areas of higher database load by query execution time. To zoom in, click and select a portion of the chart.\n6. In the **Database load chart** , click **Analyze instance performance** to start troubleshooting high database load with AI assistance. This generates the [**Analyzing database load**](#analyze-high-database-load) page.\n\nAnalyze high database load\n--------------------------\n\nUsing AI assistance, you can analyze and troubleshoot the details of your\ndatabase load.\n\nIn the **Analyzing database load** page, you can view following details for\nyour AlloyDB instance:\n\n- **Analysis time period**\n- **CPU utilization (p99)**\n- **Memory utilization (p99)**\n\nAlloyDB displays a **Transactions/sec chart**\nwhere you can look at the transactional activity during the selected time\nperiod. You can check for sudden spikes in activity during a particular\ntime period.\n\n### Analysis time period\n\nAlloyDB analyzes your database for the time period that\nyou select in your database load chart from the **Query insights** dashboard\nor the **Instance overview** page. If you select a time period of less\nthan 24 hours, then AlloyDB analyzes the entire time period.\nIf you select a time period greater than 24 hours, then\nAlloyDB selects only the last 24 hours of the time period\nfor analysis.\n\nTo calculate the baseline performance analysis of your database, AlloyDB\nincludes 24 hours of a baseline time period in its analysis time period.\nIf your selected time period occurs on a\nday other than Monday, then AlloyDB\nuses a baseline time period of the *24 hours previous* to your selected time period.\nIf your selected time period occurs on a Monday, then AlloyDB\nuses a baseline time period of the *7th day previous* to your selected time period.\n\n### Situation\n\nWhen AlloyDB starts the analysis, AlloyDB\nchecks for significant changes in the following key metrics:\n\n- Queries per second (QPS)\n- CPU\n- Memory\n- Disk I/O\n\nAlloyDB compares the baseline aggregated data for your database\nwithin the performance data of your analysis time window. If\nAlloyDB detects a significant change in threshold for a key\nmetric, then AlloyDB indicates a possible situation\nwith your database. The identified situation might explain a root cause\nfor the high load on your database over the selected time period.\n\nFor example, one situation for why your database is experiencing high\nload might be identified as **Lock contention**.\n\nDuring analysis, AlloyDB might determine there's\nbeen a significant increase in lock-wait ratio.\nAlloyDB might list other situations where key metrics\nindicate a significant increase. For example, you might also see the\nfollowing situations listed:\n\n- **Contention on system resources**\n- **Insufficient buffer**\n- **Excessive logging**\n\n### Evidence\n\nFor each situation, AlloyDB provides a list of evidence\nto support the finding. AlloyDB bases evidence on\nmetrics gathered from the instance.\n\nEach situation has supporting evidence that's used to detect anomalies in\nsystem performance. AlloyDB detects an anomaly when system\nperformance surpasses certain thresholds or meets specific time-bound criteria.\nAlloyDB defines these thresholds or criteria for each situation.\n\nTo support the situation of **Lock contention**, you might see\nthe following pieces of evidence:\n\n- **Lock wait ratio**: A 40,786.04% increase in lock wait ratio compared to baseline observation period detected.\n\nTo view the evidence retrieved during analysis, click each situation.\nThe evidence appears in the pane next to its corresponding situation.\n\n### Recommendations\n\nBased on all of the situations analyzed, AlloyDB provides you with\none or more actionable recommendations to help remediate the problems of your high\ndatabase load. AlloyDB presents the recommendations with a\ncost-benefit analysis so you can make an informed decision on whether to implement\nthe recommendation.\n\nFor some situations, based on the analysis, there might not a recommendation.\n\nFor example, you might receive the following recommendation:\n\n- **Identify blockers**: Identify potential blocking queries and review them for optimization opportunities.\n\nTo find out how to implement this first recommendation, click the **Learn more** link.\n\nIf you want to continue troubleshooting or get more assistance with system performance,\nthen you can also open [Gemini Cloud Assist](/gemini/docs/cloud-assist/overview).\n\nFor more information, see\n[Monitor and troubleshoot with AI assistance](/alloydb/docs/monitor-troubleshoot-with-ai).\n\n\nWhat's next\n-----------\n\n- [Optimize underprovisioned instances](/alloydb/docs/recommender-optimize-underprovisioned-cluster)\n- [Monitor instances](/alloydb/docs/monitor-instances)"]]