-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Deprecation warnings for 'script' commands to redis when using redis-namespace #3366
Comments
Why are you using namespacing at all? |
We run a number of different tasks/codebases on the same Redis Node/Instance and so use namespaces to separate our tasks/codebases. It avoids us having to examine which databases on Redis are already in use, and any clashes that could arise from that. |
Just so you are aware, I can't support running multiple different Sidekiq Pro/Enterprise apps within one Redis DB. They might be running different versions and some features require coordination which can break with multiple apps, e.g. leader election. It might work 95% of the time but it's impossible to predict what will happen and subtle breakage is almost guaranteed over time. I strongly urge people to use Redis DBs at minimum to isolate their apps. Namespaces are a hack. |
+1 to "Namespaces are a hack." I stopped using them for similar, difficult to troubleshoot problems. Segregate by database instead. |
Hi! I have the same warning with Sidekiq Community. I use
Would you suggest to use 1 DB per service? It seems a bit overkill IMHO. The warning :
The gems I use :
|
I have no plans to "fix" this. Either you peg an older version or you stop using redis-namespace. My opinion is very clear: redis-namespace is a hack and its use is discouraged. I believe you should use different databases for services and different instances for apps. |
Thanks for your advices (http://www.mikeperham.com/2015/09/24/storing-data-with-redis/). The trick here was to use And thank you for this very useful gem! |
Hi @mperham, Thank you for providing clear feedback around the usage of namespaces. We will look to move our usage away from namespaces towards separate databases/instances. Cheers, Phil |
@mperham can you please then give me a recommendation how to separate db for development and test db correctly? I tried to use such code: config/initializers/sidekiq.rb unless Rails.env.production?
Sidekiq.configure_server do |config|
config.redis = { url: 'redis://localhost:6379/0', namespace: "sidekiq_app_name_#{Rails.env}" }
end
Sidekiq.configure_client do |config|
config.redis = { url: 'redis://localhost:6379/0', namespace: "sidekiq_app_name_#{Rails.env}" }
end
end But that requested me to use |
@Loremaster just use a different database for test. Sidekiq.configure_server do |config|
config.redis = { db: Rails.env.test? ? 1 : 0 }
end
Sidekiq.configure_client do |config|
config.redis = { db: Rails.env.test? ? 1 : 0 }
end |
@mperham thank you very much for that!! |
@mperham We have a legacy setup where we use only 1 namespace: 'resque'. I'd be 👍 on removing this from our setup but am concerned that we'd lose unprocessed jobs when deploying this change. How would you suggest we migrate from an old namespace to no namespace in production? |
@TheTeaNerd That namespace definitely has to go. 😆 I will write up something on how to migrate away from namespaces for my blog but it will take a few days. |
Ruby version:
Sidekiq / Pro / Enterprise version(s): Sidekiq Pro 3.4.3 / Sidekiq Enterprise 1.5.1
I am getting deprecation warnings on using 'scripts' command with Redis, mentioning that support for these will be gone in the next major release of
redis-namespace
. I have attempted to remove various configuration options from my initialiser, but nothing stops the deprecation warning appearing, leading me to believe this is a problem with using Sidekiq Enterprise and Redis namespace.Any advice or suggestions would be greatly appreciated.
The text was updated successfully, but these errors were encountered: