In this recipe, we will talk about tuning the connection-related server parameters.
The following are the connection-related parameters that usually require tuning:
listen_addresses
port
max_connections
superuser_reserved_connections
unix_socket_directory
unix_socket_permissions
These parameters can be set to appropriate values in the postgresql.conf
file and these parameter can be set at server start. The changes made to these parameters will only come into effect once the PostgreSQL server is restarted, either using the restart mode of the pg_ctl
command or using the stop mode and then followed by the start mode of the pg_ctl
command. This can be done as follows:
pg_ctl -D $PGDATA restart
Here, $PGDATA
refers to the environment variable that refers to the data directory location of the PostgreSQL server.