-
Type:
Feature Request
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 5.1.0
-
Fix Version/s: 5.2.0-B1
-
Component/s: Database
-
Labels:None
-
External issue URL:
-
Additional information:
-
Change Log Message:added Database Load Balancing
-
Story Points:3
-
External issue ID:576
-
Copy Issue Key:
-
Patch Instructions:
Add ability to have MASTER/SLAVE(s) configuration. This will separate WRITE/READ database requests between 2 servers.
1. all Admin requests go to MASTER
2. all Front READ requests go to SLAVE
3. all Front WRITE requests go to MASTER
4. all Front Search READ go to MASTER
For live examples refer to VO project.
In the future, we'd like to add function for have a Pool of Slaves servers.
--------
To enable load balancing:
1. add $_CONFIG['Database']['LoadBalancing'] = '1'; to /system/config.php file
2. create /system/db_servers.php file with following content:
<?php
$_CONFIG['Databases'] = Array (
Array (
'DBHost' => 'slave.host1',
'DBUser' => 'slave.user1',
'DBUserPassword' => 'slave.user.password1',
'DBLoad' => 1,
),
Array (
'DBHost' => 'slave.host2',
'DBUser' => 'slave.user2',
'DBUserPassword' => 'slave.user.password2',
'DBLoad' => 1,
'DBMaxLag' => 15, // optional, slave replication delay in seconds
'DBMaxThreads' => 100, // optional, when slave thread count is above this number, then it won't be used
),
);
3. only slave servers are listed in file above, since database server defined in /system/config.php is considered as master server for backwards compatibility.
See [url]http://www.mediawiki.org/wiki/Manual:$wgDBservers[/url] for more details.
- blocks
-
INP-1635 Create IDBConnection interface
-
- Closed
-
- parent of
-
INP-1766 Change "kDBLoadBalancer::openConnection" to always update last used connection index
-
- Resolved
-
- relates to
-
INP-1009 Improvements to kDBConnection class (iterator, kDBConnectionDebug class)
-
- Closed
-
-
INP-1635 Create IDBConnection interface
-
- Closed
-
- mentioned in
-
Wiki Page Loading...