[2.4] How to set HikariCP pool size?

349 views
Skip to first unread message

Joe Kutner

unread,
Dec 15, 2015, 6:24:02 PM12/15/15
to play-framework
What is the correct way to configure the pool size of HikariCP for Play w/o Slick?

I've tried many combinations of:

play.db.default.minimumIdle=30
play
.db.default.maximumPoolSize=30

and:

play.db.default.hikaricp.minimumIdle=30
play
.db.default.hikaricp.maximumPoolSize=30

and:

db.default.hikaricp.minimumIdle=30
db
.default.hikaricp.maximumPoolSize=30

and:

play.db.default.prototype.hikaricp.minimumIdle=30
play
.db.default.prototype.hikaricp.maximumPoolSize=30

...to no avail.

I've also seen these docs:
https://www.playframework.com/documentation/2.4.x/SettingsJDBC
https://github.com/brettwooldridge/HikariCP/blob/dev/README.md#configuration-knobs-baby

-joe

Joe Kutner

unread,
Dec 18, 2015, 8:46:08 AM12/18/15
to play-framework
tl;dr: the correct format is

db.default.hikaricp.minimumIdle=30
db
.default.hikaricp.maximumPoolSize=30

The reason it was difficult to figure this out is that HikariCP was throttling the size of my pool to meet my DB connection limit. Thus, the pool size was actually 20 when I set it to 30. I confirmed this by enabling MBeans, and inspecting the pool at runtime.

db.default.hikaricp.registerMbeans=true

You can easily view it in JConsole this way.

I've inquired about this on the HikariCP list, but have not got a response:
https://groups.google.com/forum/#!topic/hikari-cp/cuC7UnbF7oY
Reply all
Reply to author
Forward
0 new messages