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

Add an option to disable MGET splitting in Redis (to avoid performance penalty) #32069

Closed
hedgesky opened this issue Jan 26, 2024 · 8 comments
Closed
Labels
area/redis enhancement Feature requests. Not bugs or questions. question Questions that are neither investigations, bugs, nor enhancements stale stalebot believes this issue/PR has not been touched recently

Comments

@hedgesky
Copy link

hedgesky commented Jan 26, 2024

Hello 👋
I have a question regarding splitting Redis MGET commands into multiple GET ones (implemented here). Would it be possible to add a configuration option to disable this behavior?

Let me describe the use case. We're adding Envoy as a proxy to a Redis Cluster. Our app sends MGET requests with dozens of keys like {my_user_id}:key1, {my_user_id}:key2, etc. As the user id is the same in all the keys, all of them are guaranteed to be hashed to the same slot.

With a regular Redis Cluster, only one command is executed (the MGET one). With Envoy, however, the MGET is split into N separate GET requests, which incurs a noticeable performance hit. Having an option to disable splitting would allow us to avoid that penalty.
UPD. A similar issue seems to apply to DEL, EXISTS, TOUCH, and UNLINK commands (source).

Relevant links:

@hedgesky hedgesky added enhancement Feature requests. Not bugs or questions. triage Issue requires triage labels Jan 26, 2024
@zuercher zuercher added question Questions that are neither investigations, bugs, nor enhancements area/redis and removed triage Issue requires triage labels Jan 27, 2024
@zuercher
Copy link
Member

cc @weisisea @mattklein123

@deveshkandpal1224
Copy link
Contributor

I think this would also benefit this github issue ( not splitting the MGET request to individual GET request ) -> #31038.

Copy link

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label Feb 29, 2024
@weisisea
Copy link
Contributor

weisisea commented Mar 4, 2024

This makes sense. One idea is that for a multi-key command, we can calculate the hash of the keys and send the command without splitting to the target Redis node if all the key hashes are the same.

@weisisea
Copy link
Contributor

weisisea commented Mar 4, 2024

@zuercher could you please advise on how to add the label "help-wanted"? It seems that I wasn't able to find a way to add the label. Thanks!

@github-actions github-actions bot removed the stale stalebot believes this issue/PR has not been touched recently label Mar 4, 2024
@weisisea
Copy link
Contributor

weisisea commented Mar 4, 2024

/help

Copy link

github-actions bot commented Apr 3, 2024

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label Apr 3, 2024
Copy link

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/redis enhancement Feature requests. Not bugs or questions. question Questions that are neither investigations, bugs, nor enhancements stale stalebot believes this issue/PR has not been touched recently
Projects
None yet
Development

No branches or pull requests

4 participants