DEV Community

Cover image for Setting and Displaying Patroni's Max Connection Count
Doğukan Eren for OpenLAB

Posted on

Setting and Displaying Patroni's Max Connection Count

Patroni configuration are mainly stored in patroni.yaml. Find the path of that yaml.

Not: Patroni configurations are primarily stored in patroni.yaml. Find the path to that YAML file.

This command lists Patroni clusters and hosts.

patronictl -c /etc/patroni.yml list
Enter fullscreen mode Exit fullscreen mode

To edit PostgreSQL settings in Patroni, you can use the 'edit-config' command.

patronictl -c /etc/patroni.yaml edit-config
Enter fullscreen mode Exit fullscreen mode

Modify the 'max_connections' line within 'postgresql.parameters', and create it if it does not already exist.

.
postgresql
  parameters
    max_connections: 200
.
Enter fullscreen mode Exit fullscreen mode

To display the maximum monitor count, you can connect to your Patroni cluster using psql, and then run the script below to show the maximum connection count.

To query to patroni server we can use below comamnd:

psql -h <patroni_ha_ip> -U <username> -p <ha_db_port> -W
Enter fullscreen mode Exit fullscreen mode

On psql

SHOW max_connections;
Enter fullscreen mode Exit fullscreen mode

OR

SELECT current_setting('max_connections');
Enter fullscreen mode Exit fullscreen mode

Top comments (0)