Brifing

Meta Boosts Ad Service Performance With Open-Source Kernel Scheduler

Custom scheduling policy delivers 28% latency reduction and 3.28MW power savings.

Facebook Engineering1 min

1The Criticality of Ad Latency

Meta's ad platform handles over 5 million requests per second. Millisecond-level latency improvements enhance ad relevance and strengthen advertiser ROI. The performance regression in Linux 6.9 kernel upgrade posed a major challenge for this high-throughput system.

2Limitations of CFS and EEVDF

Traditional Linux schedulers (CFS/EEVDF) provided generic solutions unaware of workload context. In Meta's ad workflow, certain threads are more critical than others, but standard schedulers couldn't make this distinction.

3Enter sched_ext

This BPF-based open-source framework was developed in collaboration with Google's ghOSt team. By running custom policies in user space, it enables ad workload-specific optimizations without waiting for kernel updates.

4CPU Pool Optimization

The scheduler partitions CPUs into two flexible pools for latency-sensitive and background work. These dynamically adjusted pools improve L3 cache locality and reduce costly DRAM access.

5Rapid Iteration in User Space

Policies packaged as BPF programs can be updated without kernel recompilation. This enabled additional 60% latency improvements through optimizations delivered in days rather than months.

6Tangible Results

sched_ext deployment achieved 28% tail latency reduction in ad retrieval, 3.28MW power savings, and 1.1% more ads ranked. Timeout errors decreased by 18%, demonstrating significant QoS improvements.

7Strategic Transformation

Initially a kernel upgrade workaround, sched_ext has become Meta's continuous optimization platform. Ad services now maintain peak performance independently of future Linux scheduler changes.

Original article: Facebook Engineering — Meta'nın Reklam Hizmetinde Açık Kaynak Çekirdek Zamanlayıcı ile Performans Artışı