Fórumok

MySQL connection pool closing

Jason Pecsek, módosítva 10 év-val korábban

MySQL connection pool closing

New Member Bejegyzések: 5 Csatlakozás dátuma: 2012.09.06. Legújabb bejegyzések
I don't know if this is a Liferay specific question or more of a database debugging question.

I am running 6.1.20-ee-ga2 with two MySQL clustered databases. Questions have been brought up by the DBA about the connection pooling. He is concerned that connections are being opened but not being closed, resulting in connection issues with the application servers.

I was asked to review the source code to see what methods may be used to perform the connection cleaup. I am not entirely sure what I am looking for. Have been reviewing the code but have not found a "smoking gun". Also is there any way to monitor the connections being made and being closed?

I am not a DBA so please excuse me if this question is not properly constructed.
thumbnail
Daniel Tyger, módosítva 10 év-val korábban

RE: MySQL connection pool closing

Regular Member Bejegyzések: 105 Csatlakozás dátuma: 2013.02.06. Legújabb bejegyzések
Jason Pecsek:
... Also is there any way to monitor the connections being made and being closed ,


In mysql, you can use SHOW PROCESSLIST;

This SO article also addresses this part:
http://stackoverflow.com/questions/1620662/mysql-see-all-open-connections-to-a-given-database

This article also looks relevant:
http://stackoverflow.com/questions/4284194/terminating-idle-mysql-connections

But I realize this is not helping you review Liferay source code surrounding connection pooling.

Did you try this with a single/non-clustered database first and have the same pooling connections issue? This might help you tie the issue to clustering the dbs as when the problem is introduced...

This blog entry may also be of interest:
https://www.liferay.com/web/pmesotten/blog/-/blogs/database-connection-pool-sharing-between-portal-and-portlets
Jason Pecsek, módosítva 10 év-val korábban

RE: MySQL connection pool closing

New Member Bejegyzések: 5 Csatlakozás dátuma: 2012.09.06. Legújabb bejegyzések
Thank you for all of the information. I will investigate further.
thumbnail
Murali Krishna, módosítva 10 év-val korábban

RE: MySQL connection pool closing

Junior Member Bejegyzések: 47 Csatlakozás dátuma: 2012.01.17. Legújabb bejegyzések
HI,

you can look into the server status in mysql work bench for how many connections currently running and how many connections are open.

Murali
sravan kumar, módosítva 10 év-val korábban

RE: MySQL connection pool closing

Junior Member Bejegyzések: 78 Csatlakozás dátuma: 2013.02.19. Legújabb bejegyzések
i think you can property in portal-ext.properties file

hibernate.connection.release_mode=on_close
thumbnail
Mika Koivisto, módosítva 10 év-val korábban

RE: MySQL connection pool closing

Liferay Legend Bejegyzések: 1519 Csatlakozás dátuma: 2006.08.07. Legújabb bejegyzések
By definition connection pool will pool and reuse the connections hence not closing them after it's returned to pool. By configuring the connection pool you can limit how many connections will be made.