Problem with memcache distributed Redis

Hello,
I’m using the last version of Nextcloud, installed with the Plesk’s extension.

It works good (I’ve a problem with the indexing from search engine for shared files but this is another “story”) but when I try to set the cache the application crash, stop to works.

'memcache.distributed' => '\OC\Memcache\Redis',
'memcache.locking' => '\OC\Memcache\Redis',
'memcache.local' => '\OC\Memcache\APCu',
  'redis' => array(
    'host' => 'localhost',
    'port' => 6379,
 ),

In the logs I see this error:

no app in context
RedisException: Connection refused

If I remove:

'memcache.distributed' => '\OC\Memcache\Redis',

It works good again.
I’ve Redis installed on the server as extension of the handler PHP 7.4 FPM.
Is there some extra configuration to do?
If I don’t use the memcache (distributed, local, locking) is a problem for Nextcloud or can I remove the above code and continue to work quietly?
Thanks.

I do not use Redis. But i think you can test “redis.sock” instead of the socket “localhost.6379”.

Read
Problems with config.php and Redis

For other settings search “redis.sock” in this forum.
https://help.nextcloud.com/search?q=redis.sock%20order%3Alatest

Additional:
Have you activated PHP Caching?
Search “Enable PHP OPcache” in https://docs.nextcloud.com/server/19/admin_manual/installation/server_tuning.html

Read also
https://docs.nextcloud.com/server/19/admin_manual/configuration_server/caching_configuration.html?highlight=redis

1 Like

If I remove:

'memcache.distributed' => '\OC\Memcache\Redis',

It works good again.

I also used Redis as caching backend. For me my configuration looks like this:

<?php
$CONFIG = array (
[..]
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '127.0.0.1',
    'port' => '6379',
    'timeout' => '0.0',
  ),
[..]

Can you connect to redis with redis-cli?

2 Likes

Unfortunately Redis Server is currently not supported on Plesk.
Is available a workaround with Redis Docker but Plesk Team suggest me don’t use APCu for local cache, because it’s old and no more supported, so I think it’s better wait for the moment.

I hope to see in the next versions of Nextcloud a more simple and modern way to manage the cache.

This is how it’s done in the Nextcloud VM:

1 Like

My hosting provider has suggest not to use memcache but only enable Opcache on PHP (he told me that APCu should be used with great caution, it can generate a lot of problems on the server, is a cache technology outdate):
https://support.plesk.com/hc/en-us/articles/115000935049-How-to-ensure-that-Opcache-is-enabled-

In the Nextcloud documentation is indicated:

There are two types of caches to use: a PHP opcode cache, which is commonly called opcache, and data caching for your Web server. If you do not install and enable a local memcache you will see a warning on your Nextcloud admin page. A memcache is not required and you may safely ignore the warning if you prefer.

Did he tell you why, or is it just a lazy hosting provider that doesn’t care to much about installing the best for the customers? :smiley:

You’re right, I’ve insisted and they installed “Redis server”, now it works good.
Thanks.

1 Like