Anonymous | Login | Signup for a new account | 2024-03-29 09:03 CDT |
Main | My View | View Issues | Change Log | Roadmap | Docs | Wiki | Repositories |
View Revisions: Issue #576 | [ All Revisions ] [ Back to Issue ] | ||
Summary | 0000576: Separating Database Master/Slave Requests | ||
Revision | 2011-07-05 05:09:42 by alex | ||
Description | 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 http://www.mediawiki.org/wiki/Manual:$wgDBservers for more details. |
||
Revision | 2011-06-30 11:23:15 by alex | ||
Description | 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: $_CONFIG['Databases'] = Array( Array( 'host' => "master.serv.er", 'dbname' => "db1", 'user' => "user", 'password' => "secret", 'type' => "mysql", 'load' => 0, ), Array( 'host' => "slave1.serv.er", 'dbname' => "db2", 'user' => "user", 'password' => "secret", 'type' => "mysql", 'load' => 1, ), Array( 'host' => "slave2.serv.er", 'dbname' => "db3", 'user' => "user", 'password' => "secret", 'type' => "mysql", 'load' => 1, ), ); See http://www.mediawiki.org/wiki/Manual:$wgDBservers for more details. |
||
Revision | 2010-08-31 14:16:51 by alex | ||
Description | 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. |
Main | My View | View Issues | Change Log | Roadmap | Docs | Wiki | Repositories |
Web Development by Intechnic In-Portal Open Source CMS |