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

API Trace View

How I Cut 22.3 Seconds Off an API Call with Sentry 👀

Struggling with slow API calls? Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more →

Top comments (0)

Billboard image

Try REST API Generation for Snowflake

DevOps for Private APIs. Automate the building, securing, and documenting of internal/private REST APIs with built-in enterprise security on bare-metal, VMs, or containers.

  • Auto-generated live APIs mapped from Snowflake database schema
  • Interactive Swagger API documentation
  • Scripting engine to customize your API
  • Built-in role-based access control

Learn more

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay