Skip to content

Commit 138d702

Browse files
authored
Merge pull request #234096 from AwdotiaRomanowna/20230327-troubleshooting-guides
new guides
2 parents dbe5017 + 924cd3e commit 138d702

File tree

9 files changed

+200
-0
lines changed

9 files changed

+200
-0
lines changed

articles/postgresql/TOC.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,8 @@
502502
href: flexible-server/concepts-pgbouncer.md
503503
- name: Server parameters
504504
href: flexible-server/concepts-server-parameters.md
505+
- name: Troubleshooting guides
506+
href: flexible-server/concepts-troubleshooting-guides.md
505507
- name: Business continuity
506508
items:
507509
- name: Business continuity overview
@@ -689,6 +691,8 @@
689691
href: flexible-server/howto-alert-on-metrics.md
690692
- name: Configure and access logs
691693
href: flexible-server/howto-configure-and-access-logs.md
694+
- name: Troubleshooting guides
695+
href: flexible-server/how-to-troubleshooting-guides.md
692696
- name: Hyperscale (Citus)
693697
items:
694698
- name: Where is Hyperscale (Citus)?
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
title: Troubleshooting Guides for Azure Database for PostgreSQL - Flexible Server Preview
3+
description: Troubleshooting guides for Azure Database for PostgreSQL - Flexible Server.
4+
ms.service: postgresql
5+
ms.subservice: flexible-server
6+
ms.topic: how-to
7+
ms.author: alkuchar
8+
author: AwdotiaRomanowna
9+
ms.date: 03/21/2023
10+
---
11+
12+
# Troubleshooting guides for Azure Database for PostgreSQL - Flexible Server Preview
13+
14+
[!INCLUDE [applies-to-postgresql-flexible-server](../includes/applies-to-postgresql-flexible-server.md)]
15+
16+
> [!NOTE]
17+
> Troubleshooting guides for PostgreSQL Flexible Server are currently in preview.
18+
19+
The Troubleshooting Guides for Azure Database for PostgreSQL - Flexible Server are designed to help you quickly identify and resolve common challenges you may encounter while using Azure Database for PostgreSQL. Integrated directly into the Azure portal, the Troubleshooting Guides provide actionable insights, recommendations, and data visualizations to assist you in diagnosing and addressing issues related to common performance problems. With these guides at your disposal, you'll be better equipped to optimize your PostgreSQL experience on Azure and ensure a smoother, more efficient database operation.
20+
21+
## Overview
22+
23+
The troubleshooting guides available in Azure Database for PostgreSQL - Flexible Server provide you with the necessary tools to analyze and troubleshoot prevalent performance issues,
24+
including:
25+
* High CPU Usage,
26+
* High Memory Usage,
27+
* High IOPS Usage,
28+
* High Temporary Files,
29+
* Autovacuum Monitoring,
30+
* Autovacuum Blockers.
31+
32+
:::image type="content" source="./media/concepts-troubleshooting-guides/overview-troubleshooting-guides.jpg" alt-text="Screenshot of multiple Troubleshooting Guides combined." lightbox="./media/concepts-troubleshooting-guides/overview-troubleshooting-guides.jpg":::
33+
34+
Each guide is packed with multiple charts, guidelines, recommendations tailored to the specific problem you may encounter, which can help expedite the troubleshooting process.
35+
The troubleshooting guides are directly integrated into the Azure portal and your Azure Database for PostgreSQL - Flexible Server, making them convenient and easy to use.
36+
37+
The troubleshooting guides consist of the following components:
38+
39+
- **High CPU Usage**
40+
41+
* CPU Utilization
42+
* Workload Details
43+
* Transaction Trends and Counts
44+
* Long Running Transactions
45+
* Top CPU Consuming queries
46+
* Total User Only Connections
47+
48+
- **High Memory Usage**
49+
50+
* Memory Utilization
51+
* Workload Details
52+
* Long Running Sessions
53+
* Top Queries by Data Usage
54+
* Total User only Connections
55+
* Guidelines for configuring parameters
56+
57+
- **High IOPS Usage**
58+
59+
* IOPS Usage
60+
* Workload Details
61+
* Session Details
62+
* Top Queries by IOPS
63+
* IO Wait Events
64+
* Checkpoint Details
65+
* Storage Usage
66+
67+
- **High Temporary Files**
68+
69+
* Storage Utilization
70+
* Temporary Files Generated
71+
* Workload Details
72+
* Top Queries by Temporary Files
73+
74+
- **Autovacuum Monitoring**
75+
76+
* Bloat Ratio
77+
* Tuple Counts
78+
* Tables Vacuumed & Analyzed Execution Counts
79+
* Autovacuum Workers Execution Counts
80+
81+
- **Autovacuum Blockers**
82+
83+
* Emergency AV and Wraparound
84+
* Autovacuum Blockers
85+
86+
87+
Before using any troubleshooting guide, it is essential to ensure that all prerequisites are in place. For a detailed list of prerequisites, please refer to the [Use Troubleshooting Guides](how-to-troubleshooting-guides.md) article.
88+
89+
### Limitations
90+
91+
* Troubleshooting Guides are not available for [read replicas](concepts-read-replicas.md).
92+
* Please be aware that enabling Query Store on the Burstable pricing tier can lead to a negative impact on performance. As a result, it is generally not recommended to use Query Store with this particular pricing tier.
93+
94+
95+
## Next steps
96+
97+
* Learn more about [How to use Troubleshooting Guides](how-to-troubleshooting-guides.md).
98+
* Learn more about [Troubleshoot high CPU utilization](how-to-high-cpu-utilization.md).
99+
* Learn more about [High memory utilization](how-to-high-memory-utilization.md).
100+
* Learn more about [Troubleshoot high IOPS utilization](how-to-high-io-utilization.md).
101+
* Learn more about [Autovacuum Tuning](how-to-autovacuum-tuning.md).
102+
103+
[//]: # (* Learn how to [create and manage read replicas in the Azure CLI and REST API](how-to-read-replicas-cli.md).)
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
title: Troubleshooting guides - Azure portal - Azure Database for PostgreSQL - Flexible Server Preview
3+
description: Learn how to use Troubleshooting guides for Azure Database for PostgreSQL - Flexible Server from the Azure portal.
4+
ms.service: postgresql
5+
ms.subservice: flexible-server
6+
ms.topic: how-to
7+
ms.author: alkuchar
8+
author: AwdotiaRomanowna
9+
ms.date: 03/21/2023
10+
---
11+
12+
# Use the Troubleshooting guides for Azure Database for PostgreSQL - Flexible Server Preview
13+
14+
[!INCLUDE [applies-to-postgresql-flexible-server](../includes/applies-to-postgresql-flexible-server.md)]
15+
16+
> [!NOTE]
17+
> Troubleshooting guides for PostgreSQL Flexible Server are currently in preview.
18+
19+
In this article, you'll learn how to use Troubleshooting guides for Azure Database for PostgreSQL from the Azure portal. To learn more about Troubleshooting guides, see the [overview](concepts-troubleshooting-guides.md).
20+
21+
## Prerequisites
22+
23+
To effectively troubleshoot specific issue, you need to make sure you have all the necessary data in place.
24+
Each troubleshooting guide requires a specific set of data, which is sourced from three separate features: [Diagnostic settings](howto-configure-and-access-logs.md), [Query Store](concepts-query-store.md), and [Enhanced Metrics](concepts-monitoring.md#enabling-enhanced-metrics).
25+
All troubleshooting guides require logs to be sent to the Log Analytics workspace, but the specific category of logs to be captured may vary depending on the particular guide.
26+
27+
Please follow the steps described in the [Configure and Access Logs in Azure Database for PostgreSQL - Flexible Server](howto-configure-and-access-logs.md) article to configure diagnostic settings and send the logs to the Log Analytics workspace.
28+
Query Store, and Enhanced Metrics are configured via the Server Parameters. Please follow the steps described in the "Configure server parameters in Azure Database for PostgreSQL - Flexible Server" articles for [Azure portal](howto-configure-server-parameters-using-portal.md) or [Azure CLI](howto-configure-server-parameters-using-cli.md).
29+
30+
The table below provides information on the required log categories for each troubleshooting guide, as well as the necessary Query Store, Enhanced Metrics and Server Parameters prerequisites.
31+
32+
| Troubleshooting guide | Diagnostic settings log categories | Query Store | Enhanced Metrics | Server Parameters |
33+
|:----------------------|:--------------------------------------------------------------------------------------------------------------------|----------------------------------------------|-------------------------------------|-------------------|
34+
| Autovacuum Blockers | PostgreSQL Sessions, PostgreSQL Database Remaining Transactions | N/A | N/A | N/A |
35+
| Autovacuum Monitoring | PostgreSQL Server Logs, PostgreSQL Tables Statistics, PostgreSQL Database Remaining Transactions | N/A | N/A | log_autovacuum_min_duration |
36+
| High CPU Usage | PostgreSQL Server Logs, PostgreSQL Sessions, AllMetrics | pg_qs.query_capture_mode to TOP or ALL | metrics.collector_database_activity | N/A |
37+
| High IOPS Usage | PostgreSQL Query Store Runtime, PostgreSQL Server Logs, PostgreSQL Sessions, PostgreSQL Query Store Wait Statistics | pgms_wait_sampling.query_capture_mode to ALL | metrics.collector_database_activity | N/A |
38+
| High Memory Usage | PostgreSQL Server Logs, PostgreSQL Sessions, PostgreSQL Query Store Runtime | pg_qs.query_capture_mode to TOP or ALL | metrics.collector_database_activity | N/A |
39+
| High Temporary Files | PostgreSQL Sessions, PostgreSQL Query Store Runtime, PostgreSQL Query Store Wait Statistics | pg_qs.query_capture_mode to TOP or ALL | metrics.collector_database_activity | N/A |
40+
41+
42+
> [!NOTE]
43+
> Please note that if you have recently enabled diagnostic settings, query store, enhanced metrics or server parameters, it may take some time for the data to be populated. Additionally, if there has been no activity on the database within a certain time frame, the charts might appear empty. In such cases, try changing the time range to capture relevant data. Be patient and allow the system to collect and display the necessary data before proceeding with your troubleshooting efforts.
44+
45+
## Using Troubleshooting guides
46+
47+
To use troubleshooting guides, follow these steps:
48+
49+
1. Open the Azure portal and find a Postgres instance that you want to examine.
50+
51+
2. From the left-side menu, open Help > Troubleshooting guides.
52+
53+
3. Navigate to the top of the page where you will find a series of tabs, each representing one of the six problems you may wish to resolve. Click on the relevant tab.
54+
55+
:::image type="content" source="./media/how-to-troubleshooting-guides/portal-blade-overview.png" alt-text="Screenshot of Troubleshooting guides - tabular view.":::
56+
57+
4. Select the time range during which the problem occurred.
58+
59+
:::image type="content" source="./media/how-to-troubleshooting-guides/time-range.png" alt-text="Screenshot of time range picker.":::
60+
61+
5. Follow the step-by-step instructions provided by the guide. Pay close attention to the charts and data visualizations plotted within the troubleshooting steps, as they can help you identify any inaccuracies or anomalies. Use this information to effectively diagnose and resolve the problem at hand.
62+
63+
### Retrieving the Query Text
64+
65+
Due to privacy considerations, certain information such as query text and usernames may not be displayed within the Azure portal.
66+
To retrieve the query text, you will need to log in to your Azure Database for PostgreSQL - Flexible Server instance.
67+
Access the `azure_sys` database using the PostgreSQL client of your choice, where query store data is stored.
68+
Once connected, query the `query_store.query_texts_view view` to retrieve the desired query text.
69+
70+
In the example shown below, we utilize Azure Cloud Shell and the `psql` tool to accomplish this task:
71+
72+
:::image type="content" source="./media/how-to-troubleshooting-guides/retrieve-query-text.png" alt-text="Screenshot of retrieving the Query Text.":::
73+
74+
### Retrieving the Username
75+
76+
For privacy reasons, the Azure portal displays the role ID from the PostgreSQL metadata (pg_catalog) rather than the actual username.
77+
To retrieve the username, you can query the `pg_roles` view or use the query shown below in your PostgreSQL client of choice, such as Azure Cloud Shell and the `psql` tool:
78+
79+
```sql
80+
SELECT 'UserID'::regrole;
81+
```
82+
83+
:::image type="content" source="./media/how-to-troubleshooting-guides/retrieve-username.png" alt-text="Screenshot of retrieving the Username.":::
84+
85+
86+
## Next steps
87+
88+
* Learn more about [Troubleshoot high CPU utilization](how-to-high-cpu-utilization.md).
89+
* Learn more about [High memory utilization](how-to-high-memory-utilization.md).
90+
* Learn more about [Troubleshoot high IOPS utilization](how-to-high-io-utilization.md).
91+
* Learn more about [Autovacuum Tuning](how-to-autovacuum-tuning.md).
92+
93+
[//]: # (* Learn how to [create and manage read replicas in the Azure CLI and REST API](how-to-read-replicas-cli.md).)
601 KB
Loading
154 KB
Loading
42.3 KB
Loading
129 KB
Loading
83.4 KB
Loading
34.8 KB
Loading

0 commit comments

Comments
 (0)