docker icon indicating copy to clipboard operation
docker copied to clipboard

Set dbindex to separate data in a single Redis instance by environment variable

Open f466162 opened this issue 5 years ago • 2 comments

Hi,

I want to share a single Redis instance and use it with several independent applications. Thus, I need a way to specify the dbindex. As I'm using a Docker deployment, I'd like to add the dbindex using an environment variable. For my Nextcloud 19 (i.e. "production") installation, I tested the following way. As I cannot test for different Nextcloud versions, I made this change only in the Nextcloud 19 folder. Perhaps the if-statement can be reused for different Nextcloud versions and can be copy/pasted.

Regards Fabian

f466162 avatar Oct 25 '20 11:10 f466162

Hello, I have the same requirement. But setting the dbindex in the nextcloud config is not enough by itself. You also need to update the dbindex in the entrypoint.sh for the /usr/local/etc/php/conf.d/redis-session.ini file.

Thanks a lot!

Regards Stefan

stefan04 avatar May 29 '21 22:05 stefan04

This seems very helpful! Can this be merged or finalized? 🙏🏼 🙏🏼 🙏🏼

felix-exon avatar Sep 08 '22 19:09 felix-exon

Any updates? I think this would be pretty useful :/

efectn avatar Jan 08 '23 11:01 efectn

In what case is this useful? The recommend deployment is to use a dedicated Redis container for each independent application.

J0WI avatar Apr 04 '23 16:04 J0WI

It seems a better approach to this is to have many Redis instances. Correct me if I'm wrong, but Redis in mono-threaded so having many databases in same instance will create a bottleneck in performances. You can easily create many instances on different ports : https://medium.com/@starikovs/run-multiple-redis-instances-on-a-linux-server-systemd-approach-a7d1c75482bd and then set correct config on each nextcloud instance.

nderambure avatar Nov 06 '23 23:11 nderambure