From f78c18abece45faca37e791cc709ba3719455166 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Tue, 23 May 2023 13:51:10 -0400 Subject: [PATCH] Updated Hikari pool configuration. --- src/engine/gameManager/DbManager.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/engine/gameManager/DbManager.java b/src/engine/gameManager/DbManager.java index ebd7dc5f..0a90cb33 100644 --- a/src/engine/gameManager/DbManager.java +++ b/src/engine/gameManager/DbManager.java @@ -298,18 +298,24 @@ public enum DbManager { HikariConfig config = new HikariConfig(); - config.setMaximumPoolSize(Runtime.getRuntime().availableProcessors() * 2); + config.setMaximumPoolSize((Runtime.getRuntime().availableProcessors() * 2) + 1); config.setJdbcUrl("jdbc:mysql://" + ConfigManager.MB_DATABASE_ADDRESS.getValue() + ":" + ConfigManager.MB_DATABASE_PORT.getValue() + "/" + ConfigManager.MB_DATABASE_NAME.getValue()); config.setUsername(ConfigManager.MB_DATABASE_USER.getValue()); config.setPassword(ConfigManager.MB_DATABASE_PASS.getValue()); + + config.addDataSourceProperty("minimumIdle", "5"); + config.addDataSourceProperty("idleTimeout", "120000"); + config.addDataSourceProperty("characterEncoding", "utf8"); - config.addDataSourceProperty("cachePrepStmts", "true"); + config.addDataSourceProperty("useServerPrepStmts", "true"); + config.addDataSourceProperty("cachePrepStmts", "true"); config.addDataSourceProperty("prepStmtCacheSize", "500"); config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048"); + config.addDataSourceProperty("leakDetectionThreshold", "5000"); config.addDataSourceProperty("cacheServerConfiguration", "true");