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

feat(redis): Implement parallel cmd execution of Redis calls #4118

Merged
merged 12 commits into from
Oct 14, 2024

Conversation

iambriccardo
Copy link
Member

@iambriccardo iambriccardo commented Oct 8, 2024

This PR implements the parallelization of Redis calls via scoped threads. The goal is to avoid blocking calls when dealing with the MultiWrite Redis client.

Closes: #4100

@iambriccardo iambriccardo marked this pull request as ready for review October 8, 2024 08:46
@iambriccardo iambriccardo requested a review from a team as a code owner October 8, 2024 08:46
Copy link
Member

@jjbayer jjbayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes because of the "join".

relay-redis/src/real.rs Outdated Show resolved Hide resolved
relay-redis/src/real.rs Outdated Show resolved Hide resolved
relay-redis/src/real.rs Outdated Show resolved Hide resolved
relay-redis/src/real.rs Outdated Show resolved Hide resolved
relay-redis/src/real.rs Outdated Show resolved Hide resolved
relay-redis/src/real.rs Outdated Show resolved Hide resolved
Copy link
Member

@jjbayer jjbayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, we can merge this as an experiment, but we should keep a close eye on number of threads created vs OS thread limits wherever we deploy this. If spawning a thread for every call is not feasible, we'll have to move to a thread pool.

Joining on the secondaries should be fine as long as we assume them to be at least as fast as the primary.

relay-redis/src/real.rs Outdated Show resolved Hide resolved
relay-redis/src/real.rs Outdated Show resolved Hide resolved
@iambriccardo iambriccardo merged commit e4761f0 into master Oct 14, 2024
23 checks passed
@iambriccardo iambriccardo deleted the riccardo/feat/parallel-redis branch October 14, 2024 06:42
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.

Implement parallelism in multi-write Redis client
3 participants