Skip to content

Commit e4341ad

Browse files
committed
update audit, connection pool
1 parent 45b3306 commit e4341ad

File tree

3 files changed

+27
-10
lines changed

3 files changed

+27
-10
lines changed

articles/postgresql/concepts-audit.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: rachel-msft
55
ms.author: raagyema
66
ms.service: postgresql
77
ms.topic: conceptual
8-
ms.date: 10/14/2019
8+
ms.date: 01/28/2020
99
---
1010

1111
# Audit logging in Azure Database for PostgreSQL - Single Server
@@ -60,10 +60,8 @@ pgAudit allows you to configure session or object audit logging. [Session audit
6060
Once you have [installed pgAudit](#installing-pgaudit), you can configure its parameters to start logging. The [pgAudit documentation](https://github.com/pgaudit/pgaudit/blob/master/README.md#settings) provides the definition of each parameter. Test the parameters first and confirm that you are getting the expected behavior.
6161

6262
> [!NOTE]
63-
> Setting `pgaudit.log_client` to ON will redirect logs to a client process (like psql) instead of being written to file. This setting should generally be left disabled.
64-
65-
> [!NOTE]
66-
> `pgaudit.log_level` is only enabled when `pgaudit.log_client` is on. Also, in the Azure portal, there is currently a bug with `pgaudit.log_level`: a combo box is shown, implying that multiple levels can be selected. However, only one level should be selected.
63+
> Setting `pgaudit.log_client` to ON will redirect logs to a client process (like psql) instead of being written to file. This setting should generally be left disabled. <br> <br>
64+
> `pgaudit.log_level` is only enabled when `pgaudit.log_client` is on.
6765

6866
> [!NOTE]
6967
> In Azure Database for PostgreSQL, `pgaudit.log` cannot be set using a `-` (minus) sign shortcut as described in the pgAudit documentation. All required statement classes (READ, WRITE etc) should be individually specified.
@@ -82,6 +80,22 @@ To learn more about `log_line_prefix`, visit the [PostgreSQL documentation](http
8280
### Getting started
8381
To quickly get started, set `pgaudit.log` to `WRITE`, and open your logs to review the output.
8482
83+
### Viewing audit logs
84+
If you are using .log files, your audit logs will be included in the same file as your PostgreSQL error logs. You can download log files from the Azure [portal](howto-configure-server-logs-in-portal.md) or [CLI](howto-configure-server-logs-using-cli.md).
85+
86+
If you are using Azure diagnostic logging, the way you access the logs depends on which endpoint you choose. For Azure Storage, see the [logs storage account](../azure-monitor/platform/resource-logs-collect-storage.md) article. For Event Hubs, see the [stream Azure logs](../azure-monitor/platform/resource-logs-stream-event-hubs.md) article.
87+
88+
For Azure Monitor Logs, logs are sent to the workspace you selected. The Postgres logs use the **AzureDiagnostics** collection mode, so they can be queried from the AzureDiagnostics table. The fields in the table are described below. Learn more about querying and alerting in the [Azure Monitor Logs query](../azure-monitor/log-query/log-query-overview.md) overview.
89+
90+
You can use this query to get started. You can configure alerts based on queries.
91+
92+
Search for all Postgres logs for a particular server in the last day
93+
```
94+
AzureDiagnostics
95+
| where LogicalServerName_s == "myservername"
96+
| where TimeGenerated > ago(1d)
97+
| where Message contains "AUDIT:"
98+
```
8599
86100
## Next steps
87101
- [Learn about logging in Azure Database for PostgreSQL](concepts-server-logs.md)

articles/postgresql/concepts-limits.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ author: rachel-msft
55
ms.author: raagyema
66
ms.service: postgresql
77
ms.topic: conceptual
8-
ms.date: 06/25/2019
8+
ms.date: 01/28/2020
99
ms.custom: fasttrack-edit
1010
---
1111
# Limits in Azure Database for PostgreSQL - Single Server
1212
The following sections describe capacity and functional limits in the database service. If you'd like to learn about resource (compute, memory, storage) tiers, see the [pricing tiers](concepts-pricing-tiers.md) article.
1313

1414

1515
## Maximum connections
16-
The maximum number of connections per pricing tier and vCores are as follows:
16+
The maximum number of connections per pricing tier and vCores are shown below. The Azure system requires five connections to monitor the Azure Database for PostgreSQL server.
1717

1818
|**Pricing Tier**| **vCore(s)**| **Max Connections** | **Max User Connections** |
1919
|---|---|---|---|
@@ -34,7 +34,10 @@ The maximum number of connections per pricing tier and vCores are as follows:
3434
When connections exceed the limit, you may receive the following error:
3535
> FATAL: sorry, too many clients already
3636
37-
The Azure system requires five connections to monitor the Azure Database for PostgreSQL server.
37+
> [!IMPORTANT]
38+
> For best experience, we recommend that you use a connection pooler like pgBouncer to efficiently manage connections.
39+
40+
A PostgreSQL connection, even idle, can occupy about 10MB of memory. Also, creating new connections takes time. Most applications request many short-lived connections, which compounds this situation. The result is fewer resources available for your actual workload leading to decreased performance. A connection pooler that avoids idle connections and reuses existing connections will help address this. To learn more, visit our [blog post](https://techcommunity.microsoft.com/t5/azure-database-for-postgresql/not-all-postgres-connection-pooling-is-equal/ba-p/825717).
3841

3942
## Functional limitations
4043
### Scale operations

articles/postgresql/concepts-server-logs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ To enable Diagnostic logs using Powershell, CLI, or REST API, visit the [diagnos
6464

6565
### Access diagnostic logs
6666

67-
The way you access the logs depends on which endpoint you choose. For Azure Storage, the schema is described in the [logs storage account](../azure-monitor/platform/resource-logs-collect-storage.md) article. For Event Hubs, see the [stream Azure logs](../azure-monitor/platform/resource-logs-stream-event-hubs.md) article.
67+
The way you access the logs depends on which endpoint you choose. For Azure Storage, see the [logs storage account](../azure-monitor/platform/resource-logs-collect-storage.md) article. For Event Hubs, see the [stream Azure logs](../azure-monitor/platform/resource-logs-stream-event-hubs.md) article.
6868

6969
For Azure Monitor Logs, logs are sent to the workspace you selected. The Postgres logs use the **AzureDiagnostics** collection mode, so they can be queried from the AzureDiagnostics table. The fields in the table are described below. Learn more about querying and alerting in the [Azure Monitor Logs query](../azure-monitor/log-query/log-query-overview.md) overview.
7070

@@ -73,7 +73,7 @@ The following are queries you can try to get started. You can configure alerts b
7373
Search for all Postgres logs for a particular server in the last day
7474
```
7575
AzureDiagnostics
76-
| where LogicalServerName_s == 'myservername'
76+
| where LogicalServerName_s == "myservername"
7777
| where TimeGenerated > ago(1d)
7878
```
7979

0 commit comments

Comments
 (0)