Amazon RDS (postgres) connection limit?

If you setup a PostgreSQL RDS instance you can query for max_connections:

select * from pg_settings where name='max_connections';

max_connections is set to 5696.


You can change the max_connections. Make a clone of the default parameters. Then change the value and save and set the instance group to the new options group and finally reboot your instance to make the setting take effect.

enter image description here


Afaik the 'max_connections' returned above is actually the current value of max_connections as set in the ParameterGroup. I wanted to know how to dynamically figure out the max possible connections of a given Postgres instance in AWS, but for some reason could not even find an info sheet from AWS. However, I noticed that AWS console RDS section shows you a progress bar of your current connections vs total possible:

Snapshot from AWS console

Examining this in Google Chrome Tools, I have established that the blue part is 4 pixels wide, while the total width of the progress bar is 50 pixels, which means that my current 121 connections constitute roughly 8% of total, which gives an approximation of max possible connections for my db.r3.large instance at 1512.


Simply with show max_connections;

You can modify this value on the Parameter Groups on the RDS console. The value of max_connections in the default postgres9.3 Parameter Group is {DBInstanceClassMemory/12582880}. In version 9.4 the default value is {DBInstanceClassMemory/31457280}.

Tags:

Amazon Rds