[KYUUBI #7655][SERVER] Support virtual threads in the binary frontend - #7656
[KYUUBI #7655][SERVER] Support virtual threads in the binary frontend#7656wangzhigang1999 wants to merge 3 commits into
Conversation
…nf.scala Co-authored-by: Cheng Pan <pan3793@gmail.com>
|
@pan3793 In the 10,000-connection capacity test, virtual threads reduced the Kyuubi Server OS thread count from 10,053 to 56, NMT thread committed memory from 971.4 MiB to 5.1 MiB, pod peak memory from 1,653.8 MiB to 947.7 MiB, and RSS from 1,217.5 MiB to 888.4 MiB. Binary RPC performance remained close overall, and real Spark SQL showed no meaningful regression. All 16 virtual-thread JFR recordings reported zero Since JEP 491 was delivered in JDK 24, these results do not cover |
|
I ran four targeted JDK 21 tests against the server-side JFR did show monitor contention in synchronous Log4j output, especially during error logging, but it did not cause pinning in these tests. Kyuubi already uses Log4j 2.26.1, whose output path remains synchronized, so upgrading Log4j would not change this. Since the feature is opt-in, I suggest keeping this PR unchanged and documenting that slow synchronous logging sinks may still pose a risk on JDK 21. These results apply only to the server frontend; engine-side virtual threads would require a separate and more cautious evaluation because they enter longer-running SQL, extension, and external I/O paths. |
|
I think users who want to use virtual threads should know the pin issue, the current state is good enough. |
|
Thanks, merged to master. |
Why are the changes needed?
Virtual threads are mature in JDK 21, which Kyuubi already supports. As an I/O-bound gateway, Kyuubi is a good fit for this execution model.
This PR makes a small first step by adding optional virtual-thread support to the server-side Thrift Binary frontend. It is disabled by default and does not affect engine frontends or other executors.
The implementation preserves the worker concurrency limit and rejection behavior while retaining compatibility with older JDKs.
See #7655 for the motivation and benchmark results.
How was this patch tested?
dev/reformatgit diff --checkWas this patch assisted by generative AI tooling?
Assisted-by: OpenAI Codex (GPT-5)