Skip to content

[5.8] Prefix redis database connection by default #4982

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

Merged
merged 2 commits into from
Apr 5, 2019
Merged

[5.8] Prefix redis database connection by default #4982

merged 2 commits into from
Apr 5, 2019

Conversation

DivineOmega
Copy link
Contributor

This PR prefixes the redis database connection by default to mitigate multiple sites on the same server potentially sharing the same queued jobs. It uses similar logic to that which is used for creating the cache prefix.

…s on the same server potentially sharing the same queued jobs
@driesvints driesvints changed the title Prefix redis database connection by default [5.8] Prefix redis database connection by default Apr 4, 2019
@DivineOmega
Copy link
Contributor Author

Thanks.

@DivineOmega DivineOmega deleted the patch-1 branch April 5, 2019 15:12
@fitztrev
Copy link

fitztrev commented Apr 5, 2019

I just tried this and looked at the results in Redis. There might be a couple issues.

  1. Horizon overrides the config and sets its own prefix. So whatever prefix is set under this config is ignored and there may still end up being conflicts between sites for horizon:* keys if they don't also have unique horizon.prefix configs.

  2. In Redis, keys are now showing up as:

laravel_databaselaravel_cache:foo     <-- for a cached value
laravel_databasequeues:default:job    <-- for a queued job

Should the prefix be appended with an underscore?

@ludo237
Copy link

ludo237 commented Apr 6, 2019

Interesting @fitztrev, @DivineOmega what do you think?

realodix added a commit to realodix/urlhub that referenced this pull request Apr 8, 2019
…s on the same server potentially sharing the same queued jobs

laravel/laravel#4982
realodix added a commit to realodix/urlhub that referenced this pull request Apr 8, 2019
@DivineOmega
Copy link
Contributor Author

@fitztrev @ludo237 @gerardnll I agree with adding an additional underscore to the prefix. I'll tweak this.

@DivineOmega
Copy link
Contributor Author

@fitztrev @ludo237 @gerardnll I've opened a PR for this here: #4986

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants