title: Limit exceeded Max connections Postgres
body: <p>I am running a website running on Django,Postgres and Apache.</p>
  
  <p>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 <code>max_connections</code> affects the simultaneous connections, that can be made at any point of time, to the DB.</p>
  
  <p>The current value in my postgresql.conf is 100.</p>
  
  <p>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.</p>
  
  <p>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).</p>