BlockEdge

Technology and digital life

Netflix gives performance-sensitive Titus tasks their own EC2 instances

Netflix has added a single-tenant mode to Titus that runs one task on an EC2 instance sized for its CPU, memory and GPU requirements. Application teams keep the same API and deployment process, while the compute platform team continues to manage and patch the hosts. For early adopters running stateful, high-throughput streaming jobs, interference from another task on a shared host can mean minutes spent recovering from a checkpoint.

Why shared-host controls fell short

Titus launches millions of containers a week across tens of thousands of EC2 instances. Sharing hosts remains the default, but Netflix found that its existing controls could not partition resources such as the last-level cache and memory bandwidth. Its HTB network traffic shaper also required a global lock: a container sending large numbers of small packets could consume enough kernel CPU time to starve neighboring tasks. Predictive CPU pinning and eBPF-based detection helped, but did not eliminate the interference.

Netflix wanted predictable performance for trusted internal teams, not a security boundary for untrusted code. It considered microVMs such as Firecracker and Kata, but those required either bare metal or nested virtualization, which was not ready on the instance types Netflix used at the time. Netflix also cited hypervisor overhead and a lack of GPU support. It ruled out gVisor in part because of overhead on I/O-intensive paths. Running containers directly on EC2 would have left application teams responsible for host patching and cluster sizing.

How Titus keeps one task on each node

The platform team controls which workloads qualify and which instance families they can use. The autoscaler starts the smallest eligible instance that meets the task’s requirements. Pod anti-affinity keeps tasks apart, node taints restrict what can run on the node, and a non-preemptible priority class protects the task from displacement. Netflix also disabled defragmentation so Titus would not move a running task to pack nodes more tightly.

To test isolation, Netflix runs a reference application alone and then alongside a disruptive “havoc” container, comparing throughput and 99th-percentile latency. It did not publish numerical results.

The startup and capacity trade-offs

A fresh instance takes tens of seconds to boot before it even starts pulling the container image. Keeping instances ready helps less than it does in a shared cluster because tasks call for different instance sizes. Netflix retains a small warm pool for latency-sensitive starts, limits the sizes available there and excludes bare-metal instances from the pool. Disabling Kubernetes preemption removed a scheduling bottleneck that had left new nodes idle. Lazy image pulling with stargz or SOCI and checkpoint restoration with CRIU remain longer-term options.

Task size matters for efficiency as well. Netflix says sidecars and system services can consume tens of percent of the resources on a small instance, compared with only a few percent on the largest sizes. Moving tasks off shared hosts can leave capacity idle, but shared hosts also have gaps when the remaining space does not fit another task. A dedicated instance can therefore make sense when a task already needs close to a full node.

Early users include managed Apache Flink, streaming data connectors, telemetry and logging pipelines, and some latency-sensitive GraphQL and edge services. Netflix recommends the mode for large, long-running tasks that are sensitive to interruption, rather than small or bursty services. It continues to work on isolation in shared clusters, including an eBPF-based network shaper to replace HTB and controls for cache and memory bandwidth. Its longer-term goal is a unified compute API that selects EC2 or Titus placement based on a workload’s declared requirements.