lann edited issue #11814:
In doing some comparative performance testing we discovered that enabling timeouts via e.g.
-Wtimeout=1scuts throughput by 2-3 orders of magnitude. The likely cause is the management of theEpochThread, 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
lann edited issue #11814:
In doing some comparative performance testing we discovered that enabling timeouts via e.g.
wasmtime serve -Wtimeout=1scuts throughput by 2-3 orders of magnitude. The likely cause is the management of theEpochThread, 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
lann edited issue #11814:
In doing some comparative performance testing we discovered that enabling timeouts via e.g.
wasmtime serve -Wtimeout=1scuts throughput by 2-3 orders of magnitude. The likely cause is the management of theEpochThread, which appears to be spawned once per request (instead of the typical/expected once perEngine):https://github.com/bytecodealliance/wasmtime/blob/a70809d0caa4959b5d991c2770de821ab3c63930/src/commands/serve.rs#L796
https://github.com/bytecodealliance/wasmtime/blob/a70809d0caa4959b5d991c2770de821ab3c63930/src/commands/serve.rs#L641
lann edited issue #11814:
In doing some comparative performance testing we discovered that enabling timeouts via e.g.
wasmtime serve -Wtimeout=1scuts throughput by 2-3 orders of magnitude. The likely cause is the management of theEpochThread, which appears to be spawned once per request (instead of the typical/expected once perEngine):In
handle_request: https://github.com/bytecodealliance/wasmtime/blob/a70809d0caa4959b5d991c2770de821ab3c63930/src/commands/serve.rs#L796Which 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
alexcrichton closed issue #11814:
In doing some comparative performance testing we discovered that enabling timeouts via e.g.
wasmtime serve -Wtimeout=1scuts throughput by 2-3 orders of magnitude. The likely cause is the management of theEpochThread, which appears to be spawned once per request (instead of the typical/expected once perEngine):In
handle_request: https://github.com/bytecodealliance/wasmtime/blob/a70809d0caa4959b5d991c2770de821ab3c63930/src/commands/serve.rs#L796Which 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