-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Implement multi-key slice async queries for CQL storage backend [cql-tests] [tp-tests] #3760
Implement multi-key slice async queries for CQL storage backend [cql-tests] [tp-tests] #3760
Conversation
651c969
to
edc4106
Compare
edc4106
to
d783b5d
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
d783b5d
to
b2c669b
Compare
b2c669b
to
d8c91ea
Compare
Default Benchmarks Execution commands:
Current PR:
Conclusion: Existing tests didn't show any difference (no regression and no improvement). Looks like there were no CQL Benchmark tests executed. |
d8c91ea
to
d491add
Compare
@li-boxuan do you know how to run CQL Benchmark tests? Looks like |
@porunov This benchmark CI does not run on PR. You can find the result (posted by If you want to run it locally, do the following (or see
Tested the above commands on my laptop. You don't need to start |
d491add
to
bde81d2
Compare
Tried to execute this benchmark but couldn't. Probably something with my local environment. Need to investigate.
|
Let me run the benchmark locally and update here. |
Thank you. The PR is still WIP. CQL tests are failing right now. You could try executing tests for Also, I think it could be helpful to change CQL benchmark tests to start Cassandra Testcontainer (or directly a docker image) and execute those tests against that Cassandra container, similarly as we do for other tests right now. If so, it will be possible to run tests with docker only requirement. |
The original thought was to be able to run benchmarks in a distributed setting and to follow what the official Cassandra testing suite does. I didn't expect it would be troublesome to run on different environments since the CI seems to be happy with it. |
bde81d2
to
d68e117
Compare
That's a good point. I think you are right. Let's leave it like it is. I will try to setup local environment and then add a documentation page on setting up the environment for the benchmark tests, just in case anyone has similar problems as I do. BTW. I'm not 100% sure, but I think I fixed the tests. At least |
Result on master (5159135, Apr 27)
Result on master (e332af6, May 3)
Result on your change (d68e117, May 5)
Looks like significant performance improvement 👍 |
Thank you @li-boxuan for running the tests! I think the Would you be able to execute the same test for
With this setting it will use 1024 threads for multi-query runs which should improve parallelism for some CQL IO operations and the results will be more fair after that. |
Here you go:
|
Thanks a lot! Indeed performance is better in this PR. I think the overhead of thread context switching is gone and it allowed for better overall performance. |
df0518a
to
02385f0
Compare
The PR is now ready for review. @li-boxuan pinging you as you showed interest in it earlier. @cdegroc you previously showed interest in changing the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, this is a very interesting PR! I didn't get a chance to finish reviewing, but I'll leave some thoughts and questions first.
...e/src/main/java/org/janusgraph/diskstorage/util/backpressure/SemaphoreQueryBackPressure.java
Outdated
Show resolved
Hide resolved
...e/src/main/java/org/janusgraph/diskstorage/util/backpressure/SemaphoreQueryBackPressure.java
Outdated
Show resolved
Hide resolved
...c/test/java/org/janusgraph/diskstorage/util/backpressure/SemaphoreQueryBackPressureTest.java
Outdated
Show resolved
Hide resolved
...sgraph-cql/src/main/java/org/janusgraph/diskstorage/cql/builder/CQLStoreFeaturesBuilder.java
Show resolved
Hide resolved
291bcfc
to
0134eb9
Compare
@li-boxuan I was wondering if you have a chance to review this PR. In case you don’t have enough capacity for the review, would you be OK with lazy consensus? |
Sorry for my procrastination. I'll make sure to finish the review by the end of this weekend. |
…tests] [tp-tests] - Adds multiQuery support to CQL storage backend. - Ensure `storage.parallel-backend-ops` thread pool is created only for storage backends which don't support multiQuery (multi-key slice operations). - Change purpose of `storage.cql.executor-service` to be used for results deserialization jobs only (not for IO operations). Fixes JanusGraph#2406 Fixes JanusGraph#3747 Fixes JanusGraph#3759 Related to JanusGraph#3170 Signed-off-by: Oleksandr Porunov <alexandr.porunov@gmail.com>
…re tests Signed-off-by: Oleksandr Porunov <alexandr.porunov@gmail.com>
Signed-off-by: Oleksandr Porunov <alexandr.porunov@gmail.com>
0134eb9
to
1e17c63
Compare
A note on tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I finally did one pass on this review. Great job @porunov ! I still have some confusion around the ChunkedJobDefinition
and its usage, but overall it's a pretty solid implementation.
...h-cql/src/main/java/org/janusgraph/diskstorage/cql/function/slice/AsyncCQLSliceFunction.java
Outdated
Show resolved
Hide resolved
janusgraph-core/src/main/java/org/janusgraph/diskstorage/util/StaticArrayEntryList.java
Show resolved
Hide resolved
janusgraph-core/src/main/java/org/janusgraph/diskstorage/util/StaticArrayEntryList.java
Show resolved
Hide resolved
janusgraph-core/src/main/java/org/janusgraph/diskstorage/util/StaticArrayEntryList.java
Show resolved
Hide resolved
janusgraph-core/src/main/java/org/janusgraph/diskstorage/util/ChunkedJobDefinition.java
Show resolved
Hide resolved
janusgraph-core/src/main/java/org/janusgraph/diskstorage/util/ChunkedJobDefinition.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Oleksandr Porunov <alexandr.porunov@gmail.com>
@li-boxuan pushed changes per your comments. Please, let me know if you have any doubts. |
janusgraph-core/src/main/java/org/janusgraph/diskstorage/util/StaticArrayEntryList.java
Show resolved
Hide resolved
Signed-off-by: Oleksandr Porunov <alexandr.porunov@gmail.com>
e5902ad
to
e1b5434
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love how you handled paging elegantly so that the CQL thread pool is now only for CPU workloads rather than I/O workloads!
I remember in my (unpublished) implementation, paging was a headache. I ended up using the CQL thread pool for pagination - which unfortunately meant that long queries (both deserialization and I/O workloads) could block short queries (only deserialization workloads). Your approach perfectly solved the problem 🎉
Thank you for your thoughtful review and help with running the benchmarks! I’m currently running benchmarks using external Cassandra (i.e. changing the hostname in the benchmark tests), but will figure out later how to use it directly. |
@cdegroc please, ping me if you have plans on reviewing this PR. Otherwise I'm going to merge it tomorrow. |
storage.parallel-backend-ops
thread pool is created only for storage backends which don't support multiQuery (multi-key slice operations).storage.cql.executor-service
to be used for results deserialization jobs only (not for IO operations).Performance improvements for multi-queries using CQL storage backend:
#3760 (comment)
#3760 (comment)
Fixes #2406
Fixes #3747 (see comment)
Fixes #3759
Suppress #3170
Thank you for contributing to JanusGraph!
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
master
)?For code changes:
For documentation related changes: