Search code examples
playframeworkslickhikaricp

How to set HikariCP pool size with Play


What is the correct way to configure the pool size of HikariCP for Play w/ and w/o Slick?

I've tried this with slick:

slick.dbs.default.db.minimumIdle=30
slick.dbs.default.db.maximumPoolSize=30

(other properties like connectionTestQuery seem to work this way)

And w/o Slick I've tried various combinations of:

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

And:

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

I've seen the documentation, but nothing seems to stick.


Solution

  • I think the correct syntax is

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

    but this does not seem to work with Slick

    Furthermore, be aware that any configuration under play.db is not considered by Play Slick.

    You can try something like

    slick.dbs.default.db.numThreads=30
    slick.dbs.default.db.queueSize=30