Nextcloud 27.1.5 need help configuring memcache

Hello just upgrade to Nextcloud 27.1.5 and now im seeing this warning

There are some warnings regarding your setup.

  • The database is used for transactional file locking. To enhance performance, please configure memcache, if available. See the documentation :arrow_upper_right: for more information.

Ive look at the documentation but it’s talking about installing Redis on Ubuntu

Since we are on UCS is this different ?

Anyone can guide me how to fix this

Im using UCS Version 5.0-6 errata928

Thanks !

Here is what ive tried

1- Install redis and PHP module

root@cloud:~# apt install redis
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  linux-image-4.19.0-24-amd64
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
  libatomic1 libhiredis0.14 libjemalloc2 lua-bitop lua-cjson redis-server redis-tools
Suggested packages:
  ruby-redis
The following NEW packages will be installed:
  libatomic1 libhiredis0.14 libjemalloc2 lua-bitop lua-cjson redis redis-server redis-tools
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 981 kB of archives.
After this operation, 3,654 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 https://updates.software-univention.de ucs506/main amd64 libatomic1 amd64 8.3.0-6 [9,032 B]
Get:2 https://updates.software-univention.de ucs506/main amd64 libhiredis0.14 amd64 0.14.0-3 [33.8 kB]
Get:3 https://updates.software-univention.de ucs506/main amd64 libjemalloc2 amd64 5.1.0-3 [225 kB]
Get:4 https://updates.software-univention.de ucs506/main amd64 lua-bitop amd64 1.0.2-5 [6,936 B]
Get:5 https://updates.software-univention.de ucs506/main amd64 lua-cjson amd64 2.1.0+dfsg-2.1 [17.5 kB]
Get:6 https://updates.software-univention.de ucs506/main amd64 redis-tools amd64 5:5.0.14-1+deb10u5 [541 kB]
Get:7 https://updates.software-univention.de ucs506/main amd64 redis-server amd64 5:5.0.14-1+deb10u5 [91.2 kB]
Get:8 https://updates.software-univention.de ucs506/main amd64 redis all 5:5.0.14-1+deb10u5 [56.5 kB]
Fetched 981 kB in 1s (709 kB/s)
Selecting previously unselected package libatomic1:amd64.
(Reading database ... 109081 files and directories currently installed.)
Preparing to unpack .../0-libatomic1_8.3.0-6_amd64.deb ...
Unpacking libatomic1:amd64 (8.3.0-6) ...
Selecting previously unselected package libhiredis0.14:amd64.
Preparing to unpack .../1-libhiredis0.14_0.14.0-3_amd64.deb ...
Unpacking libhiredis0.14:amd64 (0.14.0-3) ...
Selecting previously unselected package libjemalloc2:amd64.
Preparing to unpack .../2-libjemalloc2_5.1.0-3_amd64.deb ...
Unpacking libjemalloc2:amd64 (5.1.0-3) ...
Selecting previously unselected package lua-bitop:amd64.
Preparing to unpack .../3-lua-bitop_1.0.2-5_amd64.deb ...
Unpacking lua-bitop:amd64 (1.0.2-5) ...
Selecting previously unselected package lua-cjson:amd64.
Preparing to unpack .../4-lua-cjson_2.1.0+dfsg-2.1_amd64.deb ...
Unpacking lua-cjson:amd64 (2.1.0+dfsg-2.1) ...
Selecting previously unselected package redis-tools.
Preparing to unpack .../5-redis-tools_5%3a5.0.14-1+deb10u5_amd64.deb ...
Unpacking redis-tools (5:5.0.14-1+deb10u5) ...
Selecting previously unselected package redis-server.
Preparing to unpack .../6-redis-server_5%3a5.0.14-1+deb10u5_amd64.deb ...
Unpacking redis-server (5:5.0.14-1+deb10u5) ...
Selecting previously unselected package redis.
Preparing to unpack .../7-redis_5%3a5.0.14-1+deb10u5_all.deb ...
Unpacking redis (5:5.0.14-1+deb10u5) ...
Setting up libjemalloc2:amd64 (5.1.0-3) ...
Setting up lua-cjson:amd64 (2.1.0+dfsg-2.1) ...
Setting up libatomic1:amd64 (8.3.0-6) ...
Setting up lua-bitop:amd64 (1.0.2-5) ...
Setting up libhiredis0.14:amd64 (0.14.0-3) ...
Setting up redis-tools (5:5.0.14-1+deb10u5) ...
Setting up redis-server (5:5.0.14-1+deb10u5) ...
Created symlink /etc/systemd/system/redis.service → /lib/systemd/system/redis-server.service.
Created symlink /etc/systemd/system/multi-user.target.wants/redis-server.service → /lib/systemd/system/redis-server.service.
Setting up redis (5:5.0.14-1+deb10u5) ...
Processing triggers for systemd (241-7~deb10u10A~5.0.4.202307030913) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for libc-bin (2.28-10+deb10u2) ...
root@cloud:~# apt install php-redis
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  linux-image-4.19.0-24-amd64
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
  php-igbinary
The following NEW packages will be installed:
  php-igbinary php-redis
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 196 kB of archives.
After this operation, 817 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 https://updates.software-univention.de ucs506/main amd64 php-igbinary amd64 3.0.0-1 [67.5 kB]
Get:2 https://updates.software-univention.de ucs506/main amd64 php-redis amd64 4.2.0-1 [128 kB]
Fetched 196 kB in 1s (190 kB/s)
Selecting previously unselected package php-igbinary.
(Reading database ... 109167 files and directories currently installed.)
Preparing to unpack .../php-igbinary_3.0.0-1_amd64.deb ...
Unpacking php-igbinary (3.0.0-1) ...
Selecting previously unselected package php-redis.
Preparing to unpack .../php-redis_4.2.0-1_amd64.deb ...
Unpacking php-redis (4.2.0-1) ...
Setting up php-igbinary (3.0.0-1) ...
Setting up php-redis (4.2.0-1) ...

2- Test Redis

root@cloud:~# redis-cli ping
PONG

3- Change to using a socket

root@cloud:~# cp /etc/redis/redis.conf /etc/redis/redis.conf.bakjfg2024-01-24
root@cloud:~# ls /etc/redis/redis.conf*
/etc/redis/redis.conf  /etc/redis/redis.conf.bakjfg2024-01-24
root@cloud:~# vi /etc/redis/redis.conf

a) Comment out bind 127.0.0.0 line
b) Change port to 0
c) Uncomment unixsocket /var/run/redis/redis-server.sock
d) Uncomment unixsocketperm 777

4- Test redis again

root@cloud:~# redis-cli -s /run/redis/redis-server.sock ping
PONG

5- Reconfigure Nextcloud to use redis

root@cloud:~# cp /var/lib/univention-appcenter/apps/nextcloud/data/integration/config/config.php /var/lib/univention-appcenter/apps/nextcloud/data/integration/config/config.php.bakjfg2024-01-24
root@cloud:~# ls /var/lib/univention-appcenter/apps/nextcloud/data/integration/config/config.php*
/var/lib/univention-appcenter/apps/nextcloud/data/integration/config/config.php
/var/lib/univention-appcenter/apps/nextcloud/data/integration/config/config.php.bakjfg
/var/lib/univention-appcenter/apps/nextcloud/data/integration/config/config.php.bakjfg2024-01-24
root@cloud:~# vi /var/lib/univention-appcenter/apps/nextcloud/data/integration/config/config.php

  'filelocking.enabled' => true,
  'memcache.locking' => '\OC\Memcache\Redis',
  'redis' => array(
          'host' =>'/var/run/redis/redis-server.sock',
          'port' => 0,
          'timeout' => 0.0,
  ),

6- Check redis service status

root@cloud:~# systemctl status redis-server
● redis-server.service - Advanced key-value store
   Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2024-01-24 11:37:44 EST; 44s ago
     Docs: http://redis.io/documentation,
           man:redis-server(1)
 Main PID: 791 (redis-server)
    Tasks: 4 (limit: 4661)
   Memory: 9.4M
   CGroup: /system.slice/redis-server.service
           └─791 /usr/bin/redis-server *:0

Jan 24 11:37:44 cloud systemd[1]: Starting Advanced key-value store...
Jan 24 11:37:44 cloud systemd[1]: redis-server.service: Can't open PID file /run/redis/redis-server.pid (yet?) after start: No such file or directory
Jan 24 11:37:44 cloud systemd[1]: Started Advanced key-value store.

Reboot server but i still see the same warning

Any ideas ?

Thanks !

(I reformatted your post to be better to read, please use Markdown formatting in the future!)

Looks good so far, but

may contain a typo? Should be 'host' =>'/run/redis/redis-server.sock',

Or your redis-cli example is wrong :thinking:

Ive modify the line

‘host’ => ‘/run/redis/redis-server.sock’

Restart service: systemctl restart redis-server

But still not work. Im seeing the same warning

I tried the same a month ago with no success.
So I asked me, whether Nextcloud can connect to Redis, which is outside its docker-container at all.

Sorry, I misread your 1st post.

If you have installed nextcloud from the univention Appcenter, then it runs inside a docker container, that’s why you won’t be able to use another redis server here.

Performance-wise, this makes no sense in the end. Basically, you have two options:

  1. use the appcenter version and leave it as is (fine for smaller environments). Ignore the warning
  2. install nextcloud on a dedicated server, with redis like described above. Only needed for bigger environments where the nextcloud performance of option1 is not enough

For the 2nd option, I can recommend this article (in german) on how to integrate nextcloud with UCS:

ok do you know if there is a way to remove this warning if i choose option 1

Thanks !

Google helped me to find this:
insert the bold line in config.php:
‘memcache.local’ => ‘\\OC\\Memcache\\APCu’,
’memcache.locking’ => ‘\\OC\\Memcache\\APCu’,
‘filelocking.enabled’ => ‘true’,
this helped me to get rid of the warning.

Here is what look my config.php file. Ive add the 2 lines bellow in bold. Reboot the serveur and im still seeing the error

’memcache.locking’ => ‘\OC\Memcache\APCu’,
’filelocking.enabled’ => ‘true’,

Processing: config.php…

config.php

Any idea what to do next ?

Thanks !

Is there a way to format my text fast and easy to use Markdown formating ?

Please check your config.php - see your screenshot:
You did copy the format-command of the forum ("**") withe the two lines.
Please remove the asterisks at the beginning and the end of the lines.

Ive double check and everything is alright in the file /var/lib/univention-appcenter/apps/nextcloud/data/integration/config/config.php

It was a screenshot in notepad++ that ive took

It is independent of the software, you use to display the config.php.
Please remove the asterisks (red circles) from config.php - they don’t belong to the configuration:
grafik

Like i said it’s not their. Ive download the file on my Windows pc and edit it and i don’t see the asterix

config.php2

If you copy and paste the text instead of a screenshot, it will be better readable :wink:

I have no more idea, how to help you.
Maybe you will find a helpful information here:

Yeah i know but when im copying the php content here it’s all messed up

Thanks for the link ive check but did not found useful information. I guess ill stick with that warning for now

Mastodon