Serverless cloud platforms typically rely on operating-system schedulers such as the Completely Fair Scheduler (CFS) and Earliest Eligible Virtual Deadline First (EEVDF) to schedule function executions across CPU cores. Prior work has shown that existing schedulers either minimize task latency at the expense of runtime efficiency or improve runtime efficiency while increasing latency. Although hybrid approaches partially mitigate this trade-off, each scheduler remains confined to a narrow region of the latency-runtime trade-off space, leaving much of the design space unexplored. We present a class of synthesized schedulers that expose configurable latency-runtime trade-offs. Rather than hand-designing heuristics, we use reinforcement learning to synthesize policies for core assignment, preemption, and load balancing under different reward objectives. We implement the synthesized schedulers using Linux sched_ext, train them on representative serverless workloads, and evaluate them on a multi-core server. Synthesized schedulers are competitive with both general-purpose Linux schedulers (CFS, EEVDF, and FIFO) and state-of-the-art serverless-aware schedulers. More importantly, they can be tuned at deployment time to span a near-continuous set of latency-runtime operating points. Several of these operating points reduce both latency and runtime cost, improving profitability for both cloud users and providers.
Figures & tables
Figure 1. Latency–runtime trade-off. Accumulated task latency and accumulated task runtime across a workload extracted from Microsoft Azure trace. CFS and EEVDF achieve low latency with high runtime, while FIFO reduces runtime at the cost of higher latency. Our synthesized schedulers trace out an empirical Pareto frontier.
Figure 2. CDFs of response latency and runtime distributions with a workload under Round Robin, Preemption, Work shuffling on 50 CPU cores.
Mechanisms
Time to Complete 99% of Tasks (s)
Round-Robin
388
Preemption
294
Work Shuffling
268
Preempt+Shuffle
254
Table 1. Comparison of the time required to complete 99% of the tasks under four scheduling mechanisms.
State Space
Number of started tasks, number of unstarted tasks, number of finished tasks, per-core queue lengths, accumulated latency, accumulated runtime, accumulated preemption count
Action Space
Destination CPU core for incoming invocations (50 choices DDQN ( Wang et al., 2016 ) ), preemption time slice (5 choices, DQN ( Mnih et al., 2013 ) ), destination CPU cores for rebalanced tasks (50 choices, DDQN ( Wang et al., 2016 ) )
Table 2. State and action spaces of the RL agent (in parentheses, the number of discrete choices for each action).
Figure 3. Architecture of synthesized schedulers. The high-frequency controller batches arriving tasks and assigns them to per-core queues every 20 ms. The low-frequency controller adjusts the preemption time slice and performs load rebalancing every 500 ms.
Figure 4. Reward and accumulated runtime over 50 training episodes, with 95% confidence bands across five random seeds. Both stabilize within 50 episodes, indicating convergence.
Figure 5. Synthesized scheduler communication pattern: the sched_ext Rust+BPF backend (left) publishes a state snapshot of runtime metrics to the Python RL agent (right); the Q/Dueling-DQN agent returns target-core and time-slice decisions, which the backend applies as core placement and time-slice control.
Workload
Period
Invocations
Generalization
Training
Day01, midnight
8,285
–
Workload 1
Day02, midnight
8,627
day-to-day
Workload 2
Day01, noon
9,463
time-of-day
Workload 3
Day10, evening
18,155
time-of-day & day-to-day
Workload 4
Day02, midnight
8,627
heterogeneous
Workload 5
Day01, noon
9,463
heterogeneous
Table 3. Summary of training and test workloads.
Figure 6. CDFs of response latency for a workload extracted from the Microsoft Azure trace under CFS, EEVDF, FIFO, Hybrid ( Zhao et al., 2024 ) , ALPS ( Fu et al., 2024 ) , SFS ( Fu et al., 2022 ) , and three synthesized scheduling policies on 50 CPU cores. Synthesized Latency closely tracks the low-latency schedulers (CFS, EEVDF, ALPS), showing it stays in its target region on an unseen workload.
Figure 7. Task runtime distributions for a workload extracted from the Microsoft Azure trace under CFS, EEVDF, FIFO, Hybrid ( Zhao et al., 2024 ) , ALPS ( Fu et al., 2024 ) , SFS ( Fu et al., 2022 ) , and three synthesized scheduling policies on 50 CPU cores. Synthesized Runtime overlaps FIFO, the practical runtime lower bound.
Policy
Latency (s)
Runtime (s)
Cost
Workload 4
Low-latency region
CFS
173 ± 2
209,279 ± 2,247
1.0000
EEVDF
168 ± 0.4
212,022 ± 889
1.0132 ± 0.0104
ALPS
567 ± 6
204,328 ± 1,594
0.9765 ± 0.0156
Synthesized Latency
14,524 ± 668
308,601 ± 11,137
1.4748 ± 0.0592
Table 4. Performance comparison on heterogeneous workloads (Workload 4–6). Latency and runtime are accumulated values across all tasks. Cost is normalized to CFS within each workload. Lower is better for all metrics. Each synthesized policy holds its target operating region. Values are mean ± standard deviation over 5 independent runs.
Policy
0–120s
0–240s
Tail > 240s
T99%
CFS
69.3%
89.2%
10.8%
359.2s
EEVDF
69.2%
89.4%
10.6%
361.5s
FIFO
33.3%
66.0%
34.0%
358.5s
Hybrid
48.6%
88.7%
11.3%
422.1s
ALPS
69.7%
89.8%
10.2%
352.1s
SFS
36.5%
67.8%
32.2%
351.9s
Table 5. Function completion timing across scheduling policies (0–120s / 0–240s: share completed within each window; Tail > 240s: share finishing after 240s; T99% : time to complete 99%). Synthesized policies stay comparable to the baselines on completion throughput.
Comm
RL inference
Total
Scheduling overhead per task ( μ s)
0.67
134.50
135.17
Share of whole workload (%)
0.002
0.40
0.40
Table 6. Per-task scheduling overhead of the synthesized schedulers, split into scheduler–agent communication and RL inference. Overhead of μ s scale is sufficiently small for serverless scheduling decisions.
Metric
Comm
RL inference
Total
CPU core assignment request
1.00
2.57
2.57
Preemption time-slice update
1.00
2.98
2.98
Scheduling overhead per task
1.00
2.57
2.57
Table 7. GPU/CPU overhead ratio for scheduler decision paths on an NVIDIA A30. Values larger than one indicate that GPU execution is slower, so no accelerator is needed for online inference.
Figure 8. Latency–cost trade-off. CFS, EEVDF, and ALPS ( Fu et al., 2024 ) achieve low latency with high cost, while FIFO and SFS ( Fu et al., 2022 ) reduce cost but with higher latency. Hybrid ( Zhao et al., 2024 ) provides intermediate baseline. Our synthesized schedulers span the trade-off space.
Figure 9. Provider headroom versus client cost improvement, both relative to CFS. Synthesized schedulers can increase profit both for provider and client, depending on latency.
Figure 10. Wait-time fairness and mean task latency across heuristic and synthesized schedulers according to the Gini coefficient. The synthesized schedulers offer similar fairness to existing schedulers.