title: AWS RDS (Postgres): max connections
body: <p>I am working on tuning the AWS RDS (Postgres) performance. </p>
  
  <p>With the current setting (default), </p>
  
  <p>db.t2.micro</p>
  
  <p>max_connections: {DBInstanceClassMemory/31457280} // => about 34 connections</p>
  
  <p>I ran performance test using Gatling, with 100 concurrent requests (one request one connection). Report showed that 78 successful requests, 22 failed requests.</p>
  
  <p>I have few questions:</p>
  
  <p>1/ How can RDS support up to 78 connections while the max_connections is 34?</p>
  
  <p>2/ Is there any dynamic way to adjust the max_connections when the number of request exceeds the max_connections?</p>
  
  <p>Note: I know how to change the value of max_connections by hardcode.</p>