Exceeded maximum limit of 5 connections. Connection refused - db2

I want to drop a table in IBM Db2 on cloud but I receive this error:
Exceeded maximum limit of 5 connections. Connection refused
What should I have to do?

Related

Azure postgres flexible server and pgbouncer max connections

I have an Azure postgresql flexible server running a General Purpose, D2s_v3, 2 vCores, 8 GiB RAM, 32 GiB storage instance and using pg_bouncer for connection pooling.
At all time there are 100 active connections and when I try to connection (not using the pgbouncer) I get the error Remaining connection slots are reserved. I can also see that there are sporadic errors on connecting that looks to be from pgbouncer as there are not failed connections on the postgresql server.
The server is configured with:
max_connections = 100
pgbouncer.default_pool_size = 50
pgbouncer.max_client_conn = 5000
pgbouncer.min_pool_size = 0
pgbouncer.pool_mode = TRANSACTION
Should the max connections be increased or is there some other configuration that should be adjusted such that pgbouncer don't allocate all connections?

Why cannot I have more than 10 concurrent connections to a Postgres RDS database

After 10 connections to a Postgres RDS database I start getting error - Too Many Connections or Timed-out waiting to acquire database connection.
But when I check max_connections it shows 405. pg_roles shows -1 as rollconnlimit. If none of the ceilings are hit why can I not have more than 10 concurrent connections for that user?
A comment from #jjanes on another question gave me a pointer.. the bottleneck was datconnlimit setting from pg_database. Changing it using query below fixed the issue:-
ALTER DATABASE mydb with CONNECTION LIMIT 50

Getting "FATAL: sorry, too many clients already" when the max_connections number is not reached

When I try to login to the PostgreSQL database I get the error "FATAL: sorry, too many clients already". I checked the number of the connections from another already opened session with the sql select sum(numbackends) from pg_stat_database where datname = '$dbname';, the number is only 13. But the max_connections is set to 100. How can the error happen when the max_connections is not reached?
The PostgreSQL server is a read replica instance running in the Docker container. I've verified the max_connections value by running show max_connections;. Also, the error seems random to me because sometimes I tried to open as many connections as possible to test the limit and it can open 100 connections then throw the error after that.
It turns out the reason was that the IO was occupied fully and it was almost not responding. Then it threw the error "FATAL: sorry, too many clients already" despite the max connections was not reached.

Postgresql: Max connections: set application name eating connections

many connections in PostgreSQL that eating connections limit, many of them named: PostgreSQL JDBC Driver, with a query: SET application_name = 'PostgreSQL JDBC Driver', please find attached image.
causing: FATAL: sorry, too many clients already.
max connections were 100, and I have increased to 150, but not solved!
note that I am using ThingWorx platform which connects to PostgreSQL.
if the connection property "assumeMinServerVersion" is set to at least 9.0 then the application_name will be set just in the start up packet
jdbc:postgresql://<db_address>:5432/<db_name>?assumeMinServerVersion=9.4

How to identify and re-establish the PostgreSQL connection based on the PostgreSQL server status?

A PostgreSQL connection will be established once the project started running.
The same connection is used by multiple threads for database operations (insertion,selection etc.).
The connection will be gone once the server is down.
Then how to identify it and re-establish the connection as soon as the server is up?