Stream: wasmtime

Topic: Pooling allocator metrics


view this post on Zulip Lann Martin (Aug 18 2025 at 15:41):

I'd like to expose things like pooled instance counts to embedders; looking for feedback on API and implementation approach: https://github.com/bytecodealliance/wasmtime/issues/11449

This is similar to #2640 but is about pull rather than push metrics. The pooling allocator has a bunch of configurable limits. It can be difficult to understand the runtime behavior of a system to ...

view this post on Zulip fitzgen (he/him) (Aug 18 2025 at 17:38):

Seems reasonable to me!

view this post on Zulip Paul Osborne (Aug 18 2025 at 18:29):

Seems reasonable to me as well; one of the main changes on our internal fork of wasmtime right now is changes we have to get metrics out of wasmtime in a few more places. Having a few things like this that we could poll using external APIs would be nice for reducing the patches we need to maintain (and potentially useful for other consumers).

Some of the ones we have a transient and probably not generally useful, but I'll add it to my backlog to audit and potentially propose any additional metrics (especially things that map to gauges or counters) that may be generally useful. Some of the stuff we have are quantiles for specific syscalls and such (e.g. madvise/mmap/etc.) that probably don't have a place in upstream and which we could probably tackle at another layer to drop the patches (e.g. ebpf black magic to capture specific syscall metrics).

view this post on Zulip Lann Martin (Aug 21 2025 at 16:46):

Starting with just some basic allocation counts: https://github.com/bytecodealliance/wasmtime/pull/11490

This exposes some basic runtime metrics derived from the internal state of a PoolingInstanceAllocator. Two new atomics were added to PoolingInstanceAllocator: live_memories and live_tables. While t...

Last updated: Dec 06 2025 at 06:05 UTC