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?
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.
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.
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 :)
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?
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.
And it could also be true that one or more of the CLI options are buggy and/or misnamed.
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)
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
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.
https://github.com/bytecodealliance/wasmtime/issues/9256
I've also posted https://github.com/bytecodealliance/wasmtime/pull/9257 to lift the default limits here
Last updated: Dec 23 2024 at 13:07 UTC