This is an automated email from the ASF dual-hosted git repository.
zuston pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-uniffle.git
The following commit(s) were added to refs/heads/master by this push:
new d120f4bf3 [#1407] fix(rust): use grpc runtime worker threads and
adjust default runtime config (#1517)
d120f4bf3 is described below
commit d120f4bf3028be9d2fe47a8e0e428428c37f11a0
Author: Junfan Zhang <[email protected]>
AuthorDate: Fri Feb 16 11:14:15 2024 +0800
[#1407] fix(rust): use grpc runtime worker threads and adjust default
runtime config (#1517)
### What changes were proposed in this pull request?
Server will start multiple grpc service to improve throughout, which will
be executed by grpc runtime blocking threads, this is hard to configure the
number of
blocking threads.
Let's use the worker threads to start all tasks.
### Why are the changes needed?
Subtask for #1407
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Online tests.
---
rust/experimental/server/src/config.rs | 4 ++--
rust/experimental/server/src/main.rs | 10 +++-------
2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/rust/experimental/server/src/config.rs
b/rust/experimental/server/src/config.rs
index a273e2db2..d19764932 100644
--- a/rust/experimental/server/src/config.rs
+++ b/rust/experimental/server/src/config.rs
@@ -87,8 +87,8 @@ impl Default for RuntimeConfig {
fn default() -> Self {
RuntimeConfig {
read_thread_num: 10,
- write_thread_num: 10,
- grpc_thread_num: 20,
+ write_thread_num: 40,
+ grpc_thread_num: 100,
http_thread_num: 5,
default_thread_num: 5,
}
diff --git a/rust/experimental/server/src/main.rs
b/rust/experimental/server/src/main.rs
index 01ec4aefb..f5e93c589 100644
--- a/rust/experimental/server/src/main.rs
+++ b/rust/experimental/server/src/main.rs
@@ -240,13 +240,9 @@ fn main() -> Result<()> {
.max_decoding_message_size(usize::MAX)
.max_encoding_message_size(usize::MAX);
let service_tx = tx.subscribe();
- runtime_manager.grpc_runtime.spawn_blocking(move || {
- tokio::runtime::Builder::new_current_thread()
- .enable_all()
- .build()
- .unwrap()
- .block_on(grpc_serve(service, addr, service_tx));
- });
+ runtime_manager
+ .grpc_runtime
+ .spawn(async move { grpc_serve(service, addr, service_tx).await });
}
graceful_wait_for_signal(tx);