Running WASM Workloads on Spin with Fermyon Cloud

Cloud Computing
Date:October 22, 2026
Topic:
Running WASM Workloads on Spin with Fermyon Cloud
⏱ 2 min read

You push code. It runs in milliseconds. No containers to build. No Kubernetes manifests to debug. No cold starts that kill user experience. That's the promise of WebAssembly on the server, and Fermyon Cloud delivers it with Spin.

Why WASM Changes the Serverless Game

Traditional serverless platforms force you into container overhead. AWS Lambda spins up a microVM. Cloud Run provisions a container. Both add 100-500ms of cold-start latency. WebAssembly modules start in microseconds because they're sandboxed at the runtime level, not the OS level. Spin compiles your Rust, Go, Python, or JavaScript to a .wasm file under 2MB. Fermyon Cloud executes it on a shared Wasmtime runtime with zero container tax.

"

WebAssembly gives you the isolation of containers with the density and startup speed of processes.

— Matt Butcher, Fermyon CEO

Your First Spin App in Three Commands

bash
spin new http-rust my-api
cd my-api
spin build

The spin new command scaffolds a complete project: Cargo.toml, spin.toml, and a handler that returns JSON. spin build compiles to WebAssembly using wasm32-wasi target. No Dockerfile. No docker build wait.

Deploy to Fermyon Cloud

bash
spin login
spin deploy

spin login opens a browser for GitHub OAuth. spin deploy pushes the .wasm module to Fermyon's registry, provisions a route like my-api.fermyon.app, and returns a live HTTPS endpoint in under 10 seconds. Your function scales to zero when idle and handles bursts without configuration.

💡
TipSet <code>spin.toml</code> <code>concurrency = 100</code> to handle 100 simultaneous requests per instance. Fermyon Cloud spins up new instances automatically.

Real-World: Image Resize API

Here's a complete handler that resizes uploaded images using the image crate. Add image = { version = "0.24", features = ["jpeg", "png"] } to Cargo.toml.

rust
use spin_sdk::http::{Request, Response};
use image::ImageFormat;

#[spin_sdk::http_component]
fn handle(req: Request) -> anyhow::Result<Response> {
    let img = image::load_from_memory(req.body())?;
    let resized = img.thumbnail(300, 300);
    let mut buf = Vec::new();
    resized.write_to(&mut std::io::Cursor::new(&mut buf), ImageFormat::Jpeg)?;
    Ok(http::Response::builder()
        .header("content-type", "image/jpeg")
        .body(buf.into())?)
}

Deploy it. POST a 5MB photo. Get a 300px thumbnail back in ~50ms. The binary stays under 3MB. Try that with a container.

When to Choose Spin Over Kubernetes

FactorSpin on Fermyon CloudKubernetes (EKS/GKE)
Cold start< 5ms1-30s
Binary size1-5 MB100 MB - 2 GB
Ops overheadZeroHigh
ScalingAutomatic to zeroHPA + cluster autoscaler
Local parityExact (spin up)Approximate (kind/skaffold)
⚠️
WarningWASI preview 1 limits networking to outbound HTTP. No raw TCP, no UDP, no inbound connections except via Spin's HTTP trigger. Check <code>wasi:sockets</code> preview 2 support if you need more.

Next Steps

  1. Install Spin: curl -fsSL https://developer.fermyon.com/downloads/install.sh | bash
  2. Run spin templates list to see Go, Python, JavaScript, and TinyGo options.
  3. Build a cron-triggered job: spin new http-rust --trigger cron.
  4. Explore the Key/Value and SQLite APIs in spin_sdk for stateful serverless.

✦
ℹ️
NoteFermyon Cloud free tier includes 1M requests/month, 100GB-s compute, and custom domains. No credit card required. Deploy your first WASM workload today at cloud.fermyon.com.
Share𝕏 Twitterin LinkedInin Whatsapp