Hierarchical Integration of WebAssembly in Serverless for Efficiency and Interoperability

Mohammadamin Baqershahi (University of British Columbia), Changyuan Lin (University of British Columbia), Visal Saosuo (University of British Columbia), Paul Chen (Huawei Technologies Canada), Mohammad Shahrad (University of British Columbia)

23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26) · Day 3 · Virtualization Revisited

Overview

Serverless computing has fundamentally transformed cloud architecture by offloading auto-scaling and provisioning to cloud providers while implementing a precise pay-per-use billing model. However, empirical traces reveal a persistent systemic inefficiency: serverless execution times are exceptionally short—with over half of modern enterprise workloads executing in under 100 milliseconds—and resource allocations are frequently sub-core and fractional. Managing container lifecycles, cold starts, and continuous scaling events for such micro-workloads imposes heavy platform overheads. Consequently, serverless can become up to two times more expensive than traditional virtual machines per unit of resource over time, driving high-profile engineering migrations back to dedicated instances.

Watch on YouTube · Slides

Visual summary for Hierarchical Integration of WebAssembly in Serverless for Efficiency and Interoperability by Mohammadamin Baqershahi, Changyuan Lin, Visal Saosuo, Paul Chen, Mohammad Shahrad
Visual summary for Hierarchical Integration of WebAssembly in Serverless for Efficiency and Interoperability by Mohammadamin Baqershahi, Changyuan Lin, Visal Saosuo, Paul Chen, Mohammad Shahrad

Key moments

  1. 0:00 Introduction and background on serverless computing challenges
  2. 2:00 Analysis of short execution times and high serverless overhead
  3. 4:00 Statistical foundation of traffic bundling and resource co-location
  4. 6:00 Evaluating isolation models and the role of WebAssembly
  5. 8:00 Comparing existing WASM approaches and introducing Wasabi
  6. 10:00 Wasabi architecture and hierarchical isolation using Wasm boxes
  7. 12:00 Design details on admission control and memory allocation
  8. 14:00 Evaluation results and resource reduction compared to Knative

Hierarchical Integration of WebAssembly in Serverless for Efficiency and Interoperability

Speakers: Mohammadamin Baqershahi (University of British Columbia); Changyuan Lin (University of British Columbia); Visal Saosuo (University of British Columbia); Paul Chen (Huawei Technologies Canada); Mohammad Shahrad (University of British Columbia)

Conference: USENIX NSDI

YouTube: https://www.youtube.com/watch?v=87jUDykMtXU

Overview

Serverless computing has fundamentally transformed cloud architecture by offloading auto-scaling and provisioning to cloud providers while implementing a precise pay-per-use billing model. However, empirical traces reveal a persistent systemic inefficiency: serverless execution times are exceptionally short—with over half of modern enterprise workloads executing in under 100 milliseconds—and resource allocations are frequently sub-core and fractional. Managing container lifecycles, cold starts, and continuous scaling events for such micro-workloads imposes heavy platform overheads. Consequently, serverless can become up to two times more expensive than traditional virtual machines per unit of resource over time, driving high-profile engineering migrations back to dedicated instances.

To resolve this tension, researchers from the University of British Columbia and Huawei Technologies present Wasabi, a hierarchical integration framework that co-locates multiple WebAssembly (WASM) modules inside larger, long-lived infrastructure containers. By shifting the primary unit of platform scaling to coarse-grained containers while packing fine-grained WASM modules within them, Wasabi amortizes scaling costs and smooths out traffic variance through statistical multiplexing. Implemented on top of production-grade KNative with fewer than 2,000 lines of code, Wasabi reduces cluster resource allocation by up to 10× while preserving or improving end-to-end service latency.

This talk matters because it bridges a critical architectural divide in cloud-native systems. Prior approaches either shoehorned WASM into standard OCI (Open Container Initiative) container runtimes—failing to capture high-density co-location benefits—or demanded that developers discard mature infrastructure to adopt greenfield WASM-only platforms like FAASM. Wasabi demonstrates that hierarchical sandboxing can deliver extreme resource efficiency without sacrificing software compatibility or requiring sweeping code rewrites.

Background

▶ Watch: Introduction and background on serverless computing challenges (0:00)

The economic and systems challenges of serverless computing stem from a fundamental mismatch between cloud pricing guarantees and container orchestration overheads. When client traffic drops to zero, providers must automatically scale down infrastructure to honor the pay-per-use contract. Conversely, sudden traffic spikes trigger cold starts—the latency incurred when spinning up new sandboxes to service incoming requests. Traces from major cloud providers (including Azure, Huawei, and IBM) demonstrate that median execution times have plummeted below 100 milliseconds, while average resource requests hover well below a single CPU core.

At this scale, the traditional serverless architecture—where every individual function maps to a dedicated container or lightweight virtual machine—collapses under its own weight. The overhead of container creation, network namespace configuration, and cgroup management dwarfs the actual function execution time. While traditional multi-tenancy and resource amortization have long been solved at the physical machine or virtual machine level via statistical multiplexing (where aggregate traffic variance flattens out as applications are bundled together), serverless orchestration layers have historically lacked an efficient mechanism to achieve this at the application function level.

Existing isolation models present an intractable trilemma between security, startup latency, and execution efficiency. At one extreme, raw OS threads or processes offer near-instantaneous startup but provide virtually zero multi-tenant security isolation. At the other extreme, full-fledged virtual machines and strict container isolation models guarantee robust security boundaries but suffer from startup latencies spanning tens of seconds.

WebAssembly has emerged as a compelling middle ground. Originally engineered as a secure, portable binary instruction format for client-side web browsers, server-side WASM provides millisecond-scale boot times and minimal memory footprints. Edge computing platforms like Cloudflare Workers and Fastly have successfully leveraged WASM for edge functions. However, integrating WASM into general-purpose cloud serverless ecosystems has split the systems community into two rigid camps:

  1. OCI-Compatible WASM Runtimes: Treating WASM binaries as standard container images and plugging them into existing container runtimes. While easy to integrate into massive codebases like KNative, this approach fails to optimize density or eliminate redundant container-level orchestration overheads.
  2. Greenfield WASM Platforms: Designing custom, clean-slate serverless runtimes optimized exclusively for WASM (such as FAASM). While achieving high application density, these platforms discard millions of lines of production cloud infrastructure and force developers to adapt codebases to immature runtime constraints.

Wasabi rejects this false dichotomy by introducing a hierarchical integration model that preserves existing container platforms while capturing the high-density co-location advantages of WebAssembly.

Key Findings

▶ Watch: Statistical foundation of traffic bundling and resource co-location (4:00)

The central discovery driving Wasabi is that hierarchical container packing dramatically flattens invocation variance and eliminates redundant scaling overhead in serverless clusters. By analyzing multi-month production traces from Huawei, IBM, and Azure, the authors verified that co-locating independent workloads significantly reduces the coefficient of variation in aggregate resource demand.

When evaluated on a cluster running production-derived workloads, Wasabi yielded several headline results:

  • 10× Resource Reduction: Compared to baseline KNative deployments, Wasabi slashed aggregate CPU and memory resource allocations in the test cluster by nearly an order of magnitude.
  • Drastic Reduction in Scaling Events: Over a two-hour test window, baseline KNative triggered approximately 1,000 container scaling events. Wasabi reduced this figure to just 16 container scaling operations.
  • Latency Improvements: Despite heavy application co-location, Wasabi improved both average and tail percentile service times (end-to-end latency minus network round-trip time) by eliminating cold starts and scaling delays.
  • Density Gains via Co-location: Micro-benchmarks isolating single-application performance versus multi-tenant co-location revealed that roughly 80% of Wasabi's density gains stem directly from multi-application packing within shared containers, with the remaining 20% attributable to direct WASM execution optimizations.

Technical Deep Dive

▶ Watch: Comparing existing WASM approaches and introducing Wasabi (8:00)

The architecture of Wasabi centers on hierarchical isolation, restructuring the traditional one-to-one mapping between serverless functions and container runtimes into a multi-tier containment hierarchy.

Hierarchical Isolation Architecture

At the macro layer, the system retains standard container engines as the primary unit of coarse-grained scaling and platform interoperability. However, inside these larger containers—termed WasmBoxes—Wasabi packs numerous fine-grained WebAssembly modules. Depending on the organization's multi-tenant threat model, administrators can co-locate modules from the same enterprise tenant or safely isolate untrusted execution domains across different WasmBoxes using traditional container boundaries, while retaining high-density WASM sandboxing internally.

Resource-Aware Admission Control and Auto-Scaling

Legacy serverless platforms rely primarily on request concurrency to trigger admission control and horizontal pod/container auto-scaling. In a hierarchical WASM environment where applications exhibit vastly divergent execution times and fractional resource consumption, concurrency-based heuristics fail: low concurrency can saturate available container memory, while high concurrency may leave abundant system headroom. Wasabi replaces concurrency-centric policies with resource-aware admission control and container auto-scaling algorithms that continuously monitor actual CPU and memory utilization across the underlying WasmBoxes.

Memory Pre-Allocation and Core-Sizing Mitigation

A key systems bottleneck identified during development was that WebAssembly runtimes exhibit higher memory allocation overheads than native compiled code, primarily due to mandatory runtime bounds-checking. Under fractional sub-core allocations typical of serverless functions, these allocation penalties severely degrade request throughput.

To mitigate this, Wasabi implements an asymmetric resource bootstrapping strategy:

  1. When a function initializes, the runtime temporarily provisions a full CPU core to execute rapid memory pre-allocation routines.
  2. Once memory structures and heaps are established, the core allocation is scaled down to the requested sub-core fractional limit.
  3. This dynamic pre-allocation sequence circumvents latency penalties during active execution without permanently over-provisioning compute resources.

Thread-Level Isolation and Cgroups

To enforce fine-grained safety within a shared WasmBox, Wasabi leverages thread-level Cgroup isolation. This provides an additional defense-in-depth layer, ensuring that individual WASM modules cannot exceed their bounded resource envelopes or interfere with sibling modules running inside the same container sandbox.

Experimental Setup & Results

▶ Watch: Wasabi architecture and hierarchical isolation using Wasm boxes (10:00)

The evaluation of Wasabi was conducted on a production-grade systems stack to validate its viability in real-world cloud environments.

Testbed Infrastructure

  • Hardware: A cluster consisting of 8 compute nodes equipped with approximately 100 total CPU cores and 200 gigabytes of RAM.
  • Software Stack: Implemented on top of KNative (version modified with <2,000 lines of custom Go/system code) utilizing WasmEdge as the foundational WebAssembly runtime.
  • Workloads: Micro-benchmarks and request traces derived from production serverless telemetry logs provided by Azure, Huawei, and IBM.

Baseline Comparisons

Wasabi was benchmarked against three distinct configurations:

  1. Standard KNative: Conventional container-per-function serverless architecture.
  2. KNative + WasmEdge (Direct Runtime): Utilizing WASM as a direct execution runtime inside standard KNative containers without hierarchical WasmBox packing.
  3. Spin on Kubernetes: A contemporary WASM serverless deployment framework (spin).

Headline Numbers and Ablation Insights

When subjected to a rigorous two-hour synthetic and trace-driven workload:

  • Resource Footprint: Standard KNative and naive WASM-as-runtime integrations (KNative + WasmEdge) exhibited massive CPU and memory allocation spikes matching request bursts. Wasabi flattened these curves, reducing aggregate cluster resource consumption by nearly 10×.
  • Scaling Overhead Elimination: KNative initiated roughly 1,000 scaling events during the test window. Wasabi restricted this to 16 container scaling events, proving that hierarchical multiplexing effectively absorbs bursty traffic oscillations.
  • Latency Stability: Service times (end-to-end latency excluding network transit) remained superior across average, 50th, 90th, and 99th percentiles under Wasabi, directly attributable to the absence of cold starts for warm WasmBoxes.
  • Ablation on Co-location: Single-tenant isolated benchmarks demonstrated that direct WASM execution optimizations account for only about 20% of Wasabi's performance gains, confirming that the remaining 80% efficiency stems directly from statistical multiplexing and hierarchical co-location.

Practical Implications

▶ Watch: Evaluation results and resource reduction compared to Knative (14:00)

Wasabi offers profound architectural lessons for cloud infrastructure engineers, serverless platform architects, and systems developers:

  • Preserving Investment in Existing Stacks: For platform teams managing massive enterprise codebases (such as KNative's 2-million-line codebase), complete rewrites to adopt greenfield WASM runtimes are cost-prohibitive. Wasabi proves that hierarchical integration can be achieved with minimal codebase intrusion (<2K lines of code), making it immediately viable for commercial cloud platforms.
  • Mitigating Cloud Economics: By reducing cluster resource allocation by up to 10× and slashing container lifecycle scaling events, hierarchical WASM packing directly addresses the primary economic critique of serverless: high per-unit compute costs. Organizations deterred by serverless pricing can leverage this model to capture container-level density without sacrificing auto-scaling convenience.
  • Security vs. Density Tradeoffs: Deployers must carefully evaluate their multi-tenant threat model. While co-locating WASM modules within a single WasmBox maximizes density, enterprises with strict zero-trust isolation requirements may need to restrict co-location boundaries to codebases originating from trusted internal business units.
  • Production Readiness: The core architectural components of Wasabi have already graduated from academic prototypes to partial production adoption within Huawei's Cloud AI serverless infrastructure, signaling commercial viability for hyperscale cloud deployments.

Key Takeaways

  • High-Density Multiplexing: Hierarchical integration of WebAssembly within larger container sandboxes ("WasmBoxes") successfully amortizes scaling overheads and smooths out short-duration invocation variance.
  • Overcoming Micro-Workload Inefficiency: With over 50% of serverless requests executing in under 100 milliseconds and requesting sub-core resources, traditional container instantiation is economically unsustainable; Wasabi eliminates 98%+ of container scaling events.
  • Minimal Codebase Intrusion: Implemented on top of production KNative with fewer than 2,000 lines of source code changes, demonstrating that platform retrofitting is vastly superior to clean-slate rewrites.
  • Resource-Aware Scaling: Moving away from concurrency-based admission control to telemetry-driven, resource-aware auto-scaling prevents resource starvation in packed container environments.
  • Asymmetric Memory Bootstrapping: Pre-allocating memory using temporary full-core allocations before scaling down to sub-core limits overcomes WASM memory bounds-checking overheads.
  • Production Provenance: Core elements of the system are actively deployed in production within Huawei Cloud AI serverless environments.

About the Speaker(s)

The talk was presented by Mohammadamin Baqershahi on behalf of the primary student researchers who were unable to secure travel visas. The underlying research was conducted through a collaborative effort between the University of British Columbia (UBC) systems research group—led by faculty member Mohammad Shahrad alongside students Mohammadamin Baqershahi, Changyuan Lin, and Visal Saosuo—and industry co-author Paul Chen from Huawei Technologies Canada. The research builds directly upon ongoing systems investigations into cloud economics and serverless efficiency, complementing related work presented by the authors at EuroSys.

Reviews

→ Top-rated talks at 23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26)

All talks from 23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26)