Skip to content

Commit

Permalink
Use new nutcracker config
Browse files Browse the repository at this point in the history
  • Loading branch information
paladox authored Nov 27, 2023
1 parent c3c4016 commit 1c54ec7
Showing 1 changed file with 13 additions and 29 deletions.
42 changes: 13 additions & 29 deletions GlobalCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,11 @@

$beta = preg_match( '/^(.*)\.mirabeta\.org$/', $wi->server );

// mem141
$wgObjectCaches['memcached-mem-1'] = [
$wgObjectCaches['memcached-pecl'] = [
'class' => MemcachedPeclBagOStuff::class,
'serializer' => 'php',
'persistent' => false,
'servers' => [ '/var/run/nutcracker/nutcracker_1.sock:0' ],
// Effectively disable the failure limit (0 is invalid)
'server_failure_limit' => 1e9,
// Effectively disable the retry timeout
'retry_timeout' => -1,
'loggroup' => 'memcached',
// 500ms, in microseconds
'timeout' => 0.5 * 1e6,
];

// mem131
$wgObjectCaches['memcached-mem-2'] = [
'class' => MemcachedPeclBagOStuff::class,
'serializer' => 'php',
'persistent' => false,
'servers' => [ '/var/run/nutcracker/nutcracker_2.sock:0' ],
'servers' => [ '/var/run/nutcracker/nutcracker.sock:0' ],
// Effectively disable the failure limit (0 is invalid)
'server_failure_limit' => 1e9,
// Effectively disable the retry timeout
Expand All @@ -40,7 +24,7 @@
'caches' => [
0 => [
'factory' => [ 'ObjectCache', 'getInstance' ],
'args' => [ $beta ? 'memcached-mem-test' : 'memcached-mem-1' ]
'args' => [ $beta ? 'memcached-pecl-beta' : 'memcached-pecl' ]
],
1 => [
'class' => SqlBagOStuff::class,
Expand Down Expand Up @@ -89,19 +73,19 @@

$wgMainStash = 'db-mainstash';

$wgSessionCacheType = 'memcached-mem-2';
$wgSessionCacheType = 'memcached-pecl';

// Same as $wgMainStash
$wgMWOAuthSessionCacheType = 'db-mainstash';

$redisServerIP = '[2a10:6740::6:306]:6379';

$wgMainCacheType = 'memcached-mem-2';
$wgMessageCacheType = 'memcached-mem-1';
$wgMainCacheType = 'memcached-pecl';
$wgMessageCacheType = 'memcached-pecl';

$wgParserCacheType = 'mysql-multiwrite';

$wgChronologyProtectorStash = 'memcached-mem-1';
$wgChronologyProtectorStash = 'memcached-pecl';

$wgParsoidCacheConfig = [
// Defaults to MainStash
Expand Down Expand Up @@ -142,11 +126,11 @@

if ( $beta ) {
// test131 (only use on test131. No prod traffic should use this).
$wgObjectCaches['memcached-mem-test'] = [
$wgObjectCaches['memcached-pecl-beta'] = [
'class' => MemcachedPeclBagOStuff::class,
'serializer' => 'php',
'persistent' => false,
'servers' => [ '/var/run/nutcracker/nutcracker_test.sock:0' ],
'servers' => [ '/var/run/nutcracker/nutcracker_beta.sock:0' ],
// Effectively disable the failure limit (0 is invalid)
'server_failure_limit' => 1e9,
// Effectively disable the retry timeout
Expand All @@ -158,12 +142,12 @@

$redisServerIP = '[2a10:6740::6:406]:6379';

$wgMainCacheType = 'memcached-mem-test';
$wgMessageCacheType = 'memcached-mem-test';
$wgMainCacheType = 'memcached-pecl-beta';
$wgMessageCacheType = 'memcached-pecl-beta';

$wgSessionCacheType = 'memcached-mem-test';
$wgSessionCacheType = 'memcached-pecl-beta';

$wgChronologyProtectorStash = 'memcached-mem-test';
$wgChronologyProtectorStash = 'memcached-pecl-beta';
}

$wgJobTypeConf['default'] = [
Expand Down

0 comments on commit 1c54ec7

Please sign in to comment.