Skip to content
This repository has been archived by the owner on Feb 3, 2024. It is now read-only.

Commit

Permalink
Use a more optimal pool size
Browse files Browse the repository at this point in the history
  • Loading branch information
zml2008 committed Jan 15, 2015
1 parent c649437 commit b7443ee
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ public SQLBackend(PermissionManager manager, final ConfigurationSection config)
this.ds.setUrl("jdbc:" + dbUri);
this.ds.setUsername(dbUser);
this.ds.setPassword(dbPassword);
this.ds.setMaxActive(20);
// https://github.com/brettwooldridge/HikariCP/wiki/About-Pool-Sizing
this.ds.setMaxActive((Runtime.getRuntime().availableProcessors() * 2) + 1);
this.ds.setMaxWait(200); // 4 ticks
this.ds.setValidationQuery("SELECT 1 AS dbcp_validate");
this.ds.setTestOnBorrow(true);
Expand Down

0 comments on commit b7443ee

Please sign in to comment.