forked from miraheze/mw-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGlobalCache.php
121 lines (103 loc) · 3.15 KB
/
GlobalCache.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
// mem141
$wgObjectCaches['memcached-mem-1'] = [
'class' => 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,
'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 );