You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Troubleshooting guides for PostgreSQL Flexible Server are currently in preview.
18
18
19
+
## Overview
20
+
19
21
The troubleshooting guides available in Azure Database for PostgreSQL - Flexible Server provide you with the necessary tools to analyze and troubleshoot prevalent performance issues,
Each guide is packed with multiple charts, guidelines, recommendations tailored to the specific problem you may encounter, which can help expedite the troubleshooting process.
30
33
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.
31
34
32
-
## Prerequisites
33
-
34
-
To effectively troubleshoot specific issue, you need to make sure you have all the necessary data in place.
35
-
Each troubleshooting guide requires a specific set of data, which is sourced from three separate features: Diagnostic settings, Query Store, and Enhanced Metrics.
36
-
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.
37
-
38
-
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.
39
-
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).
40
-
41
-
The table below provides information on the required log categories for each troubleshooting guide, as well as the necessary Query Store and Enhanced Metrics prerequisites.
| High CPU utilization | "PostgreSQL Server Logs", "PostgreSQL Sessions", "AllMetrics" | pg_qs.query_capture_mode to TOP or ALL | metrics.collector_database_activity |
48
-
| High IOPS utilization | "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 |
49
-
| High memory usage | "PostgreSQL Server Logs", "PostgreSQL Sessions" | pg_qs.query_capture_mode to TOP or ALL | metrics.collector_database_activity |
50
-
| High temporary file usage | "PostgreSQL Query Store Runtime", "PostgreSQL Query Store Wait Statistics" | pg_qs.query_capture_mode to TOP or ALL | metrics.collector_database_activity |
51
-
52
-
53
-
54
-
> [!NOTE]
55
-
> When deploying read replicas for persistent heavy write-intensive primary workloads, the replication lag could continue to grow and may never be able to catch-up with the primary. This may also increase storage usage at the primary as the WAL files are not deleted until they are received at the replica.
56
-
57
-
## Create a read replica
58
-
59
-
To create a read replica, follow these steps:
60
-
61
-
1. Select an existing Azure Database for PostgreSQL server to use as the primary server.
62
-
63
-
2. On the server sidebar, under **Settings**, select **Replication**.
64
-
65
-
3. Select **Add Replica**.
66
-
67
-
:::image type="content" source="./media/how-to-read-replicas-portal/add-replica.png" alt-text="Add a replica":::
68
-
69
-
4. Enter the Basics form with the following information.
70
-
71
-
:::image type="content" source="./media/how-to-read-replicas-portal/basics.png" alt-text="Enter the Basics information":::
72
-
73
-
> [!NOTE]
74
-
> To learn more about which regions you can create a replica in, visit the [read replica concepts article](concepts-read-replicas.md).
75
-
76
-
6. Select **Review + create** to confirm the creation of the replica or **Next: Networking** if you want to add, delete or modify any firewall rules.
7. Leave the remaining defaults and then select the **Review + create** button at the bottom of the page or proceed to the next forms to add tags or change data encryption method.
79
-
8. Review the information in the final confirmation window. When you're ready, select **Create**.
80
-
:::image type="content" source="./media/how-to-read-replicas-portal/review.png" alt-text="Review the information in the final confirmation window":::
81
-
82
-
After the read replica is created, it can be viewed from the **Replication** window.
83
-
84
-
:::image type="content" source="./media/how-to-read-replicas-portal/list-replica.png" alt-text="View the new replica in the Replication window":::
85
-
86
-
> [!IMPORTANT]
87
-
> Review the [considerations section of the Read Replica overview](concepts-read-replicas.md#considerations).
88
-
>
89
-
> To avoid issues during promotion of replicas always change the following server parameters on the replicas first, before applying them on the primary: max_connections, max_prepared_transactions, max_locks_per_transaction, max_wal_senders, max_worker_processes.
90
-
91
-
## Promote replicas
92
-
93
-
You can promote replicas to become stand-alone servers serving read-write requests.
94
-
95
-
> [!IMPORTANT]
96
-
> Promotion of replicas cannot be undone. The read replica becomes a standalone server that supports both reads and writes. The standalone server can't be made into a replica again.
97
-
98
-
To promote replica from the Azure portal, follow these steps:
99
-
100
-
1. In the Azure portal, select your primary Azure Database for PostgreSQL server.
101
-
102
-
2. On the server menu, under **Settings**, select **Replication**.
103
-
104
-
3. Select the replica server for which to stop replication and hit **Promote**.
105
-
106
-
:::image type="content" source="./media/how-to-read-replicas-portal/select-replica.png" alt-text="Select the replica":::
107
-
108
-
4. Confirm promote operation.
109
-
110
-
:::image type="content" source="./media/how-to-read-replicas-portal/confirm-promote.png" alt-text="Confirm to promote replica":::
111
-
112
-
## Delete a primary server
113
-
You can only delete primary server once all read replicas have been deleted. Follow the instruction in [Delete a replica](#delete-a-replica) section to delete replicas and then proceed with steps below.
114
-
115
-
To delete a server from the Azure portal, follow these steps:
116
-
117
-
1. In the Azure portal, select your primary Azure Database for PostgreSQL server.
118
-
119
-
2. Open the **Overview** page for the server and select **Delete**.
120
-
121
-
:::image type="content" source="./media/how-to-read-replicas-portal/delete-server.png" alt-text="On the server Overview page, select to delete the primary server":::
122
-
123
-
3. Enter the name of the primary server to delete. Select **Delete** to confirm deletion of the primary server.
124
-
125
-
:::image type="content" source="./media/how-to-read-replicas-portal/confirm-delete.png" alt-text="Confirm to delete the primary server":::
126
-
127
-
## Delete a replica
128
-
129
-
You can delete a read replica similar to how you delete a standalone Azure Database for PostgreSQL server.
130
-
131
-
- In the Azure portal, open the **Overview** page for the read replica. Select **Delete**.
132
-
133
-
:::image type="content" source="./media/how-to-read-replicas-portal/delete-replica.png" alt-text="On the replica Overview page, select to delete the replica":::
134
-
135
-
You can also delete the read replica from the **Replication** window by following these steps:
136
-
137
-
1. In the Azure portal, select your primary Azure Database for PostgreSQL server.
138
-
139
-
2. On the server menu, under **Settings**, select **Replication**.
35
+
The troubleshooting guides consist of the following components:
140
36
141
-
3. Select the read replica to delete and hit the **Delete** button.
37
+
-**High CPU Usage**
142
38
143
-
:::image type="content" source="./media/how-to-read-replicas-portal/delete-replica02.png" alt-text="Select the replica to delete":::
39
+
* CPU Utilization
40
+
* Workload Details
41
+
* Transaction Trends and Counts
42
+
* Long Running Transactions
43
+
* Top CPU Consuming queries
44
+
* Total User Only Connections
144
45
145
-
4. Acknowledge **Delete** operation.
46
+
-**High Memory Usage**
146
47
147
-
:::image type="content" source="./media/how-to-read-replicas-portal/delete-confirm.png" alt-text="Confirm to delete te replica":::
48
+
* Memory Utilization
49
+
* Workload Details
50
+
* Long Running Sessions
51
+
* Top Queries by Data Usage
52
+
* Total User only Connections
53
+
* Guidelines for configuring parameters
148
54
149
-
## Monitor a replica
55
+
-**High IOPS Usage**
150
56
151
-
Two metrics are available to monitor read replicas.
57
+
* IOPS Usage
58
+
* Workload Details
59
+
* Session Details
60
+
* Top Queries by IOPS
61
+
* IO Wait Events
62
+
* Checkpoint Details
63
+
* Storage Usage
152
64
153
-
### Max Physical Replication Lag
154
-
> Available only on the primary.
65
+
-**High Temporary Files**
155
66
156
-
The **Max Physical Replication Lag** metric shows the lag in bytes between the primary server and the most-lagging replica.
67
+
* Storage Utilization
68
+
* Temporary Files Generated
69
+
* Workload Details
70
+
* Top Queries by Temporary Files
157
71
158
-
1. In the Azure portal, select the primary server.
72
+
-**Autovacuum Monitoring**
159
73
160
-
2. Select **Metrics**. In the **Metrics** window, select **Max Physical Replication Lag**.
74
+
* Bloat Ratio
75
+
* Tuple Counts
76
+
* Tables Vacuumed & Analyzed Execution Counts
77
+
* Autovacuum Workers Execution Counts
161
78
162
-
:::image type="content" source="./media/how-to-read-replicas-portal/metrics_max_physical_replication_lag.png" alt-text="Screenshot of the Metrics blade showing Max Physical Replication Lag metric.":::
79
+
-**Autovacuum Blockers**
163
80
164
-
3. For your **Aggregation**, select **Max**.
81
+
* Emergency AV and Wraparound
82
+
* Autovacuum Blockers
165
83
166
-
### Read Replica Lag metric
167
-
> Available only on replicas.
168
84
169
-
The **Read Replica Lag** metric shows the time since the last replayed transaction on a replica. If there are no transactions occurring on your primary, the metric reflects this time lag. For instance if there are no transactions occurring on your primary server, and the last transaction was replayed 5 seconds ago, then the Read Replica Lag will show 5 second delay.
85
+
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.
170
86
171
-
1. In the Azure portal, select read replica.
87
+
### Limitations
172
88
173
-
2. Select **Metrics**. In the **Metrics** window, select **Read Replica Lag**.
89
+
* Troubleshooting Guides are not available for [read replicas](concepts-read-replicas.md).
90
+
* 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.
174
91
175
-
:::image type="content" source="./media/how-to-read-replicas-portal/metrics_read_replica_lag.png" alt-text=" screenshot of the Metrics blade showing Read Replica Lag metric.":::
176
-
177
-
3. For your **Aggregation**, select **Max**.
178
92
179
93
## Next steps
180
94
181
-
* Learn more about [read replicas in Azure Database for PostgreSQL](concepts-read-replicas.md).
95
+
* Learn more about [How to use Troubleshooting Guides](how-to-troubleshooting-guides.md).
96
+
* Learn more about [Troubleshoot high CPU utilization](how-to-high-cpu-utilization.md).
97
+
* Learn more about [High memory utilization](how-to-high-memory-utilization.md).
98
+
* Learn more about [Troubleshoot high IOPS utilization](how-to-high-io-utilization.md).
99
+
* Learn more about [Autovacuum Tuning](how-to-autovacuum-tuning.md).
182
100
183
101
[//]: #(* Learn how to [create and manage read replicas in the Azure CLI and REST API](how-to-read-replicas-cli.md).)
0 commit comments