DB improvement + 2nd job info

Fixed a major performance problem with installing over 10000 threads when a given amount of accounts exists on the DB.
Added information for the available 2nd jobs of the Explorers, introducing to the players the gists of each job branch.
This commit is contained in:
ronancpl
2017-12-02 18:50:15 -02:00
parent a3b6cf563b
commit 8dba6957df
7 changed files with 85 additions and 39 deletions

View File

@@ -76,9 +76,11 @@ public class DatabaseConnection {
config.setUsername(ServerConstants.DB_USER);
config.setPassword(ServerConstants.DB_PASS);
int poolSize = getNumberOfAccounts() * 10; // make sure pool size is comfortable for the worst case scenario
if(poolSize < 100) poolSize = 100;
else if(poolSize > 10000) poolSize = 10000;
// Make sure pool size is comfortable for the worst case scenario.
// Under 100 accounts? Make it 10. Over 10000 accounts? Make it 30.
int poolSize = (int) Math.ceil(9.889642518 * Math.exp(0.0001109709382 * getNumberOfAccounts()));
if(poolSize < 10) poolSize = 10;
else if(poolSize > 30) poolSize = 30;
config.setConnectionTimeout(30 * 1000);
config.setMaximumPoolSize(poolSize);