Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Joby KJ
To many connection problem with Postgresql
August 7, 2012 8:31 AM
Answer

Joby KJ

Rank: Junior Member

Posts: 43

Join Date: July 13, 2012

Recent Posts

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
August 7, 2012 8:55 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 6704

Join Date: September 1, 2006

Recent Posts

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
August 7, 2012 8:41 PM
Answer

Jack Bakker

Rank: Liferay Master

Posts: 559

Join Date: January 3, 2010

Recent Posts

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
August 9, 2012 2:41 AM
Answer

Joby KJ

Rank: Junior Member

Posts: 43

Join Date: July 13, 2012

Recent Posts

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
August 20, 2012 8:00 AM
Answer

Joby KJ

Rank: Junior Member

Posts: 43

Join Date: July 13, 2012

Recent Posts

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
September 4, 2012 4:21 PM
Answer

Jack Bakker

Rank: Liferay Master

Posts: 559

Join Date: January 3, 2010

Recent Posts

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