Presentation: Fine-Grained Sandboxing With V8 Isolates

Track: Modern Operating Systems

Location: Mountbatten, 6th flr.

Duration: 2:55pm - 3:45pm

Day of week: Monday

Share this on:

What You’ll Learn

  1. Learn why using V8 isolates as an alternative to VMs or containers allows running orders of magnitude more independent services per machine, enabling new approaches to cloud architecture.
  2. Understand logistical requirements and security risks and benefits involved in building a runtime environment based on V8.

Abstract

In an ideal world, code would always run as close as possible to the things with which it communicates -- end users, storage, external APIs, etc. However, most software stacks are only cost-effective if applications are long-running, handling many events in one place. We need a new approach that can efficiently load code to handle just one event, so that it can be executed wherever is best for that one event, across a distributed network.
 
Kenton Varda explains how Cloudflare solved this problem by building a compute platform using V8 isolates instead of containers or VMs, achieving 10x-100x faster cold starts and lower memory footprints. We'll go through technical details of embedding V8, distributing code, scheduling isolates, resource management, and security risks.

Question: 

What is the work you’re doing today?

Answer: 

We run a CDN with 165 remote locations. Cloudflare Workers provides a lightweight JavaScript execution environment that allows developers to handle HTTP requests directly on the closest server to the end user. This can be used to optimize existing applications or build entirely new ones. To allow every customer to deploy to every location, we leverage the V8 JavaScript runtime rather than VMs or containers. With this we provide a "serverless" experience but with low latency and almost zero cold start times.

Question: 

What are your goals for the talk?

Answer: 

I hope to show people how to build systems that embed V8 to host customer code. For example, if you currently expose a web-based API, you might also want to create a way for customers to host code directly on your servers to call that API, rather that calling it over the internet. You'll probably want a solution that can host tens of thousands of customers per machine, which means you need to use isolates. I'll explain why this makes sense, the basics of how to do it, and also discuss security concerns to be aware of.

Question: 

How do you prevent things like blocked threads affecting other users?

Answer: 

We enforce time limits and memory limits on execution, and we can preempt isolates that go over their limits. I'll explain how to do this in the talk.

Question: 

What do you want people to leave the talk with?

Answer: 

I want them to leave with an understanding that you can embed the V8 runtime in your infrastructure and why doing so will allow applications to achieve far better performance, reliability, and ease of operations.

Speaker: Kenton Varda

Tech lead @Cloudflare Workers

Kenton is the architect of Cloudflare Workers, a "serverless" compute platform which distributes your code to 165+ locations globally so that it always runs as close to the client as possible. Prior to joining Cloudflare, Kenton created Sandstorm.io and Cap'n Proto. Further back, while at Google, Kenton wrote Protobuf v2 and open sourced it.

Tracks