Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Joby KJ
To many connection problem with Postgresql
7. August 2012 08:31
Antwort

Joby KJ

Rang: Junior Member

Nachrichten: 43

Eintrittsdatum: 13. Juli 2012

Neue Beiträge

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. August 2012 08:55
Antwort

David H Nebinger

Community Moderator

Rang: Liferay Legend

Nachrichten: 11249

Eintrittsdatum: 1. September 2006

Neue Beiträge

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. August 2012 20:41
Antwort

Jack Bakker

Rang: Liferay Master

Nachrichten: 840

Eintrittsdatum: 3. Januar 2010

Neue Beiträge

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. August 2012 02:41
Antwort

Joby KJ

Rang: Junior Member

Nachrichten: 43

Eintrittsdatum: 13. Juli 2012

Neue Beiträge

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. August 2012 08:00
Antwort

Joby KJ

Rang: Junior Member

Nachrichten: 43

Eintrittsdatum: 13. Juli 2012

Neue Beiträge

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. September 2012 16:21
Antwort

Jack Bakker

Rang: Liferay Master

Nachrichten: 840

Eintrittsdatum: 3. Januar 2010

Neue Beiträge

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