Alex A
Alex A

Reputation: 343

Did not understand the description in the documentation that affects postgresql max_connections

What does postgresql documentation mean for max_connections - "Defines the maximum number of concurrent connections to the database server"? This refers to the number of users, for example: 1. I have 1 database and 2 servers that pull it "1 database 2 users". or 2. I have 1 database, 1 server and 100 connected clients "1 database 1 user 100 connections". Which of these options is correct and if the first option, how many times in default postgresql can support connected clients?

Upvotes: 1

Views: 42

Answers (1)

svetha.cvl
svetha.cvl

Reputation: 834

max_connections does not depend on the number of client servers you use to connect to the database, and shouldn't necessarily be thought of in terms of users. If max_connections is 100, it means that you can have 100 open connections at once. These connections can be spread across any number of clients. So you may have 50 connections per client and 2 clients, or 10 connections per client and 10 clients.

Both your statements are technically correct if you're using "user" to refer to a client.

PS - Check out connection pools if you're going to have multiple clients.

Upvotes: 2

Related Questions