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 Jedis and Lettuce benchmarks #1

Closed
wants to merge 34 commits into from
Closed

Conversation

jonathanl-bq
Copy link

This PR is based off of Andrew's fork. It measures the average latency, 50, 90, and 99 percentile latencies, and standard deviation for Jedis and Lettuce clients, similar to the existing benchmarks for Python and Node. It still is missing some functionality, like measuring tasks per second and asynchronous tests, which should be implemented in a later PR.

There's also an issue where running ./gradlew test only executes the tests once. Trying to run it a second time will not execute the tests or print any benchmark results. There's probably a Gradle setting to stop it from doing this, but I'm not sure how yet.

@Yury-Fridlyand
Copy link

Probably, you need to update .gitignore to exclude build and .gradle dirs and *.class files and/or remove them manually.

static final int SIZE_GET_KEYSPACE = 3750000;
static final int SIZE_SET_KEYSPACE = 3000000;

private static ChosenAction randomAction() {

Choose a reason for hiding this comment

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

So test makes 80% SETs, 16% GET_NON_EXISTING and 4% GET_EXISTING - is that correct?

Copy link
Author

Choose a reason for hiding this comment

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

I believe so. It's just like how the Node benchmarks select actions. We can certainly bring this up for discussion if we want to do this a different way, however.

// create the Options
Options options = new Options();

options.addOption("c", "configuration", true, "Configuration flag [Release]");

Choose a reason for hiding this comment

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

add dataSize (-d)

runJava=1
chosenClients="Lettuce"
;;
-lettuce)

Choose a reason for hiding this comment

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

Suggested change
-lettuce)
-jedis)

cd ${BENCH_FOLDER}/../java
echo "./gradlew run --args=\"--resultsFile=${BENCH_FOLDER}/$1 --clients $chosenClients --host $host --port $port\""
# ./gradlew run --args="--resultsFile=../$1 --dataSize $2 --concurrentTasks $concurrentTasks --clients $chosenClients --host $host --port $port --clientCount $clientCount $tlsFlag"
./gradlew run --args="--resultsFile=${BENCH_FOLDER}/$1 --clients $chosenClients --host $host --port $port"

Choose a reason for hiding this comment

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

reminder for

  • --dataSize
  • --concurrentTasks
  • --clientCount
  • $tlsFlag

@@ -0,0 +1,3 @@
[env]
BABUSHKA_NAME = { value = "BabushkaPy", force = true }

Choose a reason for hiding this comment

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

rename

jonathanl-bq and others added 16 commits October 3, 2023 13:33
Signed-off-by: acarbonetto <[email protected]>
* Add a java app to run benchmarks

---------

Signed-off-by: acarbonetto <[email protected]>
* Merge Pull Request #5 - Add java pipeline.

Also changed:
* Merged two projects.
* Updated CI.
* Fixed tests and updated `junit` version.
* Spotless.
* Add new gradle tasks.

Signed-off-by: Yury-Fridlyand <[email protected]>
* Add sync and async clients both to tests.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Minor fixes.

Signed-off-by: Yury-Fridlyand <[email protected]>

---------

Signed-off-by: Yury-Fridlyand <[email protected]>
…onvert to TypeScript. (valkey-io#456)

removed duplicated logic and refactored to typescript

Signed-off-by: acarbonetto <[email protected]>
Yury-Fridlyand and others added 3 commits October 3, 2023 13:35
* Add Jedis and Lettuce benchmarks

* Start ignoring .gradle files

* Update gitignore and remove generated files from git

Signed-off-by: acarbonetto <[email protected]>

* Update gitignore and remove generated files from git

Signed-off-by: acarbonetto <[email protected]>

* Update gitignore and remove generated files from git

Signed-off-by: acarbonetto <[email protected]>

* Add benchmarks for GET non-existing

* Revert "Update gitignore and remove generated files from git"

This reverts commit d9b26a6.

* fix redis-rs submodules

Signed-off-by: acarbonetto <[email protected]>

* Randomize commands in Java benchmarks

* rename chooseAction to randomAction

* Add a Java benchmarking app (#7)

* Add a java app to run benchmarks

---------

Signed-off-by: acarbonetto <[email protected]>

* Add Readme and update install_and_test script to runJava

Signed-off-by: acarbonetto <[email protected]>

* Add Readme and update install_and_test script to runJava

Signed-off-by: acarbonetto <[email protected]>

* Combine java pipeline and java benchmarks (#8)

* Merge Pull Request #5 - Add java pipeline.

Also changed:
* Merged two projects.
* Updated CI.
* Fixed tests and updated `junit` version.
* Spotless.
* Add new gradle tasks.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Add sync and async clients both to tests. (#12)

* Add sync and async clients both to tests.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Minor fixes.

Signed-off-by: Yury-Fridlyand <[email protected]>

---------

Signed-off-by: Yury-Fridlyand <[email protected]>

* Add dataSize option to java benchmark.

Signed-off-by: Yury-Fridlyand <[email protected]>

---------

Signed-off-by: acarbonetto <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
Co-authored-by: Jonathan Louie <[email protected]>
Co-authored-by: acarbonetto <[email protected]>
Co-authored-by: jonathanl-bq <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>

Choose a reason for hiding this comment

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

revert?

Yury-Fridlyand and others added 13 commits October 5, 2023 14:01
* Add option to run tests on multiple clients in concurrency

* Common pool of iterations.
* Awaiting result from async methods.

Signed-off-by: Yury-Fridlyand <[email protected]>

* minor fix

Signed-off-by: Yury-Fridlyand <[email protected]>

* Change while-loop; Spotless Apply

Signed-off-by: acarbonetto <[email protected]>

---------

Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: acarbonetto <[email protected]>
Co-authored-by: acarbonetto <[email protected]>
* Updated ClientCount to client_count for uniformity for rust.
* Add JSON reporting.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Fix for #26.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Update java/benchmarks/src/main/java/javababushka/benchmarks/utils/Benchmarking.java

Signed-off-by: Yury-Fridlyand <[email protected]>

Co-authored-by: Andrew Carbonetto <[email protected]>

* Use `Optional`.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Address PR feedback.

Signed-off-by: Yury-Fridlyand <[email protected]>

---------

Signed-off-by: Yury-Fridlyand <[email protected]>
Co-authored-by: Andrew Carbonetto <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
* Add lettuce cluster client when cluster mode enabled

---------

Signed-off-by: Andrew Carbonetto <[email protected]>
acarbonetto and others added 2 commits November 14, 2023 14:54
Signed-off-by: acarbonetto <[email protected]>
* Add Java-client benchmarking app

Signed-off-by: acarbonetto <[email protected]>

* spotless apply

Signed-off-by: acarbonetto <[email protected]>

* Update on command line options

Signed-off-by: acarbonetto <[email protected]>

* Update README

Signed-off-by: acarbonetto <[email protected]>

* Spotless apply:

Signed-off-by: acarbonetto <[email protected]>

* Update README example

Signed-off-by: acarbonetto <[email protected]>

* update commandline defaults for review comments

Signed-off-by: acarbonetto <[email protected]>

* Remove TLS flag argument from option

Signed-off-by: acarbonetto <[email protected]>

* Add lettuce clients for benchmarking

Signed-off-by: acarbonetto <[email protected]>

* Spotless apply

Signed-off-by: acarbonetto <[email protected]>

* Add Jedis clients

Signed-off-by: acarbonetto <[email protected]>

* Add to app

Signed-off-by: acarbonetto <[email protected]>

* Add for-loop for data size list

Signed-off-by: acarbonetto <[email protected]>

* Add TPS for all async items

Signed-off-by: acarbonetto <[email protected]>

* spotless apply

Signed-off-by: acarbonetto <[email protected]>

* Fix TPS calculations

Signed-off-by: acarbonetto <[email protected]>

* Accept TLS as a flag

Signed-off-by: acarbonetto <[email protected]>

* Start threads; then wait for results

Signed-off-by: acarbonetto <[email protected]>

* Add java-jni client

Signed-off-by: acarbonetto <[email protected]>

* Handle Exceptions from client; add JniSyncClient fixes

Signed-off-by: acarbonetto <[email protected]>

* Clean up latency and add error checking

Signed-off-by: acarbonetto <[email protected]>

* Minor fixes.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Fix result printing.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Add TPS.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Remove duplicates. Reorganize and fix imports.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Int ctor fix.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Iteration 1.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Iteration 2: connected!

Signed-off-by: Yury-Fridlyand <[email protected]>

* Iteration 3: `get` and `set`.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Iteration 4: benchmark.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Iteration 5: some fixes.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Change number of threads in Benchmarking threadpool

* Revert "Change number of threads in Benchmarking threadpool"

This reverts commit e3f7596.

* Add more flushing rules and UT.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Client clean up.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Client optimizations. (#37)

* Client optimizations.

Signed-off-by: Yury-Fridlyand <[email protected]>

* minor cleanup.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Optimize building a command.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Typo fix.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Minor rename.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Clean up Redis close connection

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

* Clean up Redis close connection

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

* Minor changes.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Add todos to closeConnection()

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

---------

Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Andrew Carbonetto <[email protected]>
Co-authored-by: Andrew Carbonetto <[email protected]>

* Address PR feedback.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Rename

Signed-off-by: Yury-Fridlyand <[email protected]>

* Rename2

Signed-off-by: Yury-Fridlyand <[email protected]>

* Fix CI

Signed-off-by: Yury-Fridlyand <[email protected]>

* More fixes.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Some changes.

Signed-off-by: Yury-Fridlyand <[email protected]>

* add null check

Signed-off-by: Yury-Fridlyand <[email protected]>

* autoflush

Signed-off-by: Yury-Fridlyand <[email protected]>

* Apply suggestions from code review

Signed-off-by: Yury-Fridlyand <[email protected]>

Co-authored-by: Andrew Carbonetto <[email protected]>

* minor changes

Signed-off-by: Yury-Fridlyand <[email protected]>

---------

Signed-off-by: acarbonetto <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Andrew Carbonetto <[email protected]>
Co-authored-by: acarbonetto <[email protected]>
Co-authored-by: Jonathan Louie <[email protected]>
@Yury-Fridlyand
Copy link

Already merged on upstream

@Yury-Fridlyand Yury-Fridlyand deleted the java_benchmarks branch December 15, 2023 18:33
@cyip10 cyip10 mentioned this pull request Jun 28, 2024
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.

4 participants