DEV Community

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

Posted on

5

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

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (0)

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay