|
@@ -24,8 +24,26 @@ internal class BenchmarkSqlStore(engine: String, private val settings: Settings
|
|
val dbHost = Jvm.systemSettingOrNull("${engine.uppercase()}_DB_HOST") ?: "localhost"
|
|
val dbHost = Jvm.systemSettingOrNull("${engine.uppercase()}_DB_HOST") ?: "localhost"
|
|
val environment = Jvm.systemSettingOrNull(String::class, "BENCHMARK_ENV")?.lowercase()
|
|
val environment = Jvm.systemSettingOrNull(String::class, "BENCHMARK_ENV")?.lowercase()
|
|
val poolSize = 8 + if (environment == "citrine") Jvm.cpuCount else Jvm.cpuCount * 2
|
|
val poolSize = 8 + if (environment == "citrine") Jvm.cpuCount else Jvm.cpuCount * 2
|
|
|
|
+ val postgresqlSettings = listOf(
|
|
|
|
+ "useSSL=false",
|
|
|
|
+ "jdbcCompliantTruncation=false",
|
|
|
|
+ "elideSetAutoCommits=true",
|
|
|
|
+ "useLocalSessionState=true",
|
|
|
|
+ "cachePrepStmts=true",
|
|
|
|
+ "cacheCallableStmts=true",
|
|
|
|
+ "alwaysSendSetIsolation=false",
|
|
|
|
+ "prepStmtCacheSize=4096",
|
|
|
|
+ "cacheServerConfiguration=true",
|
|
|
|
+ "prepStmtCacheSqlLimit=2048",
|
|
|
|
+ "traceProtocol=false",
|
|
|
|
+ "useUnbufferedInput=false",
|
|
|
|
+ "useReadAheadInput=false",
|
|
|
|
+ "maintainTimeStats=false",
|
|
|
|
+ "useServerPrepStmts=true",
|
|
|
|
+ "cacheRSMetadata=true"
|
|
|
|
+ ).joinToString("&")
|
|
val config = HikariConfig().apply {
|
|
val config = HikariConfig().apply {
|
|
- jdbcUrl = "jdbc:postgresql://$dbHost/${settings.databaseName}"
|
|
|
|
|
|
+ jdbcUrl = "jdbc:postgresql://$dbHost/${settings.databaseName}?$postgresqlSettings"
|
|
maximumPoolSize = Jvm.systemSettingOrNull(Int::class, "maximumPoolSize") ?: poolSize
|
|
maximumPoolSize = Jvm.systemSettingOrNull(Int::class, "maximumPoolSize") ?: poolSize
|
|
driverClassName = settings.databaseDriver
|
|
driverClassName = settings.databaseDriver
|
|
username = settings.databaseUsername
|
|
username = settings.databaseUsername
|