FATAL: sorry, too many clients already
I am trying to connect to PostgreSQL and I am getting this error a while after I restart the database.
11 Replies
Project ID:
N/A
whatever is using the database is opening too many connections and not closing them
Is there a way of increasing the max connection on railway?
of course, but you would just run into the issue again, you need to close the connections after you are done with them, preferably use a connection pool
According to what I have read from Hibernate, I guess I am doing that
the default limit is 100 connections, if you are hitting that limit then something is wrong with the code
and if you're hitting that 100 connection limit, increasing the limit would only delay you from hitting the new limit.
of course there are actual cases where you do need 100 or more connections, in that case you want to use pgpool, but I have a good feeling you don't need a lot of connections and it's just a code bug
how can I decrease that 100 limit?
why would you want to decrease it? the default is fine you just got some debugging to do is all
some hardcore nasty debugging by decreasing it 💀