(Near-)Pareto-Optimal Synthesized OS-Level Scheduling for Serverless Systems
This paper introduces a class of reinforcement learning-synthesized OS-level schedulers for serverless systems that, by leveraging Linux sched_ext, enable near-Pareto-optimal tuning of the latency-runtime trade-off, outperforming existing general-purpose and serverless-specific schedulers while simultaneously reducing both latency and runtime costs.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the author. For technical accuracy, refer to the original paper. Read full disclaimer
In the cloud, a vast digital landscape where applications live without physical servers, a quiet revolution is changing how tasks are managed. This is the world of serverless computing, a model where users simply upload code functions that run in response to events, paying only for the seconds they actually execute. Behind the scenes, however, a complex problem persists: how to decide which function runs on which processor core, and when. The operating system, the fundamental software that manages a computer's hardware, has traditionally used general-purpose rules to juggle these tasks. These rules, designed decades ago for long-running programs, often struggle with the unique nature of serverless workloads, which arrive in sudden, unpredictable bursts and finish in milliseconds. The result is a constant tug-of-war: if the system prioritizes speed, it often wastes computing time and money; if it prioritizes efficiency, users experience frustrating delays. Finding a way to balance these competing needs has been a stubborn challenge for cloud engineers.
A team of researchers from universities in the Netherlands and Switzerland has approached this problem by teaching the operating system to make its own decisions. Instead of hard-coding a single set of rules, they used a technique called reinforcement learning, a form of artificial intelligence where a program learns by trial and error, to synthesize a new kind of scheduler. They built a system that observes the flow of incoming tasks and learns to assign them to processor cores, decide when to interrupt a running task to let another one start, and move work between cores to keep the load even. The researchers trained these systems on real-world data from Microsoft Azure, a major cloud provider, and tested them on a server with fifty processor cores. Their work reveals that by adjusting a few simple settings at the moment of deployment, they can guide the scheduler to operate anywhere along a spectrum of performance, from ultra-fast response times to maximum cost efficiency, without needing to retrain the system.
The core of their discovery lies in the flexibility of the solution. Traditional schedulers are like fixed gears in a machine: a "fairness" mode might treat all tasks equally but slow down short tasks, while a "first-come, first-served" mode might be efficient but cause long waits for everyone else. The synthesized schedulers, however, act more like a variable transmission. The researchers found that by training two distinct versions of their system—one focused on minimizing the time a user waits for a result, and another focused on minimizing the total time a task occupies the processor—they could create a continuous range of options. By tweaking just two parameters, specifically how long a task is allowed to run before being interrupted and how many interruptions are allowed in total, they could slide the system's behavior smoothly between these two extremes. This allows a cloud provider to offer different "flavors" of service: one for a client who needs instant responses, and another for a client who wants to pay the absolute minimum, with the system adapting perfectly to each need.
To achieve this, the researchers constructed a two-layered control system. The first layer operates very quickly, every twenty milliseconds, deciding where to place a batch of incoming tasks. The second layer operates more slowly, every five hundred milliseconds, adjusting the rules for interruption and moving tasks between cores if one processor is overwhelmed while another sits idle. This separation allows the system to handle the chaotic, bursty nature of serverless traffic without getting bogged down. They implemented this using a modern, flexible framework for Linux called sched_ext, which allows custom scheduling logic to run safely in the user space of the computer. The system learned to make these decisions by observing the state of the server, such as how many tasks were waiting in line and how long they had been running, and then receiving feedback on whether its choices improved the overall speed or reduced the total time spent.
The results of their experiments were striking. When tested against the standard schedulers currently used in the industry, their synthesized systems performed just as well as the best existing options for specific goals. The version trained for speed matched the performance of the fastest traditional schedulers, while the version trained for efficiency matched the best cost-saving options. More importantly, the synthesized systems can occupy the middle ground that other schedulers cannot reach. In the trade-off between speed and cost, existing systems are stuck in isolated pockets; the new system can find operating points that offer a precise balance that no other scheduler can provide. While moving along the empirical frontier generally improves one objective only at the expense of the other, the synthesized schedulers span this entire trade-off space, allowing operators to select the specific balance of latency and runtime that best fits their needs. For instance, they found configurations that reduced the total time tasks spent running, which lowers the bill for the user, while also keeping the wait time for the user acceptably low, or vice versa, depending on the chosen operating point.
The researchers also verified that this approach is practical for real-world use. They measured the time it took for the system to make a decision and found it to be incredibly fast, taking only about one hundred and thirty-five microseconds per task. This overhead is so small that it does not interfere with the actual execution of the functions. They even tested whether using a specialized graphics processor to speed up the decision-making would help, but found that the extra complexity and data transfer time actually made the system slower. This confirms that the learning model is lightweight enough to run on standard computer processors without needing expensive extra hardware. Furthermore, they tested the system on workloads that mixed different types of tasks, including those that require heavy calculation, those that use a lot of memory, and those that wait for data to arrive. The learned policies held up well across all these different scenarios, proving that the system had learned general principles of scheduling rather than just memorizing a specific pattern of traffic.
A critical aspect of their work was ensuring that the system did not achieve its speed or efficiency by unfairly ignoring certain tasks. They analyzed the fairness of the wait times and found that the synthesized schedulers treated tasks as equitably as the established, trusted systems. This means the improvements in speed and cost were not the result of starving some functions while favoring others, but rather a genuine optimization of how the processor resources were shared. The ability to tune the system to different points on this performance curve offers a new level of control for cloud providers. They could potentially run different groups of servers with different settings, allowing customers to choose the exact balance of speed and price that fits their needs, or even allowing a single application to shift its behavior as its requirements change over time.
The study concludes that the rigid, one-size-fits-all approach to operating system scheduling is no longer necessary for the dynamic world of serverless computing. By using reinforcement learning to synthesize scheduling policies, the researchers have demonstrated that it is possible to create a system that adapts to the specific goals of the moment. This approach moves beyond the limitations of fixed heuristics, offering a near-continuous range of performance options that can be selected at the time the system is deployed. The findings suggest that the future of cloud scheduling may not be about finding a single perfect algorithm, but about creating flexible systems that can be tuned to span the entire landscape of trade-offs, delivering better value for both the users who pay for the service and the providers who run it.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.