Stream: wasmtime

Topic: component transitively exceeds max of 20 module instances


view this post on Zulip Mark Fisher (Sep 14 2024 at 18:43):

I'm hitting this error with wasmtime serve for a component, and the -W max-instances config setting does not seem to apply. I haven't dug very deep yet, but it looks like this may be a separate configuration at the pooling allocator, and that may not be surfaced?

view this post on Zulip Joel Dice (Sep 14 2024 at 19:37):

wasmtime serve uses the pooling allocator by default, so you might want to try either or both of these:

  -O       pooling-total-core-instances=N -- The maximum number of WebAssembly instances which can be created with the pooling allocator.
  -O  pooling-total-component-instances=N -- The maximum number of WebAssembly components which can be created with the pooling allocator.

view this post on Zulip Mark Fisher (Sep 14 2024 at 20:19):

Neither of those seems to do the trick (same error even if I set both higher than my transitive component count), but for now -O pooling-allocator=n allows me to kick the can down the road. So thanks for pointing me at those config options.

view this post on Zulip Joel Dice (Sep 14 2024 at 20:24):

Not all the pooling allocator config settings have CLI options yet; I added a couple more I needed recently: https://github.com/bytecodealliance/wasmtime/pull/9138. I was too lazy to do that for all of them; sounds like somebody should do that :)

This adds pooling-table-elements and pooling-max-core-instance-size options to the CLI, allowing the user to override the defaults. I found myself needing to override both of these settings when ru...

view this post on Zulip Mark Fisher (Sep 14 2024 at 21:39):

I was about to volunteer, but looking in that same file, those 2 config options have been there for about 7 months. Would there be any other reason they aren't taking effect?

view this post on Zulip Joel Dice (Sep 15 2024 at 15:03):

I didn't mean to suggest that there are CLI flags which have no effect -- just that the pooling allocator has a lot of config options, not all of which have corresponding CLI options. Meaning the one you want might not have a CLI option yet even if there are other options that sound like what you want but (apparently) aren't.

view this post on Zulip Joel Dice (Sep 15 2024 at 15:05):

And it could also be true that one or more of the CLI options are buggy and/or misnamed.

view this post on Zulip Alex Crichton (Sep 16 2024 at 15:09):

Would you be able to copy/paste the exact error you're seeing? I tried grepping around for "transitively exceeds" in Wasmtime and wasm-tools and couldn't find much. That could help track down which option is needed here or which needs to be added to the wasmtime CLI (and also perhaps which default to increase to avoid needing to pass an option at all)

view this post on Zulip Mark Fisher (Sep 16 2024 at 16:31):

This is the exact error message from wasmtime serve:

Error: The component transitively contains 24 core module instances, which exceeds the configured maximum of 20

view this post on Zulip Alex Crichton (Sep 16 2024 at 16:39):

Ah ok thanks! That corresponds to this configuration option which is indeed not plumbed through to the CLI yet. I'll file an issue for this.

view this post on Zulip Alex Crichton (Sep 16 2024 at 16:43):

https://github.com/bytecodealliance/wasmtime/issues/9256

Wasmtime's pooling instance allocator has a number of configuration options not all of which are reflected onto the CLI at this time around here. Ideally all of the pooling alloctator configuration...

view this post on Zulip Alex Crichton (Sep 16 2024 at 16:47):

I've also posted https://github.com/bytecodealliance/wasmtime/pull/9257 to lift the default limits here

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 restr...

Last updated: Nov 22 2024 at 16:03 UTC