

So contact application developers to close database connections opened to Amazon Redshift database as soon as possible.Īn appropriate method call for your programming language and library used similar to below should be called. Log in to the default user account and create all the required users. When I checked for the Amazon Redshift error connection limit "498" exceeded for non-superusers, I see that a few AWS Lambda functions are establishing database connections to Redshift databases but not closing the database connection after they finish their tasks. When Redshift data warehouse administrators execute above ALTER USER command with a number of connections limit, existing open connections will reduce step by. But when it comes to database connections there is not a solution which is so effective to drop unused database connections. Garbage collectors are used to remove unused objects from memory. Running SET SESSION AUTHORIZATION in Redshift requires the initial connection user to be a superuser.

This is a known issue and valid for all database platforms. In fact, if database users are programmatically accessing to databases programmatically and if the opened database connections are not closed properly these connections are left idle and in open state. The outcome of the above SQL query shows that especially one of the database users has an excessive number of database connections open.
