Redis Cache By Xon

Redis Cache By Xon 2.17.2

No permission to download
*XF's proxy/unfurl code can cause downtime if they share a fixed php-fpm pool with the main site under sufficient load due to exhausting the number of free workers.
I have similar issue like this too, downtime happens in 1-2 minutes for my site and then come back again, and i'm not sure what caused the problem, nothing problem with ram and cpu
This happened after I upgrade php, nginx, addons, before that everything is normal
 
User logout will be show Security error occurred. Please press back, refresh the page, and try again with Guest page caching. Please can you let me know that how to fixing this issue? I am using phpredis 5.1.1 with Redis Version 3.2.12

Has a solution been found here? Respectively a reason why this is happening?
In a forum that has just switched to Redis, this is exactly what happens after logout.


I am aware it has nothing to do with this add-on. Nevertheless, it has been thematised here.
 
Last edited by a moderator:
@0815, I had the same problem but it is not related to this add-on. I could reproduce this on a clean XF install, without add-ons and only Redis enabled. But also without Redis, but with file caching, same error!
Believe me, it is not worth it. Disable guest page caching if you are having problems.

We never solved it. It is a combination of XF guest page cache and your host using some kind of cache.
Check these topics:
and
 
This add-on adds basic caching for a number of sometimes expensive operations, and with a few of my other add-ons uses Redis's more advanced API to replace some functionality.

These two add-ons move functionality out of the database and into Redis:
This one gets a signficiant performance improvement over it's mysql backend and scales very well to thousands of users viewing per thread
 
# isn't a single line comment in php, // is

Have a look at the FAQ, it contains a TCP and socket example; https://xenforo.com/community/resources/redis-cache-by-xon.5562/field?field=faq

I can't particularly help with socket permissions as this is highly depended on server configuration (ie is the socket file path that php sees the same as redis, permissions, selinux/apparmor weird ****, etc)
There is the answer for my question. I also read about the file permissions ("set the socket file to 770 instead of 700", "let SE Linux approve the connection"). TCP seems to be much easier.
 
Getting php-fpm and redis with default (hardened) configuration to talk via sockets is surprisingly non-obvious, and frustrating to troubleshoot.
 
What is the proper configuration to use?
'server' => '127.0.0.1',
or
'host' => '127.0.0.1',

Does this addon also supports both config?
PHP:
    'persistent'    => true,
    'persistent_id' => 'xf2',
 
Last edited:
What is the proper configuration to use?
'server' => '127.0.0.1',
or
'host' => '127.0.0.1',
Either work.
Does this addon also supports both config?
PHP:
    'persistent'    => true,
    'persistent_id' => 'xf2',
It is just persistent;

PHP:
    'persistent'    => 'xf2'
[/icode]

But I don't recommend using this feature!
 
  • Love
Reactions: rdn
I got two this kind of errors and it happens everyday, could you please take a look, I'd much grateful

1673425954050.png
Connection to Redis failed
Code:
Server error log
CredisException: Connection to Redis tcp://127.0.0.1:6379 failed after 2 failures.Last Error : (1) Cannot assign requested address src/addons/SV/RedisCache/Credis/Client.php:598
Generated by: Unknown account Jan 10, 2023 at 11:11 PM
Stack trace
#0 src/addons/SV/RedisCache/Credis/Client.php(594): Credis_Client->connect()
#1 src/addons/SV/RedisCache/Credis/Client.php(946): Credis_Client->connect()
#2 src/addons/SV/RedisCache/Redis.php(409): Credis_Client->__call('mget', Array)
#3 src/addons/SV/RedisCache/Redis.php(49): SV\RedisCache\Redis->SV\RedisCache\{closure}()
#4 src/addons/SV/RedisCache/Redis.php(436): SV\RedisCache\Redis->redisQueryForStat('gets', Object(Closure))
#5 src/addons/SV/RedisCache/CacheProvider.php(63): SV\RedisCache\Redis->doFetchMultiple(Array)
#6 src/XF/DataRegistry.php(114): SV\RedisCache\CacheProvider->fetchMultiple(Array)
#7 src/XF/DataRegistry.php(82): XF\DataRegistry->readFromCache(Array, Array)
#8 src/XF/DataRegistry.php(226): XF\DataRegistry->get(Array)
#9 src/XF/App.php(1650): XF\DataRegistry->offsetGet('codeEventListen...')
#10 src/XF/Container.php(28): XF\App->XF\{closure}(Object(XF\Container))
#11 src/XF/App.php(1450): XF\Container->offsetGet('extension.liste...')
#12 src/XF/Container.php(28): XF\App->XF\{closure}(Object(XF\Container))
#13 src/XF/App.php(2640): XF\Container->offsetGet('extension')
#14 src/XF/App.php(2668): XF\App->extension()
#15 src/XF/App.php(1330): XF\App->extendClass('XF\\AddOn\\Manage...')
#16 src/XF/Container.php(28): XF\App->XF\{closure}(Object(XF\Container))
#17 src/XF/App.php(2163): XF\Container->offsetGet('addon.manager')
#18 src/XF/App.php(1749): XF\App->setupAddOnComposerAutoload()
#19 src/XF/Pub/App.php(89): XF\App->setup(Array)
#20 src/XF.php(364): XF\Pub\App->setup(Array)
#21 src/XF.php(387): XF::setupApp('XF\\Pub\\App')
#22 index.php(20): XF::runApp('XF\\Pub\\App')
#23 {main}

Fatal Error
Code:
Server error log
ErrorException: Fatal Error: Uncaught CredisException: Connection to Redis tcp://127.0.0.1:6379 failed after 2 failures.Last Error : (1) Cannot assign requested address in 
/home/domain.com/public_html/src/addons/SV/RedisCache/Credis/Client.php:598 Stack trace: #0
 /home/domain.com/html/src/addons/SV/RedisCache/Credis/Client.php(594): Credis_Client->connect() #1
 /home/domain.com/html/src/addons/SV/RedisCache/Credis/Client.php(946): Credis_Client->connect() #2
 /home/domain.com/html/src/addons/SV/RedisCache/Redis.php(409): Credis_Client->__call('mget', Array) #3
 /home/domain.com/html/src/addons/SV/RedisCache/Redis.php(49): SV\RedisCache\Redis->SV\RedisCache\{closure}() #4
 /home/domain.com/html/src/addons/SV/RedisCache/Redis.php(436): SV\RedisCache\Redis->redisQueryForStat('gets', Object(Closure)) #5
 /home/domain.com/html/src/addons/SV/RedisCache/CacheProvider.php(63): SV\RedisCache\Redis->doFetchMultiple(Array) #6
 /home/domain.com/html/src/XF/DataRegistry.php(114): SV\RedisCache\CacheProvider- src/addons/SV/RedisCache/Credis/Client.php:598
Generated by: Unknown account Jan 10, 2023 at 11:11 PM
Stack trace
#0 [internal function]: XF::handleFatalError()
#1 {main}


My config.php setup with redis
Code:
// setup redis caching
$config['cache']['sessions'] = true;
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config'] = [
    'server' => '127.0.0.1',
    'port' => 6379,
];
 
Top Bottom