Skip to main content
Back

Reinforcement Learning Beats Kubernetes Fixed Weights by 33% on Serverless Clusters

A research paper shows reinforcement learning can automatically tune Kubernetes-style scheduler weights, beating fixed weights by 33 percent in serverless benchmarks.

Pro

  • Paper proposes reinforcement learning to tune weights of scheduler scoring functions instead of leaving them equal.
  • Approach uses percentage-improvement reward, frame stacking, and deliberately limited domain information for generalization.
  • Reports 33% gain over fixed weights and 12% over the best classical tuning baseline in serverless benchmarks.
  • Evaluated on the Skippy scheduler inside the faas-sim simulator across heterogeneous cloud and edge clusters.
  • Trained with Soft Actor-Critic on Stable Baselines3, tuning eight Kubernetes-style scoring functions as a continuous action vector.
  • Full paper on arXiv; no public code release accompanies the work.

Cluster schedulers like Kubernetes decide where every pod runs by scoring candidate nodes with a handful of built-in functions and picking the highest ranked. Those functions are usually weighted equally, which is a fine default and a lousy optimum. A new paper, Learning to Score: Tuning Cluster Schedulers through Reinforcement Learning by Martin Asenov, Qiwen Deng, Gingfung Yeung, and Adam Barker, treats those weights as a learnable policy and reports meaningful gains on serverless workloads without touching the scheduler's decision logic.

Why equal weights leave performance on the table

Modern orchestrators use a two-step pipeline for placement. Cluster schedulers usually rely on a set of scoring functions to rank feasible nodes, and the pod is sent to whichever node ends up with the highest normalized score. Kubernetes ships with functions like LeastAllocated, MostAllocated, BalancedResource, ImageLocality, and topology-aware variants, each pushing placement toward a different objective (spread, pack, data locality, and so on).

The catch is the weighting. Results from individual scoring functions are usually weighted equally, which could lead to sub-optimal deployments as the one-size-fits-all solution does not take into account the characteristics of each workload. Deep learning jobs benefit from tight co-location for network throughput, while user-facing services want to be spread out for redundancy. Tuning the weights of scoring functions, however, requires expert knowledge and is computationally expensive.

Standard black-box optimizers (random search, Bayesian optimization with Gaussian processes, tree-structured Parzen estimators) can nibble at the problem, but each candidate configuration means running an actual benchmark. Computational cost of evaluating a new configuration, high dimensionality of workload-cluster specification, high dimensionality of weights of the scoring functions combine to make classic tuners painfully slow to converge.

Framing weight tuning as an RL problem

The authors reframe the tuner itself as a reinforcement learning agent that produces weight vectors, watches the resulting benchmark score, and refines its guesses. Three design choices carry the paper:

  • Percentage improvement reward. Instead of rewarding the raw metric, the agent is rewarded on the best relative gain over a default action across an episode. This normalizes across very different clusters and workloads so the same policy can be trained on heterogeneous scenarios without one environment's scale dominating the gradient.
  • Frame stacking. Each observation carries the history of previously tried (action, reward) pairs, so the policy can behave like a proper sequential optimizer rather than a memoryless sampler. A recurrent policy variant is also explored.
  • Limiting domain information. Static context such as machine types and workload identity is deliberately withheld or coarsened during training. RL agents love to memorize environments, and this trick pushes the policy toward a general exploration strategy that survives unseen clusters.

Under the hood the training uses Soft Actor-Critic with entropy regularization, a 512x512x512 MLP for both Q-network and policy, and Stable Baselines3 as the framework. The scoring weights themselves are the continuous action vector.

The benchmark setup

Evaluation runs on faas-sim, a high-fidelity Function-as-a-Service simulator that models both network topology delays and heterogeneous hardware execution times. The scheduler under test is Skippy, extended with Kubernetes-style scoring functions. Eight scoring functions are tuned in total, including LeastAllocated, MostAllocated, RTCRatio, DataLocality, Capability, and LatencyAwareImageLocality.

Clusters mix Xeon CPUs and GPUs with edge hardware like Raspberry Pi 3/4, NVIDIA Nano, Coral dev boards, and Intel NUCs, arranged under two network topologies: a uniform-bandwidth internet layout and a bandwidth-limited urban layout.

Network topology graph used to simulate cluster connectivity in the evaluation

The optimization target combines mean function execution time, mean function queue time, and the fraction of successful requests, all normalized and weighted equally. Only three of eight cluster setups are used for training; the remaining five, along with expanded workloads and scheduling parameters, are held out for generalization tests.

Results

On configurations similar to training, the RL policy improves the combined score by 33% over Kubernetes-style fixed weights and by 20% over the strongest classical baseline. On unseen cluster and workload combinations, the gains shrink but persist: 20% over fixed weights and 6% over the best baseline. Averaged across the paper's headline claim, the approach delivers 33% compared to fixed weights and 12% compared to the best-performing baseline in a lab-based serverless scenario.

Two behaviors stand out. First, the agent learns that some scoring functions matter more than others in specific regimes; locality weight is nearly zero in homogeneous clouds but climbs on heterogeneous edge setups. Second, on the simplest workloads (a homogeneous cluster with few functions) tuning barely helps, which is a useful negative result: the technique is most valuable exactly where hand-tuning is hardest.

What is useful, and what is not

The practical appeal is that the RL agent sits on top of the existing scheduler, only changing weights. There is no need to rip out Kubernetes' scoring pipeline or trust a neural net to make individual placement decisions in production, which is the usual sticking point for RL-based schedulers. That also makes safety analysis easier, because the action space is bounded and the scheduler's own logic still enforces feasibility.

The limits are worth flagging. Training and evaluation happen in simulation, not on live production traffic. The workloads are FaaS-shaped Poisson arrivals of ML inference and preprocessing functions; database-heavy or long-running batch jobs are out of scope. And the paper does not release code or a trained checkpoint, so anyone wanting to reproduce this against their own cluster will need to reimplement the gym wrapper around faas-sim or a comparable simulator and retrain from scratch using Stable Baselines3. The generalization results suggest that retraining is not a per-cluster tax, but validating the policy on a new environment is still a real engineering exercise.

For anyone running heterogeneous clusters, especially edge-plus-cloud FaaS deployments, the takeaway is concrete: the default equal weighting of scoring functions is probably costing 20 to 30 percent of achievable performance, and framing the tuner as a sequential decision-making agent with a percentage-improvement reward is a more sample-efficient way to close that gap than throwing Bayesian optimization at it.