Stream: wasmtime

Topic: wasmtime serve instance reuse CLI options


view this post on Zulip Joel Dice (Oct 10 2025 at 16:45):

I'm adding WASIp3 instance reuse options to the wasmtime serve CLI as part of https://github.com/bytecodealliance/wasmtime/pull/11807, including:

Any opinions about where these should go in the CLI, e.g. under -W, -S, or at the top level?

This is a draft implementation of WASIp3 instance reuse. Previously, we used one store and one instance per request for both p2 and p3 handlers, discarding the store and instance immediately after...

view this post on Zulip Pat Hickey (Oct 10 2025 at 17:04):

I dont think these options belong under -W (wasm features)

view this post on Zulip Pat Hickey (Oct 10 2025 at 17:04):

putting them under -S is really down to whether theres a possible interpretation of them in wasmtime run or wasmtime wizer etc which I expect the answer is no

view this post on Zulip Joel Dice (Oct 10 2025 at 17:04):

I agree, although currently setting a timeout requires -Wtimeout=N which surprised me a little.

view this post on Zulip Pat Hickey (Oct 10 2025 at 17:05):

oh, huh, yeah i wouldnt have expected time out to be under -W either!

view this post on Zulip Pat Hickey (Oct 10 2025 at 17:07):

i wouldnt complain if there was a top level --timeout= for wasmtime serve that was an alias for -Wtimeout=, just for the sake of discoverability....

view this post on Zulip Pat Hickey (Oct 10 2025 at 17:08):

but thats an aside. i guess id like to see these as top level wasmtime serve options, and the max requests to handle using a single instance, and how long an instance can sit idle, could be reused for p2 as well

view this post on Zulip Pat Hickey (Oct 10 2025 at 17:08):

thats a long standing request for wasmtime cli to support, and of course more and more (by which i mean the two private ones im responsible for) embeddings are making instance reuse a tunable knob these days

view this post on Zulip Joel Dice (Oct 10 2025 at 17:08):

Yeah, adding support for (non-concurrent) reuse for p2 isn't a priority for me right now, but definitely makes sense

view this post on Zulip Pat Hickey (Oct 10 2025 at 17:09):

well once you have the options in there ill add the p2 reuse implementation

view this post on Zulip Alex Crichton (Oct 10 2025 at 17:17):

The intention for -W was "things affecting wasm runtime semantics" which is why timeouts/features are there as well as things like determinism/nan canonicalization/etc

view this post on Zulip Alex Crichton (Oct 10 2025 at 17:18):

The downside of -S or -W or such is that they show up on all commands while only being relevant to serve, so I'd lean towards what Pat is thinking as well with top-level commands

view this post on Zulip Alex Crichton (Oct 10 2025 at 17:19):

we could perhaps entertain a -P or --proxy for wasmtime-serve specific options

view this post on Zulip Alex Crichton (Oct 10 2025 at 17:19):

but if the man page for wasmtime serve is long that's also not the end of the world


Last updated: Dec 06 2025 at 06:05 UTC