[Support] jj9987 - Redis


jj9987

Recommended Posts

Redis-banner.png

Application: Redis @ https://redis.io/

DockerHub: https://hub.docker.com/_/redis/

GitHub: https://github.com/juusujanar/unraid-templates/blob/master/Redis.xml

 

This template uses the official Redis Docker image to quickly set up a Redis cache instance according to your configuration.

 

If you have any issues/questions/suggestions regarding this Docker or the template, feel free to contact here.

Edited by jj9987
Link to comment
  • 2 years later...

Well, Redis seems to be working but there's no config file mapped to nothing we can edit. 

 

Upon opening the container I'm getting a number of warnings.

Not an issue most likely for a home server setup, but would like to work to fix these if possible? 

 

1:C 05 Oct 2020 23:47:34.407 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 05 Oct 2020 23:47:34.407 # Redis version=6.0.8, bits=64, commit=00000000, modified=0, pid=1, just started

1:C 05 Oct 2020 23:47:34.407 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf

1:M 05 Oct 2020 23:47:34.408 * Running mode=standalone, port=6379.
1:M 05 Oct 2020 23:47:34.408 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.

1:M 05 Oct 2020 23:47:34.408 # Server initialized
1:M 05 Oct 2020 23:47:34.408 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.

1:M 05 Oct 2020 23:47:34.408 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo madvise > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled (set to 'madvise' or 'never').

 

Edited by CorneliousJD
Link to comment
  • 3 weeks later...
On 10/5/2020 at 11:14 PM, CorneliousJD said:

 


1:C 05 Oct 2020 23:47:34.407 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 05 Oct 2020 23:47:34.407 # Redis version=6.0.8, bits=64, commit=00000000, modified=0, pid=1, just started

1:C 05 Oct 2020 23:47:34.407 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf

1:M 05 Oct 2020 23:47:34.408 * Running mode=standalone, port=6379.
1:M 05 Oct 2020 23:47:34.408 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.

1:M 05 Oct 2020 23:47:34.408 # Server initialized
1:M 05 Oct 2020 23:47:34.408 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.

1:M 05 Oct 2020 23:47:34.408 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo madvise > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled (set to 'madvise' or 'never').

 

I happen to have these same errors popping up. Did you happen to resolve them and/or have they caused any issues?

Link to comment
  • 2 months later...
  • 4 weeks later...
On 1/23/2021 at 4:22 PM, Banuseka said:

nextcloud me now tells that ist would need a pwd to access redis but i havn‘t set one in nextcloud or redis itself. how can i set a pwd in the redis container?

 

best, Banu

Add this to Post Arguments in the template:

Quote

redis-server --requirepass password

 

  • Thanks 3
Link to comment
  • 4 weeks later...
  • 1 month later...
  • 7 months later...
On 5/11/2021 at 3:48 PM, GuilhermeFluis said:

Somebody here was able to use this container with Linuxserver.io Nextcloud? I tried the environment variables on the Nextcloud container but it basically ignored, I tried editing the config.php file but this made the container not start...

 

If someone could help me I would be very glad

 

Did you get this to work? If so, can you share please?

Link to comment
  • 2 weeks later...
On 1/5/2022 at 11:53 AM, Boyturtle said:

Did you get this to work? If so, can you share please?

 

Redis volume path "/data" <-> "/mnt/user/appdata/redis/data"

 

thats works for me: (my Nextcloud config.php)

'memcache.local' => '\\OC\\Memcache\\APCu',
'memcache.distributed' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\\Memcache\\Redis',
'redis' => [
     'host' => 'redis-host.example.com',
     'port' => 6379,
],

 

Br

Edited by onkelblubb
Link to comment
  • 1 month later...

Hi all,

I have installed Redis to try and improve the performance of the gallery in NextCloud.

I have set it up as per a combination of the official documentation, and this guide written for the LSIO Unraid NextCloud Docker image: https://skylar.tech/reduce-nextcloud-mysql-usage-using-redis-for-cache/

I notice above that @onkelblubbhas mapped a directory for "/data" but I didn't add that to the Docker setup. There is no Redis folder in my appdata dir.

My NextCloud config file looks like:

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

 

I note that the official NextCloud documentation has the formatting slightly different (note the single slashes rather than double, and the lack of 'array' in the Redis definition):

'memcache.local' => '\OC\Memcache\APCu',
'memcache.distributed' => '\OC\Memcache\Redis',
'memcache.locking' => '\OC\Memcache\Redis',
'redis' => [
     'host' => 'redis-host.example.com',
     'port' => 6379,
],

 

Any idea if that's problematic?

I also have no idea if it's working or not? The Redis log is just absolutely filled with:

[truncated]
...
1:M 21 Feb 2022 13:43:31.044 * 1 changes in 3600 seconds. Saving...
1:M 21 Feb 2022 13:43:31.044 * Background saving started by pid 179
179:C 21 Feb 2022 13:43:31.050 * DB saved on disk
179:C 21 Feb 2022 13:43:31.051 * RDB: 0 MB of memory used by copy-on-write
1:M 21 Feb 2022 13:43:31.145 * Background saving terminated with success
1:M 21 Feb 2022 13:55:38.286 * 100 changes in 300 seconds. Saving...
1:M 21 Feb 2022 13:55:38.287 * Background saving started by pid 180
180:C 21 Feb 2022 13:55:38.294 * DB saved on disk
180:C 21 Feb 2022 13:55:38.295 * RDB: 0 MB of memory used by copy-on-write
1:M 21 Feb 2022 13:55:38.387 * Background saving terminated with success
1:M 21 Feb 2022 14:00:39.004 * 100 changes in 300 seconds. Saving...
1:M 21 Feb 2022 14:00:39.004 * Background saving started by pid 181
181:C 21 Feb 2022 14:00:39.011 * DB saved on disk
181:C 21 Feb 2022 14:00:39.011 * RDB: 0 MB of memory used by copy-on-write
1:M 21 Feb 2022 14:00:39.105 * Background saving terminated with success
1:M 21 Feb 2022 14:20:19.561 * 100 changes in 300 seconds. Saving...
1:M 21 Feb 2022 14:20:19.561 * Background saving started by pid 182
182:C 21 Feb 2022 14:20:19.569 * DB saved on disk
182:C 21 Feb 2022 14:20:19.570 * RDB: 0 MB of memory used by copy-on-write
1:M 21 Feb 2022 14:20:19.662 * Background saving terminated with success
1:M 21 Feb 2022 14:44:32.005 * 100 changes in 300 seconds. Saving...
1:M 21 Feb 2022 14:44:32.005 * Background saving started by pid 183
183:C 21 Feb 2022 14:44:32.015 * DB saved on disk
183:C 21 Feb 2022 14:44:32.015 * RDB: 0 MB of memory used by copy-on-write
1:M 21 Feb 2022 14:44:32.106 * Background saving terminated with success
1:M 21 Feb 2022 14:49:33.079 * 100 changes in 300 seconds. Saving...
1:M 21 Feb 2022 14:49:33.079 * Background saving started by pid 184
184:C 21 Feb 2022 14:49:33.089 * DB saved on disk
184:C 21 Feb 2022 14:49:33.089 * RDB: 0 MB of memory used by copy-on-write
1:M 21 Feb 2022 14:49:33.180 * Background saving terminated with success

 

The reason I installed it was to try and speed up the NextCloud gallery on Android, so that I can browse a shared photo folder. It was previously unusably slow. So I installed Redis as well as the Preview Generator app and pre-cached the images. So the gallery is now working faster (though not as fast as I'd like), but I have no idea if it's just because of the pre-generated thumbnails, or if Redis is also playing a role.

As far as usage goes on Redis, it's using about 10MB RAM and less than 1% CPU, even when I'm scrolling through the image directory on the Android app. To me, that doesn't seem like it's doing much.

There are no errors in the NextCloud log.

 

Your insight and help is appreciated!

 

EDIT:

I just thought I'd try mapping an appdata dir, and the Redis logs showed:

1:C 21 Feb 2022 15:14:44.856 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 21 Feb 2022 15:14:44.856 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 21 Feb 2022 15:14:44.856 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 21 Feb 2022 15:14:44.857 * monotonic clock: POSIX clock_gettime
1:M 21 Feb 2022 15:14:44.858 * Running mode=standalone, port=6379.
1:M 21 Feb 2022 15:14:44.858 # Server initialized
1:M 21 Feb 2022 15:14:44.858 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:M 21 Feb 2022 15:14:44.858 * Ready to accept connections

 

So I removed the path mapping, and I have the same message in the logs. I have no idea if it was there when I first started Redis, as the logs are filled with the messages above. I decided that I might as well add the mapping back, so have done so.

The appdata dir that was created by the mapping is empty. Any tips on what could be in the config file for a Redis Docker/Unraid setup?

EDIT: the dir now has a "dump.rdb" in it, but nothing else.

As I browse the shares in NextCloud, the log fills up with the messages like above:

1:C 21 Feb 2022 15:21:06.136 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 21 Feb 2022 15:21:06.136 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 21 Feb 2022 15:21:06.136 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 21 Feb 2022 15:21:06.137 * monotonic clock: POSIX clock_gettime
1:M 21 Feb 2022 15:21:06.137 * Running mode=standalone, port=6379.
1:M 21 Feb 2022 15:21:06.137 # Server initialized
1:M 21 Feb 2022 15:21:06.137 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:M 21 Feb 2022 15:21:06.138 * Loading RDB produced by version 6.2.6
1:M 21 Feb 2022 15:21:06.138 * RDB age 382 seconds
1:M 21 Feb 2022 15:21:06.138 * RDB memory usage when created 0.77 Mb
1:M 21 Feb 2022 15:21:06.138 # Done loading RDB, keys loaded: 1, keys expired: 2.
1:M 21 Feb 2022 15:21:06.138 * DB loaded from disk: 0.000 seconds
1:M 21 Feb 2022 15:21:06.138 * Ready to accept connections
1:M 21 Feb 2022 15:28:20.667 * 100 changes in 300 seconds. Saving...
1:M 21 Feb 2022 15:28:20.667 * Background saving started by pid 19
19:C 21 Feb 2022 15:28:20.671 * DB saved on disk
19:C 21 Feb 2022 15:28:20.672 * RDB: 0 MB of memory used by copy-on-write
1:M 21 Feb 2022 15:28:20.768 * Background saving terminated with success

 

So are the logs normal? Do I need to setup a config file for Redis? Is Redis working properly (as the logs are reacting to me browsing photos, I'm guessing it is?)?

Edited by jademonkee
Added info on data path mapping
Link to comment
  • 2 months later...
On 2/18/2021 at 1:41 PM, BlueRyuu said:

Add this to Post Arguments in the template:

 

I don't know why but upgrading my server to 6.10 required adding this to prevent it from crashing on start. When it was working fine before without.

Link to comment
  • 1 month later...

Hi,  is it possible to use redis for multiple docker container?  Like for nextcloud, overleaf, authelia etc. So that all Containers are connecting to the same redi container and each with the same login, nothing diffrent, all on the same url and same password. Or will it occur problems?

Link to comment
  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.