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?
I dont think these options belong under -W (wasm features)
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
I agree, although currently setting a timeout requires -Wtimeout=N which surprised me a little.
oh, huh, yeah i wouldnt have expected time out to be under -W either!
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....
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
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
Yeah, adding support for (non-concurrent) reuse for p2 isn't a priority for me right now, but definitely makes sense
well once you have the options in there ill add the p2 reuse implementation
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
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
we could perhaps entertain a -P or --proxy for wasmtime-serve specific options
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