docker
docker copied to clipboard
Set dbindex to separate data in a single Redis instance by environment variable
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
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
This seems very helpful! Can this be merged or finalized? 🙏🏼 🙏🏼 🙏🏼
Any updates? I think this would be pretty useful :/
In what case is this useful? The recommend deployment is to use a dedicated Redis container for each independent application.
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.