Foros de discusión

To many connection problem with Postgresql

Joby KJ, modificado hace 11 años.

To many connection problem with Postgresql

Junior Member Mensajes: 43 Fecha de incorporación: 13/07/12 Mensajes recientes
Hi,
I am using liferay 6.0 with postgresql 8.4 . We are facing some problem with database connectivity . When more than one user using our portal , the database connections is increasing and the system got stuck . Most of our contents are web content and images . We are accessing database configuring portal.properties . We are not accessing any other database . Please advise.


Thank You
Joby
thumbnail
David H Nebinger, modificado hace 11 años.

RE: To many connection problem with Postgresql

Liferay Legend Mensajes: 14916 Fecha de incorporación: 2/09/06 Mensajes recientes
Liferay uses c3p0 for connection pooling. The pool will create additional connections when a connection is required but not available. You can control the connection pooling through portal-ext.properties, but I certainly wouldn't want to hit your site if you are only allowing a single database connection (performance would simply suck).

Your solution lies in figuring out why postgres is choking on having multiple connections.
thumbnail
Jack Bakker, modificado hace 11 años.

RE: To many connection problem with Postgresql

Liferay Master Mensajes: 978 Fecha de incorporación: 3/01/10 Mensajes recientes
have you modified max_connections or other changes in postgresql.conf ?
have you any c3p0 (or other connection pool) properties in your portal-ext.properties ?
do u have just one Liferay install connecting to the the one lportal pg database ?
Joby KJ, modificado hace 11 años.

RE: To many connection problem with Postgresql

Junior Member Mensajes: 43 Fecha de incorporación: 13/07/12 Mensajes recientes
Hi,

1) No

2) We are using The default provider is C3PO.
#
jdbc.default.liferay.pool.provider=c3po
#jdbc.default.liferay.pool.provider=dbcp
#jdbc.default.liferay.pool.provider=primrose

#
# The following properties will be read by C3PO if Liferay is configured to
# use C3PO in the property "jdbc.default.liferay.pool.provider". See
# http://www.mchange.com/projects/c3p0/index.html#configuration for a list
# of additional fields used by C3PO for configuring database connections.
#
jdbc.default.acquireIncrement=5
jdbc.default.connectionCustomizerClassName=com.liferay.portal.dao.jdbc.pool.c3p0.PortalConnectionCustomizer
jdbc.default.idleConnectionTestPeriod=60
jdbc.default.maxIdleTime=3600
jdbc.default.maxPoolSize=100
jdbc.default.minPoolSize=10
jdbc.default.numHelperThreads=3
#jdbc.default.transactionIsolation=1


3) only one Liferay install
Joby KJ, modificado hace 11 años.

RE: To many connection problem with Postgresql

Junior Member Mensajes: 43 Fecha de incorporación: 13/07/12 Mensajes recientes
Thanks for the pointer.

Issue is related to connection pool sizes setting causing quick consumption of connections from the DB, and reaching the max_connections (100) set in PostgreSQL Server. There after any further request for getting connection results in "Too many connections" error.

In fact there were other applications, and PgAdmin tool connecting to the same database that resulted in reaching that condition earlier than what the settings conveyed

# "Too many connections" setting
jdbc.default.maxPoolSize=100
jdbc.default.minPoolSize=10


# Setting that fixed the issue
jdbc.default.maxPoolSize=50
jdbc.default.minPoolSize=10
jdbc.default.maxIdleTimeExcessConnections=60

The issue is now fixed
thumbnail
Jack Bakker, modificado hace 11 años.

RE: To many connection problem with Postgresql

Liferay Master Mensajes: 978 Fecha de incorporación: 3/01/10 Mensajes recientes
Hey Joby, glad you've managed the number of connections now.