Answer the question
In order to leave comments, you need to log in
How to calculate max_client_conn and default_pool_size parameters for pgbouncer given max_connections in PostgreSQL?
Given:
Server CPU Intel i5-3570S 3.1 GHz, RAM 16GB
PostgreSQL 9.1 is installed on it. The max_connections config is set to 200. The same machine has pgbouncer installed.
Question:
How should the max_client_conn and default_pool_size parameters be related to max_connections?
Different sources gave different, sometimes contradictory information. Some have written that max_client_conn should not be greater than max_connections. Others write that max_connections = max_client_conn * default_pool_size. Still others indicate that max_client_conn = 10 * default_pool_size. I'm new to PostgreSQL, so I'm completely confused. I will be very grateful for your help.
Answer the question
In order to leave comments, you need to log in
Depends on pool_mode in pgbouncer.
If pool_mode = session, then max_client_conn = max_connections, there are no options, everything can’t be more exactly, and less doesn’t make sense. If you use this mode, be sure to keep an eye on the number of max_connections.
If pool_mode = transaction, then max_client_conn = 10000 is safe. Don't forget to increase the allowed number of open files: ulimit -n 100000. Set
default_pool_size=20.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question