diff --git a/auron-core/src/main/java/org/apache/auron/configuration/AuronConfiguration.java b/auron-core/src/main/java/org/apache/auron/configuration/AuronConfiguration.java index 3cd06d26f..6f22e2b69 100644 --- a/auron-core/src/main/java/org/apache/auron/configuration/AuronConfiguration.java +++ b/auron-core/src/main/java/org/apache/auron/configuration/AuronConfiguration.java @@ -43,9 +43,11 @@ public abstract class AuronConfiguration { .withKey("auron.tokio.worker.threads.per.cpu") .withCategory("Runtime Configuration") .withDescription( - "Number of Tokio worker threads to create per CPU core (spark.task.cpus). Set to 0 for automatic detection " - + "based on available CPU cores. This setting controls the thread pool size for Tokio-based asynchronous operations.") - .withDefaultValue(0); + "Number of Tokio worker threads to create per CPU core (spark.task.cpus). Each task creates its own " + + "Tokio runtime, so the default of 1 sizes it to the task's CPU allocation. Set to 0 to use " + + "all available CPU cores of the host for every task, which can create a very large number " + + "of threads on many-core machines.") + .withDefaultValue(1); public static final ConfigOption SUGGESTED_BATCH_MEM_SIZE = new ConfigOption<>(Integer.class) .withKey("auron.suggested.batch.memSize") diff --git a/native-engine/auron/src/rt.rs b/native-engine/auron/src/rt.rs index 932ae3136..4a8dad86c 100644 --- a/native-engine/auron/src/rt.rs +++ b/native-engine/auron/src/rt.rs @@ -105,8 +105,8 @@ impl NativeExecutionRuntime { ); let num_worker_threads = { - let worker_threads_per_cpu = TOKIO_WORKER_THREADS_PER_CPU.value().unwrap_or(0); - let task_cpus = TASK_CPUS.value().unwrap_or(0); + let worker_threads_per_cpu = TOKIO_WORKER_THREADS_PER_CPU.value().unwrap_or(1); + let task_cpus = TASK_CPUS.value().unwrap_or(1); worker_threads_per_cpu * task_cpus };