Stream: git-wasmtime

Topic: wasmtime / issue #11814 Enabling timeouts in `wasmtime se...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2025 at 14:12):

lann edited issue #11814:

In doing some comparative performance testing we discovered that enabling timeouts via e.g. -Wtimeout=1s cuts throughput by 2-3 orders of magnitude. The likely cause is the management of the EpochThread, which appears to be spawned once per request:

https://github.com/bytecodealliance/wasmtime/blob/a70809d0caa4959b5d991c2770de821ab3c63930/src/commands/serve.rs#L796
https://github.com/bytecodealliance/wasmtime/blob/a70809d0caa4959b5d991c2770de821ab3c63930/src/commands/serve.rs#L641

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2025 at 14:12):

lann edited issue #11814:

In doing some comparative performance testing we discovered that enabling timeouts via e.g. wasmtime serve -Wtimeout=1s cuts throughput by 2-3 orders of magnitude. The likely cause is the management of the EpochThread, which appears to be spawned once per request:

https://github.com/bytecodealliance/wasmtime/blob/a70809d0caa4959b5d991c2770de821ab3c63930/src/commands/serve.rs#L796
https://github.com/bytecodealliance/wasmtime/blob/a70809d0caa4959b5d991c2770de821ab3c63930/src/commands/serve.rs#L641

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2025 at 14:13):

lann edited issue #11814:

In doing some comparative performance testing we discovered that enabling timeouts via e.g. wasmtime serve -Wtimeout=1s cuts throughput by 2-3 orders of magnitude. The likely cause is the management of the EpochThread, which appears to be spawned once per request (instead of the typical/expected once per Engine):

https://github.com/bytecodealliance/wasmtime/blob/a70809d0caa4959b5d991c2770de821ab3c63930/src/commands/serve.rs#L796
https://github.com/bytecodealliance/wasmtime/blob/a70809d0caa4959b5d991c2770de821ab3c63930/src/commands/serve.rs#L641

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2025 at 14:17):

lann edited issue #11814:

In doing some comparative performance testing we discovered that enabling timeouts via e.g. wasmtime serve -Wtimeout=1s cuts throughput by 2-3 orders of magnitude. The likely cause is the management of the EpochThread, which appears to be spawned once per request (instead of the typical/expected once per Engine):

In handle_request: https://github.com/bytecodealliance/wasmtime/blob/a70809d0caa4959b5d991c2770de821ab3c63930/src/commands/serve.rs#L796

Which always spawns a thread if timeouts are enabled: https://github.com/bytecodealliance/wasmtime/blob/a70809d0caa4959b5d991c2770de821ab3c63930/src/commands/serve.rs#L641

It looks like there is a similar hazard when enabling profiling: https://github.com/bytecodealliance/wasmtime/blob/a70809d0caa4959b5d991c2770de821ab3c63930/src/commands/serve.rs#L707

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2025 at 17:32):

alexcrichton closed issue #11814:

In doing some comparative performance testing we discovered that enabling timeouts via e.g. wasmtime serve -Wtimeout=1s cuts throughput by 2-3 orders of magnitude. The likely cause is the management of the EpochThread, which appears to be spawned once per request (instead of the typical/expected once per Engine):

In handle_request: https://github.com/bytecodealliance/wasmtime/blob/a70809d0caa4959b5d991c2770de821ab3c63930/src/commands/serve.rs#L796

Which always spawns a thread if timeouts are enabled: https://github.com/bytecodealliance/wasmtime/blob/a70809d0caa4959b5d991c2770de821ab3c63930/src/commands/serve.rs#L641

It looks like there is a similar hazard when enabling profiling: https://github.com/bytecodealliance/wasmtime/blob/a70809d0caa4959b5d991c2770de821ab3c63930/src/commands/serve.rs#L707


Last updated: Dec 06 2025 at 07:03 UTC