Skip to content

Commit 0cb0a47

Browse files
committed
Add max blocking threads option to client
1 parent bb0e3ed commit 0cb0a47

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

CLI.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ A Byzantine-fault tolerant sidechain with low-latency finality and high throughp
161161
Default value: `1000`
162162
* `--wasm-runtime <WASM_RUNTIME>` — The WebAssembly runtime to use
163163
* `--tokio-threads <TOKIO_THREADS>` — The number of Tokio worker threads to use
164+
* `--tokio-blocking-threads <TOKIO_BLOCKING_THREADS>` — The number of Tokio blocking threads to use
164165

165166

166167

linera-service/src/linera/main.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,6 +1320,10 @@ struct ClientOptions {
13201320
#[arg(long, env = "LINERA_CLIENT_TOKIO_THREADS")]
13211321
tokio_threads: Option<usize>,
13221322

1323+
/// The number of Tokio blocking threads to use.
1324+
#[arg(long)]
1325+
tokio_blocking_threads: Option<usize>,
1326+
13231327
/// Subcommand.
13241328
#[command(subcommand)]
13251329
command: ClientCommand,
@@ -1572,6 +1576,10 @@ fn main() -> anyhow::Result<()> {
15721576
builder
15731577
};
15741578

1579+
if let Some(blocking_threads) = options.tokio_blocking_threads {
1580+
runtime.max_blocking_threads(blocking_threads);
1581+
}
1582+
15751583
let span = tracing::info_span!("linera::main");
15761584
if let Some(wallet_id) = &options.inner.with_wallet {
15771585
span.record("wallet_id", wallet_id);

linera-service/src/proxy/main.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ pub struct ProxyOptions {
6464
#[arg(long, env = "LINERA_PROXY_TOKIO_THREADS")]
6565
tokio_threads: Option<usize>,
6666

67+
/// The number of Tokio blocking threads to use.
68+
#[arg(long)]
69+
tokio_blocking_threads: Option<usize>,
70+
6771
/// Storage configuration for the blockchain history, chain states and binary blobs.
6872
#[arg(long = "storage")]
6973
storage_config: StorageConfigNamespace,
@@ -386,6 +390,10 @@ fn main() -> Result<()> {
386390
builder
387391
};
388392

393+
if let Some(blocking_threads) = options.tokio_blocking_threads {
394+
runtime.max_blocking_threads(blocking_threads);
395+
}
396+
389397
runtime.enable_all().build()?.block_on(options.run())
390398
}
391399

linera-service/src/server.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,10 @@ struct ServerOptions {
249249
/// The number of Tokio worker threads to use.
250250
#[arg(long, env = "LINERA_SERVER_TOKIO_THREADS")]
251251
tokio_threads: Option<usize>,
252+
253+
/// The number of Tokio blocking threads to use.
254+
#[arg(long)]
255+
tokio_blocking_threads: Option<usize>,
252256
}
253257

254258
#[derive(Debug, PartialEq, Eq, Deserialize)]
@@ -476,6 +480,10 @@ fn main() {
476480
builder
477481
};
478482

483+
if let Some(blocking_threads) = options.tokio_blocking_threads {
484+
runtime.max_blocking_threads(blocking_threads);
485+
}
486+
479487
runtime
480488
.enable_all()
481489
.build()

0 commit comments

Comments
 (0)