ARTIFACTORY: How to enable debug logging for HikariCP connection pool

ARTIFACTORY: How to enable debug logging for HikariCP connection pool

AuthorFullName__c
Matthew Wang
articleNumber
000005375
ft:sourceType
Salesforce
FirstPublishedDate
2022-08-17T08:45:13Z
lastModifiedDate
2022-08-17
VersionNumber
5

Artifactory uses HikariCP as a JDBC connection pooling framework. Sometimes, you may see an error like the below:

HikariCP Main - Connection is not available, request timed out after 120000ms

This error may be due to the connection pool being maxed out. You can enable debug logging in the $JFROG_HOME/var/etc/artifactory/logback.xml for Artifactory or $JFROG_HOME/var/etc/access/logback.xml for Access to see the number of connections used in the pool.

<logger name="com.zaxxer.hikari.pool.HikariPool" level="TRACE"/>


No restart is required. If the pool is maxed out, you would see log lines like the below in the artifactory-service.log or access-service.log:

2022-07-21T18:42:50.089Z [jfac ] [DEBUG] [2fb3345c61f92871] [c.z.h.p.HikariPool:421        ] [.0.1-8040-exec-27906] - HikariCP Main - Timeout failure stats (total=100, active=100, idle=0, waiting=119)


If you see the pool maxed out, you can increase the number of connections in the system.yaml for the respective microservice log you found the log message, or investigate long running queries on the DB. 

You can increase the database connections in the $JFROG_HOME/var/etc/system.yaml (remember to increase corresponding max connections on DB side):
 

artifactory:
  database:
    maxOpenConnections: 300
...    
access:
  database:
    maxOpenConnections: 300

https://jfrog.com/knowledge-base/how-do-i-tune-artifactory-for-heavy-loads/