Created
July 2, 2018 20:42
-
-
Save D4v1X/68b5b210534957f246b121178ff984a3 to your computer and use it in GitHub Desktop.
application conf database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Number of database connections | |
# See https://github.com/brettwooldridge/HikariCP/wiki/About-Pool-Sizing | |
# db connections = ((physical_core_count * 2) + effective_spindle_count) | |
fixedConnectionPool = 9 | |
## Database Connection Pool | |
# https://www.playframework.com/documentation/latest/SettingsJDBC | |
play.db { | |
# The combination of these two settings results in "db.default" as the | |
# default JDBC pool: | |
config = "db" | |
default = "default" | |
# Play uses HikariCP as the default connection pool. You can override | |
# settings by changing the prototype: | |
prototype { | |
# Sets a fixed JDBC connection pool size of 50 | |
hikaricp.minimumIdle = ${fixedConnectionPool} | |
hikaricp.maximumPoolSize = ${fixedConnectionPool} | |
} | |
} | |
## JDBC Datasource | |
# https://www.playframework.com/documentation/latest/ScalaDatabase | |
db { | |
# You can declare as many datasources as you want. | |
# By convention, the default datasource is named `default` | |
default { | |
driver = org.postgresql.Driver | |
url=${?JDBC_DATABASE_URL} | |
username=${?JDBC_DATABASE_USERNAME} | |
password=${?JDBC_DATABASE_PASSWORD} | |
logSql=true | |
} | |
} | |
# Job queue sized to HikariCP connection pool | |
database.dispatcher { | |
executor = "thread-pool-executor" | |
throughput = 1 | |
thread-pool-executor { | |
fixed-pool-size = ${fixedConnectionPool} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment