Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Joby KJ
To many connection problem with Postgresql
7 agosto 2012 8.31
Risposta

Joby KJ

Punteggio: Junior Member

Messaggi: 43

Data di Iscrizione: 13 luglio 2012

Messaggi recenti

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 agosto 2012 8.55
Risposta

David H Nebinger

Community Moderator

Punteggio: Liferay Legend

Messaggi: 11101

Data di Iscrizione: 1 settembre 2006

Messaggi recenti

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 agosto 2012 20.41
Risposta

Jack Bakker

Punteggio: Liferay Master

Messaggi: 840

Data di Iscrizione: 3 gennaio 2010

Messaggi recenti

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 agosto 2012 2.41
Risposta

Joby KJ

Punteggio: Junior Member

Messaggi: 43

Data di Iscrizione: 13 luglio 2012

Messaggi recenti

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 agosto 2012 8.00
Risposta

Joby KJ

Punteggio: Junior Member

Messaggi: 43

Data di Iscrizione: 13 luglio 2012

Messaggi recenti

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 settembre 2012 16.21
Risposta

Jack Bakker

Punteggio: Liferay Master

Messaggi: 840

Data di Iscrizione: 3 gennaio 2010

Messaggi recenti

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