We've had two downtimes in the last 2 weeks. After some investigation, we found that there may be a problem with the connection pool(s) coming out of the front-ends.
When we look in the logs after the system goes down, we notice that we get this error message:
After some Google-Fu we came across a few threads that seem to suggest that there is a problem with the implementation of the Hikari Connection Pool. My guess is that the pool somehow gets exhausted or incorrectly times-out.
https://github.com/brettwooldridge/HikariCP/issues/104
https://github.com/brettwooldridge/HikariCP/wiki/About-Pool-Sizing
https://github.com/brettwooldridge/HikariCP/issues/256
https://www.postgresql.org/message-id/1395487594923...@n5.nabble.com
I've also printed a copy of our relevant JDBC connection details from sakai.properties and our my.cnf file from the MariaDB database.
# mysql setup
hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
ven...@org.sakaiproject.db.api.SqlService=mysql
driverC...@javax.sql.BaseDataSource=com.mysql.jdbc.Driver
u...@javax.sql.BaseDataSource=***OVERRIDE IN LOCAL.PROPERTIES***
user...@javax.sql.BaseDataSource=***OVERRIDE IN LOCAL.PROPERTIES***
pass...@javax.sql.BaseDataSource=***OVERRIDE IN LOCAL.PROPERTIES***
testOn...@javax.sql.BaseDataSource=false
validat...@javax.sql.BaseDataSource=select 1 from DUAL
#validat...@javax.sql.BaseDataSource=select 1 from DUAL
defaultTransacti...@javax.sql.BaseDataSource=TRANSACTION_READ_COMMITTED
initi...@javax.sql.BaseDataSource=300
maxA...@javax.sql.BaseDataSource=300
max...@javax.sql.BaseDataSource=300
min...@javax.sql.BaseDataSource=0
Any help on this issue would be greatly appreciated!
Thank you,
William Karavites
Here's also some of our InnoDB statuses. I've also attached the FULL innodb status output from MariaDB.
and other pertinent mysql ones
Matt,
Thanks for the advice. I'll doublecheck our connections shortly and see what we find.
What would you recommend we increase maxActive to? 450?
-Will
Hi there,
How does `maximumPoolSize` factor into this? The Hikari docs say:
maximumPoolSize
This property controls the maximum size that the pool is allowed to reach, including both idle and in-use connections. Basically this value will determine the maximum number of actual connections to the database backend. A reasonable value for this is best determined by your execution environment. When the pool reaches this size, and no idle connections are available, calls to getConnection() will block for up to connectionTimeout milliseconds before timing out. Default: 10
And the Sakai default looks to be 10 as well. Does Hikari pay attention to the maxActive setting at all?
Mark
Matthew Jones <mat...@longsight.com> writes:
Similar issues with the poll were discussed on the sakai-user list a few weeks ago and that increasing maxActive fixed it. I would connect with JMX to verify that maxActive is actually set correctly and not being set to the default and you can monitor the JMX value of TotalConnections over time too. Just use visualvm and look at the com.zaxxer.hikari.Pool. [2]
I mean if the value really is 300 and it's going up to 300 connections that seems pretty unusual. I'd make sure to upgrade to the latest hikaricp (which right now looks to be 2.5.0 but I haven't tried that yet as Sakai is still at 2.4.6) as it has better options for leak detection too.
2.4.7 had 47 commits
https://github.com/brettwooldridge/HikariCP/compare/HikariCP-2.4.7...dev 2.4.8 had 30 commits
https://github.com/brettwooldridge/HikariCP/compare/HikariCP-2.4.8...devIt says 2.4.8 and 2.5.0 are identical but 2.5.0 just is named different and requires Java 8.
[1]
https://groups.google.com/a/apereo.org/forum/#!topic/sakai-user/YDhwK8ICqHc [2] https://jira.sakaiproject.org/browse/KNL-1437On Tue, Sep 20, 2016 at 4:05 PM William Karavites <will...@oit.rutgers.edu> wrote:
Here's also some of our InnoDB statuses. I've also attached the FULL innodb status output from MariaDB.
-- Mark Triggs <ma...@dishevelled.net>
Matt,
How would you recommend setting up JMX? I've never done it myself.
I'm trying to follow this thread and access the machine using Visual VM (over a VPN). It seems to be timing out and when I try accessing it using jconsole I'm getting a java memory exception. I'll have to give it a shot when I get into the actual office tomorrow.
-Will