Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
toggle
Joby KJ
To many connection problem with Postgresql
7 de agosto de 2012 8:31
Respuesta

Joby KJ

Ranking: Junior Member

Mensajes: 43

Fecha de incorporación: 13 de julio de 2012

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
David H Nebinger
RE: To many connection problem with Postgresql
7 de agosto de 2012 8:55
Respuesta

David H Nebinger

Community Moderator

Ranking: Liferay Legend

Mensajes: 11261

Fecha de incorporación: 1 de septiembre de 2006

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.
Jack Bakker
RE: To many connection problem with Postgresql
7 de agosto de 2012 20:41
Respuesta

Jack Bakker

Ranking: Liferay Master

Mensajes: 840

Fecha de incorporación: 3 de enero de 2010

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
RE: To many connection problem with Postgresql
9 de agosto de 2012 2:41
Respuesta

Joby KJ

Ranking: Junior Member

Mensajes: 43

Fecha de incorporación: 13 de julio de 2012

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
RE: To many connection problem with Postgresql
20 de agosto de 2012 8:00
Respuesta

Joby KJ

Ranking: Junior Member

Mensajes: 43

Fecha de incorporación: 13 de julio de 2012

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
Jack Bakker
RE: To many connection problem with Postgresql
4 de septiembre de 2012 16:21
Respuesta

Jack Bakker

Ranking: Liferay Master

Mensajes: 840

Fecha de incorporación: 3 de enero de 2010

Mensajes recientes

Hey Joby, glad you've managed the number of connections now.