diff --git a/Database.php b/Database.php index d2e0885f..78df8ec1 100644 --- a/Database.php +++ b/Database.php @@ -1,81 +1,80 @@ \Wikimedia\Rdbms\LBFactoryMulti::class, 'sectionsByDB' => $wi->wikiDBClusters, 'sectionLoads' => [ 'DEFAULT' => [ 'db101' => 1, ], 'c1' => [ 'db101' => 1, ], 'c2' => [ 'db101' => 1, ], 'c3' => [ 'db142' => 1, ], 'c4' => [ 'db121' => 1, ], 'c5' => [ 'db131' => 1, ], ], 'serverTemplate' => [ 'dbname' => $wgDBname, 'user' => $wgDBuser, 'password' => $wgDBpassword, 'type' => 'mysql', - // DBO_SSL is deprecated in 1.39 - // use 'ssl' parameter instead - 'flags' => DBO_SSL, + 'ssl' => true, + 'flags' => DBO_DEFAULT, 'variables' => [ // https://mariadb.com/docs/reference/mdb/system-variables/innodb_lock_wait_timeout 'innodb_lock_wait_timeout' => 15, ], /** * MediaWiki checks if the certificate presented by MariaDB is signed * by the certificate authority listed in 'sslCAFile'. In emergencies * this could be set to /etc/ssl/certs/ca-certificates.crt (all trusted * CAs), but setting this to one CA reduces attack vector and CAs * to dig through when checking the certificate provided by MariaDB. */ 'sslCAFile' => '/etc/ssl/certs/Sectigo.crt', ], 'hostsByName' => [ 'db101' => 'db101.miraheze.org', 'db121' => 'db121.miraheze.org', 'db131' => 'db131.miraheze.org', 'db142' => 'db142.miraheze.org', ], 'externalLoads' => [ 'beta' => [ /** where the betawiki database is located */ 'db121' => 1, ], 'echo' => [ /** where the metawiki database is located */ 'db101' => 1, ], 'parsercache' => [ /** where the parsercache database is located */ 'db121' => 1, ], ], 'readOnlyBySection' => [ // 'DEFAULT' => 'DC Switchover in progress. Please try again in a few minutes.', // 'c1' => 'DC Switchover in progress. Please try again in a few minutes.', // 'c2' => 'DC Switchover in progress. Please try again in a few minutes.', // 'c3' => 'DC Switchover in progress. Please try again in a few minutes.', // 'c4' => 'DC Switchover in progress. Please try again in a few minutes.', // 'c5' => 'DC Switchover in progress. Please try again in a few minutes.', ], ]; // Disallow web request database transactions that are slower than 3 seconds $wgMaxUserDBWriteDuration = 3; // Max execution time for expensive queries of special pages (in milliseconds) $wgMaxExecutionTimeForExpensiveQueries = 30000; diff --git a/GlobalCache.php b/GlobalCache.php index 698726f1..1870f386 100644 --- a/GlobalCache.php +++ b/GlobalCache.php @@ -1,121 +1,120 @@ MemcachedPeclBagOStuff::class, 'serializer' => 'php', 'persistent' => false, 'servers' => [ '127.0.0.1:11212' ], // 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' => 1 * 1e6, ]; // mem131 $wgObjectCaches['memcached-mem-2'] = [ 'class' => MemcachedPeclBagOStuff::class, 'serializer' => 'php', 'persistent' => false, 'servers' => [ '127.0.0.1:11214' ], // 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' => 1 * 1e6, ]; $wgObjectCaches['mysql-multiwrite'] = [ 'class' => MultiWriteBagOStuff::class, 'caches' => [ 0 => [ 'factory' => [ 'ObjectCache', 'getInstance' ], 'args' => [ 'memcached-mem-1' ] ], 1 => [ 'class' => SqlBagOStuff::class, 'servers' => [ [ 'type' => 'mysql', 'host' => 'db121.miraheze.org', 'dbname' => 'parsercache', 'user' => $wgDBuser, 'password' => $wgDBpassword, - // DBO_SSL is deprecated in 1.39 - // use 'ssl' parameter instead - 'flags' => DBO_SSL, + 'ssl' => true, + 'flags' => DBO_DEFAULT, 'sslCAFile' => '/etc/ssl/certs/Sectigo.crt', ], ], 'purgePeriod' => 0, 'tableName' => 'pc', 'reportDupes' => false ], ], 'replication' => 'async', 'reportDupes' => false ]; $wgSessionCacheType = 'memcached-mem-2'; $redisServerIP = '[2a10:6740::6:306]:6379'; $wgMainCacheType = 'memcached-mem-2'; $wgMessageCacheType = 'memcached-mem-2'; $wgParserCacheType = 'mysql-multiwrite'; $wgLanguageConverterCacheType = CACHE_ACCEL; // 10 days $wgParserCacheExpireTime = 86400 * 10; // 3 days $wgRevisionCacheExpiry = 86400 * 3; $wgDLPQueryCacheTime = 120; $wgDplSettings['queryCacheTime'] = 120; // Disable sidebar cache for select wikis as a solution to T8732, T9699, and T9884 if ( $wgDBname !== 'solarawiki' && $wgDBname !== 'constantnoblewiki' && $wgDBname !== 'nonciclopediawiki' ) { $wgEnableSidebarCache = true; } $wgUseLocalMessageCache = true; $wgInvalidateCacheOnLocalSettingsChange = false; if ( preg_match( '/^(.*)\.betaheze\.org$/', $wi->server ) ) { $redisServerIP = '[2a10:6740::6:406]:6379'; // Session cache needs to be flipped for betaheze to avoid session conflicts $wgSessionCacheType = 'memcached-mem-1'; $wgMainWANCache = 'betaheze'; $wgWANObjectCaches['betaheze'] = [ 'class' => WANObjectCache::class, 'cacheId' => 'memcached-mem-1', ]; } $wgJobTypeConf['default'] = [ 'class' => JobQueueRedis::class, 'redisServer' => $redisServerIP, 'redisConfig' => [ 'connectTimeout' => 2, 'password' => $wmgRedisPassword, 'compression' => 'gzip', ], 'claimTTL' => 3600, 'daemonized' => true, ]; if ( PHP_SAPI === 'cli' ) { // APC not available in CLI mode $wgLanguageConverterCacheType = CACHE_NONE; } unset( $redisServerIP );