Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I add external Redis support to an existing Docker install? #946

Closed
ajtatum opened this issue Dec 30, 2020 · 7 comments
Closed

How do I add external Redis support to an existing Docker install? #946

ajtatum opened this issue Dec 30, 2020 · 7 comments
Labels

Comments

@ajtatum
Copy link

ajtatum commented Dec 30, 2020

I have a Managed Redis Instance hosted on Digital Ocean. Their managed instances are running Redis 6.

username = default
password = [my password]
host = [my server].db.ondigitalocean.com
port = [my port]

The connection string looks like:

rediss://default:[my password]@[my server].db.ondigitalocean.com:[my port]

Looking at the documentation, it looks like you have you can only specify the Redis Server via TCP (which is fine I suppose), but I don't see how I supply the username and password for that Redis server. Additionally, it would be nice if I could specify which database to use so that it's not sharing the same database as my other applications.

Is this currently supported? If so, how can I make the change to my existing Docker image environment variables?

If it's not supported, let me know if I should create a feature request or if this can be converted to one.

Thanks,
AJ

@acelaya
Copy link
Member

acelaya commented Dec 30, 2020

I'll check later today how it's done and come back to you.

If it's not possible, I'll convert this in a feature request.

Just in case, have you tried if it works with the redis://... URI?

@ajtatum
Copy link
Author

ajtatum commented Dec 30, 2020

I did not. How would I go about updating the configuration to try it out?

@acelaya
Copy link
Member

acelaya commented Dec 30, 2020

It depends. How are you running Shlink? Docker, self hosted swoole or nginx/apache?

@ajtatum
Copy link
Author

ajtatum commented Dec 30, 2020

I went with Docker, but I'm starting to double think that decision as I'm not too familiar with actually running Docker in production. It was the easiest to get up and running though. I have nginx running as a proxy server in front of it, as suggested in the documentation.

@acelaya
Copy link
Member

acelaya commented Dec 30, 2020

Cool.

You can use whatever option suits your needs. I was asking because setting new config options is different.

For the docker image you can just pass the REDIS_SERVERS env var with the URI.

https://shlink.io/documentation/install-docker-image/#use-an-external-redis-server

However, I have to admit redis is quite underused by Shlink at the moment. You won't get very high benefits from it, unless you plan to run a cluster of Shlink instances.

@ajtatum
Copy link
Author

ajtatum commented Dec 30, 2020

Cool, well I'll try it out. I don't plan to run a cluster of Shlink instances. I was hoping it would cache Urls and whatnot to save it from hitting the database every time someone clicks a link. Are there upcoming plans to use it more?

@acelaya
Copy link
Member

acelaya commented Dec 30, 2020

Shlink used to cache more stuff, but it didn't add a significant performance improvement, so I ended up removing it for the sake of simplifying the code.

I have done some load tests in the past, and in general, performance is good.

The biggest bottleneck is in loading big amounts of visits from the API (I have documented some of that here #780).

However, that does not affect end users.

So there's no specific plans on caching stuff just for the sake of it, but I will if there's a clear need under high load scenarios. And when that happens, redis will be one of the supported systems for caching.

@acelaya acelaya closed this as completed Feb 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants