Cloud Native 10 min read

BT Scheduler for Absolute Preemption: Boosting CPU Utilization and QoS in Cloud‑Native Environments

This article analyzes the limitations of the Linux Completely Fair Scheduler (CFS) for high‑priority workloads, introduces Tencent's custom offline BT scheduler that provides absolute preemption, and presents experimental results showing significant improvements in latency, CPU utilization, and carbon‑reduction for cloud‑native services.

Tencent Architect
Tencent Architect
Tencent Architect
BT Scheduler for Absolute Preemption: Boosting CPU Utilization and QoS in Cloud‑Native Environments

The article begins by describing the challenge of mixed‑workload servers where high‑priority (online) and low‑priority (offline) containers share CPU resources, leading to interference and reduced QoS.

It explains how the default Linux CFS uses nice values and weight‑based vruntime calculations, which only provide probabilistic, not absolute, preemption for high‑priority tasks.

Through a simple experiment with two infinite‑loop processes (nice 0 vs. nice 19) bound to the same CPU, the author shows that low‑priority tasks still obtain a noticeable share of CPU time, causing latency spikes for high‑priority services.

To achieve true absolute preemption, Tencent developed an offline scheduler called BT, positioned between CFS and the IDLE scheduler. BT gives online tasks priority over offline tasks, ensuring that when an online task is runnable it immediately preempts any offline task.

Experimental results in a controlled environment demonstrate that with BT scheduling, the average and maximum latency of online containers remain virtually unchanged even when offline containers run concurrently, unlike the significant latency increase observed with pure CFS.

Real‑world tests on a Tencent business scenario show that adopting the “如意” mixed‑deployment solution (which incorporates BT scheduling) raises overall CPU utilization from ~15% to ~60% while eliminating error spikes, effectively saving nearly 2 × 10⁸ kWh of electricity and reducing carbon emissions by about 70,000 tons.

The article concludes that while CFS’s fairness is suitable for general workloads, mission‑critical cloud‑native services demanding ultra‑high reliability benefit from the deterministic, absolute preemption provided by the BT scheduler.

cloud-nativeresource utilizationQoSCPU schedulingCFSBT scheduler
Tencent Architect
Written by

Tencent Architect

We share insights on storage, computing, networking and explore leading industry technologies together.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.