-
Notifications
You must be signed in to change notification settings - Fork 975
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
Reactive Cluster MGET
is not running in parallel
#2395
Comments
I was worried that my explanation wasn't clear enough, so I added an example of the difference in repeated runs. RedisClusterClient client = RedisClusterClient.create("redis://localhost");
StatefulRedisClusterConnection<String, String> connect = client.connect();
RedisAdvancedClusterReactiveCommands<String, String> reactiveCommands = connect.reactive();
String[] keys = IntStream.rangeClosed(1, 500).boxed().map(index -> "key-" + index).toArray(String[]::new);
reactiveCommands.mget(keys).collectList().block();
long startTimeInMillis = System.currentTimeMillis();
for (int i = 0; i < 100; i++) {
reactiveCommands.mget(keys).collectList().block();
}
long endTimeInMillis = System.currentTimeMillis();
System.out.println(String.format("Total time in millis : %s", (endTimeInMillis - startTimeInMillis))); Here are the execution results of the code in both cases. The execution times vary slightly depending on the conditions, but the difference between the two is always significant.
|
MGET
is not running in parallel
@mp911de Can fix the same bug to version 6.1.x ? |
Hey @wenhaozhao , is this still relevant or can we close this issue? |
sure, please |
Lettuce 6.1.11.RELEASE should have the fix available |
Bug Report
RedisAdvancedClusterReactiveCommandsImpl.mget is not running in parallel
Current Behavior
If you run the code below, it will take a long time.
If I run the above code and check the Tcpdump, I can see that the requests and responses are alternating in order, like this.
That is, they are executed sequentially.
Expected behavior/code
I expect MGET commands to be executed in parallel.
Environment
Possible Solution
If the Flux#concat code is replaced with Flux#mergeSequential, the MGET commands are executed in parallel.
Additional context
The text was updated successfully, but these errors were encountered: