Core/DBLayer:

- Make the mysql connectionpool shared for async and syncrhonous connections.
- Allow configurable amount of connections for the pool
- Allow configurable amount of delaythreads
Note that delaythreads now only represent in-core threads. Whenever they execute a task they will pick a free connection from the pool instead of using their previously unique assigned connection.
The purpose of this design change is better distribution of SQL requests (no bottlenecks paired with idling) among available resources.
This also prevents a ¨memory waste¨ of preparing async prepared statements on synchronous connections (that were never called) - and vice versa. Now, connections aren´t explicitly async or synchronous, they serve both purposes.

Use at own risk, might cause instabilities.
Don´t forget to update your config files and clear your cmake cache.

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2010-12-04 21:50:36 +01:00
parent b8bf37264b
commit f5d6319d4d
10 changed files with 129 additions and 176 deletions
+10 -11
View File
@@ -94,8 +94,7 @@ CharacterDatabaseInfo = "127.0.0.1;3306;trinity;trinity;characters"
# WorldDatabase.WorkerThreads
# CharacterDatabase.WorkerThreads
# Description: The amount of worker threads spawned to handle asynchronous (delayed) MySQL
# statements. Each worker thread is mirrored with its own connection to the
# MySQL server and their own thread on the MySQL server.
# statements.
# Default: 1 - (LoginDatabase.WorkerThreads)
# 1 - (WorldDatabase.WorkerThreads)
# 1 - (CharacterDatabase.WorkerThreads)
@@ -105,17 +104,17 @@ WorldDatabase.WorkerThreads = 1
CharacterDatabase.WorkerThreads = 1
#
# LoginDatabase.SynchThreads
# WorldDatabase.SynchThreads
# CharacterDatabase.SynchThreads
# Description: The amount of MySQL connections spawned to handle.
# Default: 1 - (LoginDatabase.WorkerThreads)
# 1 - (WorldDatabase.WorkerThreads)
# LoginDatabase.Connections
# WorldDatabase.Connections
# CharacterDatabase.Connections
# Description: The amount of MySQL connections spawned.
# Default: 1 - (LoginDatabase.Connections)
# 1 - (WorldDatabase.Connections)
# 2 - (CharacterDatabase.WorkerThreads)
LoginDatabase.SynchThreads = 1
WorldDatabase.SynchThreads = 1
CharacterDatabase.SynchThreads = 2
LoginDatabase.Connections = 2
WorldDatabase.Connections = 2
CharacterDatabase.Connections = 2
#
# MaxPingTime