Vivek Shankar
Vivek Shankar

Reputation: 701

Postgresql too many clients error on linux server

when i try connect postgresql 9.0 server on linux i get too many clients connected already. I tried increasing max_connections from 100 to 200 and start the server it doest take the max connections. What should i change on the linux server

Eclipse LogCat

Caused by: org.postgresql.util.PSQLException: FATAL: sorry, too many clients already
       at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:291)
       at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:108)
       at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
       at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
       at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
       at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:22)

Upvotes: 0

Views: 2170

Answers (2)

Craig Ringer
Craig Ringer

Reputation: 324265

This is a bit of a FAQ and is discussed in Number of Database Connections on the PostgreSQL wiki.

Upvotes: 2

Federico Cristina
Federico Cristina

Reputation: 2223

The only way to increase max_connections and persist this value is modifying the postgresql.conf file, so first of all, check if the value has changed (after restarting the server):

show max_connections

If the value DID NOT change, there's something wrong with your procedure (file permissions maybe?). If the value DID change, you might try with a higher value (weird, but might depend on your application connection requirements, OR a connection leak).

Upvotes: 0

Related Questions