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

Java benchmarks Compare Jedis Sync benchmarking strategies #41

Closed
wants to merge 3 commits into from

Conversation

acarbonetto
Copy link

@acarbonetto acarbonetto commented Nov 24, 2023

Jedis runs best when sharing pooled connections. This was observed when running different variations of the jedisclient.

Jedis: common Jedis resource

./gradlew :benchmarks:run --args="-clients jedis -dataSize 100 -concurrentTasks \"1 10 100 1000\" -clientCount 1 -host $HOST -tls"
tasks tps GET GET SET
1 12107.425831 0.000080 0.000089 0.000078
10 DNF DNF DNF DNF
100 DNF DNF DNF DNF
1000 DNF DNF DNF DNF

Jedis: common JedisPool

./gradlew :benchmarks:run --args="-clients jedis_pool -dataSize 100 -concurrentTasks \"1 10 100 1000\" -clientCount 1 -host $HOST -tls"
tasks tps GET GET SET
1 12807.369924 0.000075 0.000075 0.000086
10 65814.875888 0.000149 0.000152 0.000155
100 83732.017733 0.000176 0.000180 0.000184
1000 82488.610038 0.000180 0.000182 0.000185

Jedis: common JedisPooled

./gradlew :benchmarks:run --args="-clients jedis_pooled -dataSize 100 -concurrentTasks \"1 10 100 1000\" -clientCount 1 -host $HOST -tls"
tasks tps GET GET SET
1 11913.923207 0.000078 0.000079 0.000099
10 64613.225661 0.000159 0.000149 0.000161
100 83708.944001 0.000177 0.000176 0.000187
1000 84812.234513 0.000177 0.000174 0.000183

Signed-off-by: Andrew Carbonetto <[email protected]>
Signed-off-by: Andrew Carbonetto <[email protected]>
Copy link

@Yury-Fridlyand Yury-Fridlyand left a comment

Choose a reason for hiding this comment

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

Will we ever merge this? If yes, you need to grap most recent changes from integ-java-client-milestone-1-* branches and change the base branch. If no, please mark as draft to avoid merge.

ClientName.BABUSHKA_ASYNC,
ClientName.LETTUCE,
ClientName.LETTUCE_ASYNC);
ClientName.LETTUCE);

Choose a reason for hiding this comment

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

jedis pool[ed]?

ClientName.JEDIS_ASYNC,
ClientName.BABUSHKA_ASYNC,
ClientName.LETTUCE_ASYNC);
case ALL_SYNC:

Choose a reason for hiding this comment

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

why?

assert connectionSettings.clusterMode
: "JedisClusterClient does not support disabled clusterMode: use JedisClient instead";

// TODO: use JedisCluster instead

Choose a reason for hiding this comment

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

todo

// check if the pool is properly connected
try (Jedis jedis = pool.getResource()) {
assert jedis.isConnected() : "failed to connect to jedis";
}

Choose a reason for hiding this comment

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

pool is auto-closed on this line


@Override
public String getName() {
return "Jedis";

Choose a reason for hiding this comment

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

put different names for clients


@Override
public String getName() {
return "Jedis";

Choose a reason for hiding this comment

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

rename

} catch (Exception e) {
// timed out - exception from Future::get
} catch (InterruptedException interruptedException) {
interruptedException.printStackTrace();

Choose a reason for hiding this comment

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

restore interrupt

}

Benchmarking.printResults(Benchmarking.calculateResults(latencies), 0, iterations);
// Map<ChosenAction, Benchmarking.Operation> actions = new HashMap<>();

Choose a reason for hiding this comment

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

uncommend or delete

@Yury-Fridlyand Yury-Fridlyand deleted the branch java_benchmarks December 15, 2023 18:33
@acarbonetto acarbonetto deleted the java_benchmarks-test-jedis branch December 19, 2023 22:24
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.

2 participants