[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
  • Upvote 1
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

 

  • Like 1
  • Thanks 4
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...
  • 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...
  • 1 month later...
On 7/6/2022 at 2:25 AM, Abigel said:

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?

I also would like to know the answer to this question.... 

 

From my research of how redis is setup... my understanding is that it would be somewhat a bad idea if they are entirely unrelated databases.... but i am not an expert and I guess the only other alternative would be spinning up multiple containers

Link to comment
  • 1 month later...
  • 2 weeks later...

I have this in my Redis logs:

Quote

1:M 12 Jan 2023 10:54:44.361 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. 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

 

I don't know if this is a Redis option to change or a system option to change. Any idea if it's possible (or recommended) to change?

Thanks.

  • Upvote 1
Link to comment
  • 2 weeks later...

having the same issue with redis.

i created a file-link between my docker and unraid and created a redis.conf file.

when starting i also recieve the message, that there is no redis.conf specified. if i try to load my custom-conf-file into the redis-server, it aborts the loading, because it is already listening to the 6379 port.

it there a way to tell the docker on startup to load my custom config?

if it post "redis-server /data/redis.conf" in the post-arguments redis wont start at all.

 

does anyone have any ideas?

Link to comment
  • 2 months later...

Hi!

 

Is this still being maintained?

 

I'm having a few issues.

 

1. The Port mapping from docker to host is mandatory, so I can't remove it. But maybe I can do that manually?

2. The "Support" link in the Unraid Docker GUI is wrong, so I had to find this thread manually.

 

Any tips would be helpful :)

Link to comment
On 1/12/2023 at 11:58 AM, jademonkee said:

I have this in my Redis logs:

 

I don't know if this is a Redis option to change or a system option to change. Any idea if it's possible (or recommended) to change?

Thanks.

if this shouldn't be configured like this, then it would be nice to have this default in the docker in stead of changing it after deployment?

  • Like 1
Link to comment
  • 9 months later...
On 1/12/2023 at 2:58 AM, jademonkee said:

I have this in my Redis logs:

 

I don't know if this is a Redis option to change or a system option to change. Any idea if it's possible (or recommended) to change?

Thanks.

No clue if it is an actual issue in the latest update and the warning is just a leftover, but I ran the recommended command "sysctl vm.overcommit_memory=1" in unraid's main terminal and that seems to have done something, well applied whatever this actually means. The warning though is still a warning and seems to stay around from the beginning, it doesn't actually verify if it is something that needs to be done on installed PC. 

I am not sure if my data is not large enough or what, but I'm not really seeing any benefits from Redis, in fact I think it made response worse, but it does get rid of that security warning in the overview. Not sure if I will keep it around since so far it just seems like unnecessary utilization of resources, even though it does seem like minor utilization.

Link to comment
9 hours ago, Facsimile8512 said:

No clue if it is an actual issue in the latest update and the warning is just a leftover, but I ran the recommended command "sysctl vm.overcommit_memory=1" in unraid's main terminal and that seems to have done something, well applied whatever this actually means. The warning though is still a warning and seems to stay around from the beginning, it doesn't actually verify if it is something that needs to be done on installed PC. 

I am not sure if my data is not large enough or what, but I'm not really seeing any benefits from Redis, in fact I think it made response worse, but it does get rid of that security warning in the overview. Not sure if I will keep it around since so far it just seems like unnecessary utilization of resources, even though it does seem like minor utilization.

Yeah, I'm clueless as to if it made any difference for me, but figure that I've gone to to the trouble of setting it up and it takes up so little resources that I might as well keep it around. I initially installed it to try and get my photos to load faster in my photo app. I applied so many fixes that I have no idea what fixed it, but it's working well enough now, so I don't want to rock the boat.

Link to comment
  • 2 weeks later...
On 9/7/2022 at 6:48 PM, Squid said:

Advanced View

Hi, I tried adding redis-server --requirepass myPassword to Post Arguments, but the container wouldn't start. Logs shows the following error:

Reading the configuration file, at line 2
>>> 'requirepass'
wrong number of arguments

 

Can anyone please tell me what I'm doing wrong ?

 

Edited by cruzerkk
Link to comment

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.