Skip to content

Commit

Permalink
Don't limit core instances/memories/tables by default (#9257)
Browse files Browse the repository at this point in the history
This commit updates the defaults of `PoolingAllocationConfig` to allow
unlimited core instances/memories/tables per component instead of the
previous default of 20. The limits here are somewhat restrictive and
more tailored for high-scale use cases which aren't always the best
defaults for a general purpose tool like the `wasmtime` CLI. The CLI for
example uses the pooling allocator by default with `serve` and this
helps accept a wider breadth of components by default instead of
artificially limiting the shape of input components.
  • Loading branch information
alexcrichton authored Sep 16, 2024
1 parent 93c4ae7 commit 3926a00
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions crates/wasmtime/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2704,7 +2704,7 @@ impl PoolingAllocationConfig {
}

/// The maximum number of core instances a single component may contain
/// (default is `20`).
/// (default is unlimited).
///
/// This method (along with
/// [`PoolingAllocationConfig::max_memories_per_component`],
Expand All @@ -2720,7 +2720,7 @@ impl PoolingAllocationConfig {
}

/// The maximum number of Wasm linear memories that a single component may
/// transitively contain (default is `20`).
/// transitively contain (default is unlimited).
///
/// This method (along with
/// [`PoolingAllocationConfig::max_core_instances_per_component`],
Expand All @@ -2736,7 +2736,7 @@ impl PoolingAllocationConfig {
}

/// The maximum number of tables that a single component may transitively
/// contain (default is `20`).
/// contain (default is unlimited).
///
/// This method (along with
/// [`PoolingAllocationConfig::max_core_instances_per_component`],
Expand Down
6 changes: 3 additions & 3 deletions crates/wasmtime/src/runtime/vm/instance/allocator/pooling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ impl Default for InstanceLimits {
total_component_instances: 1000,
component_instance_size: 1 << 20, // 1 MiB
total_core_instances: 1000,
max_core_instances_per_component: 20,
max_memories_per_component: 20,
max_tables_per_component: 20,
max_core_instances_per_component: u32::MAX,
max_memories_per_component: u32::MAX,
max_tables_per_component: u32::MAX,
total_memories: 1000,
total_tables: 1000,
#[cfg(feature = "async")]
Expand Down

0 comments on commit 3926a00

Please sign in to comment.