Skip to content

Commit

Permalink
set max_core_instance_size in pooling config (#2721)
Browse files Browse the repository at this point in the history
...and make it configurable via an environment variable.

Also, increase the `table_elements` default value.

As of this writing, ahead-of-time compiled ASP.NET Core apps require more memory
for metadata and larger tables than we had previously anticipated.  This allows
them to run.

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
  • Loading branch information
dicej authored Aug 19, 2024
1 parent 10bfdfd commit ccd5c9f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,12 @@ impl Default for Config {
.max_component_instance_size(
env("SPIN_WASMTIME_INSTANCE_SIZE", (10 * MB) as u32) as usize
)
.max_core_instance_size(
env("SPIN_WASMTIME_CORE_INSTANCE_SIZE", (10 * MB) as u32) as usize
)
.max_core_instances_per_component(env("SPIN_WASMTIME_CORE_INSTANCE_COUNT", 200))
.max_tables_per_component(env("SPIN_WASMTIME_INSTANCE_TABLES", 20))
.table_elements(env("SPIN_WASMTIME_INSTANCE_TABLE_ELEMENTS", 30_000))
.table_elements(env("SPIN_WASMTIME_INSTANCE_TABLE_ELEMENTS", 100_000))
// The number of memories an instance can have effectively limits the number of inner components
// a composed component can have (since each inner component has its own memory). We default to 32 for now, and
// we'll see how often this limit gets reached.
Expand Down

0 comments on commit ccd5c9f

Please sign in to comment.