How to select the right instance based on the user capacity for PostgreSQL DB

Kamal Sekhar C 0 Reputation points
2023-07-20T11:56:54.9766667+00:00

CPU and Memory capacity recommendations for Azure PostgreSQL

6 Lakhs users expected to be onboarded. Kindly advise the right capacity recommendations.

Azure Database for PostgreSQL
{count} votes

1 answer

Sort by: Most helpful
  1. ShaktiSingh-MSFT 16,236 Reputation points
    2023-07-21T05:23:09.53+00:00

    Hi Kamal Sekhar C •.

    Welcome to Microsoft Q&A forum and thanks for using Azure Services.

    As I understand, you want to know How to select the right instance based on the user capacity for PostgreSQL DB.

    Every PostgreSQL connection (even idle ones) uses at least 10 MB of memory, so it's important to limit simultaneous connections. Here are the limits we chose to keep nodes healthy:

    • Maximum connections per node
    • 300 for 0-3 vCores
    • 500 for 4-15 vCores
    • 1000 for 16+ vCores
    • Maximum connections per node with burstable compute
    • 20 for 1 vCore burstable
    • 40 for 2 vCores burstable

    The connection limits above are for user connections (max_connections minus superuser_reserved_connections). We reserve extra connections for administration and recovery.

    The limits apply to both worker nodes and the coordinator node. Attempts to connect beyond these limits fails with an error.

    Connection pooling

    You can scale connections further using connection pooling. Azure Cosmos DB for PostgreSQL offers a managed pgBouncer connection pooler configured for up to 2,000 simultaneous client connections.

    Please go through the Maximum Connections table mentioned here: https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-limits

    Refer How to Find the Optimal Database Connection Pool Size

    and https://learn.microsoft.com/en-us/azure/postgresql/hyperscale/moved?tabs=direct if suits to your requirement.

    Thank you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.