-
Notifications
You must be signed in to change notification settings - Fork 289
support instance reuse for WASIp3 HTTP components #3328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| tracing::trace!("Adding archive layer for all files in source {:?}", &source); | ||
| let working_dir = tempfile::tempdir()?; | ||
| let archive_path = crate::utils::archive(source, &working_dir.into_path()) | ||
| let archive_path = crate::utils::archive(source, &working_dir.keep()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes a clippy deprecation warning.
|
Very cool, I'm really glad this seems to have worked out without too much trouble!
I think this should be configurable via runtime config, plus env vars and/or CLI options, but not The |
|
At one point we discussed exposing app developers to a mix of "new instance" and "reused instance" in the CLI in order to help developers detect latent reuse bugs, e.g. by randomly deciding to biff the current instance, or by having a default reuse configuration that developers would hit a mix in any non-trivial testing. Is that on the agenda? |
|
oh, good point: I had forgotten about that. And yes, we should definitely make these values configurable as ranges, within which we randomize |
|
Sounds good. I'm on a roll right now adding async support to |
This makes use of the new `wasmtime_wasi_http::handler::ProxyHandler` utility, which provides both serial and concurrent instance reuse. We could hypothetically enable opt-in serial reuse for WASIp2 components as well using the same pattern (which is what `wasmtime serve` does), but I'll leave that for a follow-up PR, if desired. This hard-codes the configuration values (max reuse count = 128, max concurrent reuse count = 16, idle timeout = 1s) for now. Once we've decided where these values should be configured (e.g. in the spin.toml manifest, in the runtime config, or at runtime via the component itself), we can support that. See WebAssembly/wasi-http#190 for related discussion. Signed-off-by: Joel Dice <[email protected]>
|
I just pushed an update that adds the configuration support we discussed. I noticed that the existing mechanism to configure |
824ffbc to
b826137
Compare
Signed-off-by: Joel Dice <[email protected]>
b826137 to
4783ff6
Compare
This makes use of the new
wasmtime_wasi_http::handler::ProxyHandlerutility, which provides both serial and concurrent instance reuse.We could hypothetically enable opt-in serial reuse for WASIp2 components as well using the same pattern (which is what
wasmtime servedoes), but I'll leave that for a follow-up PR, if desired.