Skip to content

Commit

Permalink
Merge pull request #428 from MaRDI4NFDI/physikerwelt-patch-2
Browse files Browse the repository at this point in the history
Use repl db for read queries
  • Loading branch information
physikerwelt authored Nov 6, 2023
2 parents 23f2701 + d150496 commit 4dc1624
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions mediawiki/LocalSettings.d/00_database.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,30 @@
<?php
$wgDBname = str_contains($_SERVER['HTTP_HOST']??'','swmath') ? 'wiki_swmath' : 'my_wiki';
if ( getenv('CI') !== 'true' ) {
$wgLBFactoryConf = array(

'class' => 'LBFactoryMulti',

'sectionsByDB' => array(
'my_wiki' => 's1',
'wiki_swmath' => 's1',
),

'sectionLoads' => array(
's1' => array(
'mysql.svc' => 0,
'mysql-repl.svc' => 50, /* the 50 is the weight (of replica servers). Would matter if you had multiple */
),
),


'serverTemplate' => array(
'dbname' => $wgDBname,
'user' => $wgDBuser,
'password' => $wgDBpassword,
'type' => 'mysql',
'flags' => DBO_DEFAULT,
'max lag' => 30,
),
);
}

0 comments on commit 4dc1624

Please sign in to comment.