HeadlinesBriefing favicon HeadlinesBriefing.com

5x Faster Edge Functions: V8 to Firecracker MicroVMs

Hacker News •
×

About a billion Edge Functions run on Netlify every day — Sunweb personalizing pages, Loto-Québec routing traffic on a cookie check, and hundreds of thousands of other sites doing everything from personalization to routing to auth. All of it runs on a full JavaScript runtime that scales with our customers’ traffic. This poses a significant technical challenge, as we strive to make the latency as low as possible.

Over the past several months, our team has rebuilt the infrastructure behind Edge Functions, working closely with the team at Unikraft. In the past, requests went out to a hosted execution service. Today, they run on Micro VMs inside our own edge network — roughly 5x faster at the median. That shift also improves security and reliability, and opens up more possibilities for running complex compute at the edge.

A warm invocation — routing to a compute node, entering a Micro VM, running the function, producing response headers — now costs: ~5-6ms at median (p50), down from 25-40ms on our previous infrastructure. 47.4% faster p99 invocations, 99.998% availability, and 5x faster edge function log delivery. A cold invocation happens on about 1.2% of invocations and takes about 9ms on average.

When a request arrives at the edge node, it is forwarded to a compute node within our network. The compute node checks if a service with that ID already exists. If it does, it forwards the request into the service for it to send into the Micro VM. We configure each service to only allow a fixed number of requests to be handled by a Micro VM before we shut it down, to avoid Micro VMs running indefinitely.