In the previous recipe, Creating a pgBouncer configuration file, we saw some of the mandatory settings for pgBouncer to start. However, the importance of pgBouncer is seen when some of the connection pool-specific settings are set correctly. In this recipe, we shall discuss the best ways of configuring the pool-specific parameters.
Getting ready...
In order to proceed further with the steps in this recipe, we must have already installed pgBouncer using the first recipe Installing pgBouncer on a Linux server, and also configured the mandatory settings as specified in the recipe Creating a pgBouncer configuration file.
How to do it...
The following is the list of parameters that we should configure to set the pool settings correctly:
- If the nature of the connections from the client supports the transaction mode, set pool_mode to transaction. Otherwise, leave it as the session mode, which is the default:
$ sudo vi /etc/pgbouncer/pgbouncer.ini
...