Redis Cache By Xon

Redis Cache By Xon 2.17.2

No permission to download
This add-on plugs into the XenForo caching layer which saves a number of common mysql request but does not cache mysql queries in general.
 
@Xon I am getting server error long from disabling Redis Cache add-on.

Code:
CredisException: LOADING Redis is loading the dataset in memory src/addons/SV/RedisCache/Credis/Client.php:1193

Generated by: Unknown account May 2, 2018 at 8:47 AM

Stack trace

#0 src/addons/SV/RedisCache/Redis.php(251): Credis_Client->__call('mget', Array)
#1 src/addons/SV/RedisCache/CacheProvider.php(60): SV\RedisCache\Redis->doFetchMultiple(Array)
#2 src/XF/DataRegistry.php(113): SV\RedisCache\CacheProvider->fetchMultiple(Array)
#3 src/XF/DataRegistry.php(81): XF\DataRegistry->readFromCache(Array, Array)
#4 src/XF/DataRegistry.php(225): XF\DataRegistry->get(Array)
#5 src/XF/App.php(1404): XF\DataRegistry->offsetGet('codeEventListen...')
#6 src/XF/Container.php(28): XF\App->XF\{closure}(Object(XF\Container))
#7 src/XF/App.php(1218): XF\Container->offsetGet('extension.liste...')
#8 src/XF/Container.php(28): XF\App->XF\{closure}(Object(XF\Container))
#9 src/XF/App.php(2341): XF\Container->offsetGet('extension')
#10 src/XF/App.php(2355): XF\App->extension()
#11 src/XF/App.php(1503): XF\App->fire('app_setup', Array)
#12 src/XF/Pub/App.php(45): XF\App->setup(Array)
#13 src/XF.php(312): XF\Pub\App->setup(Array)
#14 src/XF.php(324): XF::setupApp('XF\\Pub\\App')
#15 index.php(13): XF::runApp('XF\\Pub\\App')
#16 {main}

Request state

array(4) {
  ["url"] => string(26) "/forums/use.33/"
  ["referrer"] => string(48) "/forums/use.33/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
Any thoughts @Xon ?
I got this kind of error 2-3 times a day.

Code:
Server error log
CredisException: read error on connection src/addons/SV/RedisCache/Credis/Client.php:1157
Generated by: Unknown account 03.05.2018. at 11:28
Stack trace
#0 src/addons/SV/RedisCache/Redis.php(305): Credis_Client->__call('set', Array)
#1 src/addons/SV/RedisCache/CacheProvider.php(87): SV\RedisCache\Redis->doSave('xfredis__sessio...', '\x00\x00\x00\x02\x14\x04\x11\x03_ip\x11\x04\x1F\xD9...', 14400)
#2 src/XF/Session/CacheStorage.php(34): SV\RedisCache\CacheProvider->save('session_a2EBiK0...', Array, 14400)
#3 src/XF/Session/Session.php(215): XF\Session\CacheStorage->writeSession('a2EBiK0G0-aToOw...', Array, 14400, true)
#4 src/XF/Pub/App.php(360): XF\Session\Session->save()
#5 src/XF/App.php(1897): XF\Pub\App->complete(Object(XF\Http\Response))
#6 src/XF.php(328): XF\App->run()
#7 index.php(13): XF::runApp('XF\\Pub\\App')
#8 {main}

-------------

Previous RedisException: read error on connection - src/addons/SV/RedisCache/Credis/Client.php:1139
#0 src/addons/SV/RedisCache/Credis/Client.php(1139): Redis->set('xfredis__sessio...', '\x00\x00\x00\x02\x14\x04\x11\x03_ip\x11\x04\x1F\xD9...', 14400)
#1 src/addons/SV/RedisCache/Redis.php(305): Credis_Client->__call('set', Array)
#2 src/addons/SV/RedisCache/CacheProvider.php(87): SV\RedisCache\Redis->doSave('xfredis__sessio...', '\x00\x00\x00\x02\x14\x04\x11\x03_ip\x11\x04\x1F\xD9...', 14400)
#3 src/XF/Session/CacheStorage.php(34): SV\RedisCache\CacheProvider->save('session_a2EBiK0...', Array, 14400)
#4 src/XF/Session/Session.php(215): XF\Session\CacheStorage->writeSession('a2EBiK0G0-aToOw...', Array, 14400, true)
#5 src/XF/Pub/App.php(360): XF\Session\Session->save()
#6 src/XF/App.php(1897): XF\Pub\App->complete(Object(XF\Http\Response))
#7 src/XF.php(328): XF\App->run()
#8 index.php(13): XF::runApp('XF\\Pub\\App')
#9 {main}
Request state
array(4) {
  ["url"] => string(31) "/attachments/29z4gsp-jpg.24167/"
  ["referrer"] => string(67) "https://www.pijanitvor.com/threads/pavitina-klematis-clematis.1649/"
  ["_GET"] => array(1) {
    ["/attachments/29z4gsp-jpg_24167/"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}

My redis conf:

Code:
maxmemory 128mb
maxmemory-policy allkeys-lru
maxmemory-samples 10
appendonly no


Redis configuration in xenforo config.php

Code:
// START Redis configuration //
$config['cache']['enabled'] = true;
$config['cache']['sessions'] = true;
$config['cache']['namespace'] = 'xfredis_';

$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config'] = array(
'server' => '127.0.0.1',
'port' => 6379,
'connect_retries' => 2,
'use_lua' => true,
'compress_data' => 2,
'read_timeout' => 1,
'timeout' => 1,
'serializer' => 'igbinary',
//        'serializer' => 'php',
);
// END Redis configuration //
 
This tends to happen if you have redis setup to persist to disk in a virtual environment. The fork() call which is used to snapshot the process memory can take unexpectedly link which causes new connections to fail.
 
If I make a change in a xenforo template, I have to restart redis for the changes to have effect. Any ideas?
 
Where can disable persistence options ?
Remove/Disable the 'save' directives in /etc/redis.conf (or similar file).

If I make a change in a xenforo template, I have to restart redis for the changes to have effect. Any ideas?
I discovered a bug where this add-on isn't setting an expiry time, I'll push a fix.

However, this sounds like something is preventing an updated style modified timestamp being passed to the caching code. As it would cause a new entry to be fetched instead of the old version.
 
@Nirjonadda, yup that does it
I already have disabled but same error show up several times a day.

Any thoughts @Xon ?
I got this kind of error 2-3 times a day.

Code:
Server error log
CredisException: read error on connection src/addons/SV/RedisCache/Credis/Client.php:1157
Generated by: Unknown account 03.05.2018. at 11:28
Stack trace
#0 src/addons/SV/RedisCache/Redis.php(305): Credis_Client->__call('set', Array)
#1 src/addons/SV/RedisCache/CacheProvider.php(87): SV\RedisCache\Redis->doSave('xfredis__sessio...', '\x00\x00\x00\x02\x14\x04\x11\x03_ip\x11\x04\x1F\xD9...', 14400)
#2 src/XF/Session/CacheStorage.php(34): SV\RedisCache\CacheProvider->save('session_a2EBiK0...', Array, 14400)
#3 src/XF/Session/Session.php(215): XF\Session\CacheStorage->writeSession('a2EBiK0G0-aToOw...', Array, 14400, true)
#4 src/XF/Pub/App.php(360): XF\Session\Session->save()
#5 src/XF/App.php(1897): XF\Pub\App->complete(Object(XF\Http\Response))
#6 src/XF.php(328): XF\App->run()
#7 index.php(13): XF::runApp('XF\\Pub\\App')
#8 {main}

-------------

Previous RedisException: read error on connection - src/addons/SV/RedisCache/Credis/Client.php:1139
#0 src/addons/SV/RedisCache/Credis/Client.php(1139): Redis->set('xfredis__sessio...', '\x00\x00\x00\x02\x14\x04\x11\x03_ip\x11\x04\x1F\xD9...', 14400)
#1 src/addons/SV/RedisCache/Redis.php(305): Credis_Client->__call('set', Array)
#2 src/addons/SV/RedisCache/CacheProvider.php(87): SV\RedisCache\Redis->doSave('xfredis__sessio...', '\x00\x00\x00\x02\x14\x04\x11\x03_ip\x11\x04\x1F\xD9...', 14400)
#3 src/XF/Session/CacheStorage.php(34): SV\RedisCache\CacheProvider->save('session_a2EBiK0...', Array, 14400)
#4 src/XF/Session/Session.php(215): XF\Session\CacheStorage->writeSession('a2EBiK0G0-aToOw...', Array, 14400, true)
#5 src/XF/Pub/App.php(360): XF\Session\Session->save()
#6 src/XF/App.php(1897): XF\Pub\App->complete(Object(XF\Http\Response))
#7 src/XF.php(328): XF\App->run()
#8 index.php(13): XF::runApp('XF\\Pub\\App')
#9 {main}
Request state
array(4) {
  ["url"] => string(31) "/attachments/29z4gsp-jpg.24167/"
  ["referrer"] => string(67) "https://www.pijanitvor.com/threads/pavitina-klematis-clematis.1649/"
  ["_GET"] => array(1) {
    ["/attachments/29z4gsp-jpg_24167/"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}

My redis conf:

Code:
maxmemory 128mb
maxmemory-policy allkeys-lru
maxmemory-samples 10
appendonly no


Redis configuration in xenforo config.php

Code:
// START Redis configuration //
$config['cache']['enabled'] = true;
$config['cache']['sessions'] = true;
$config['cache']['namespace'] = 'xfredis_';

$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config'] = array(
'server' => '127.0.0.1',
'port' => 6379,
'connect_retries' => 2,
'use_lua' => true,
'compress_data' => 2,
'read_timeout' => 1,
'timeout' => 1,
'serializer' => 'igbinary',
//        'serializer' => 'php',
);
// END Redis configuration //
 
Top Bottom