Limit exceeded Max connections Postgres

13,245

Please take a look at the relevant wiki article: http://wiki.postgresql.org/wiki/Number_Of_Database_Connections

In general it's best not to bump max_connections up too much. Use a connection pool like PgBouncer, or a pool inside your server, instead.

Share:
13,245
zephyr
Author by

zephyr

Updated on June 04, 2022

Comments

  • zephyr
    zephyr almost 2 years

    I am running a website running on Django,Postgres and Apache.

    Recently, due to sudden surge in traffic the site came down. On checking server logs i came to know that there was some issue of maximum connections limit exceeded. On looking up more i found out that in postgresql.conf , the parameter max_connections affects the simultaneous connections, that can be made at any point of time, to the DB.

    The current value in my postgresql.conf is 100.

    The event that happened and brought site down is not a commonly occuring event but i want to be prepared the next time it happens again.

    So i am seeking advice for how can i monitor the active connections at any moment on a regular day and to how much i should increase the value of max connections and what other parameters need to be changed parallely as i was seeing that i have to increase other values in postgresql.conf accordingly(like shared buffers etc).