Home · ASPLOS 2023 · Datacenter, Cloud & Networking

Erms: Efficient Resource Management for Shared Microservices with SLA Guarantees

Shutian Luo, Huanle Xu, Kejiang Ye, Guoyao Xu, Liping Zhang, Jian He and 2 others

Conference
ASPLOS 2023
Published
2022
Pages
62-77
Citations
49

In production clusters 40% of microservices serve more than 100 different products at once, so one product's surge ruins another's latency — Erms profiles each microservice's piecewise-linear latency curve, splits every SLA into per-microservice targets in closed form, and turns sharing into an advantage by letting the tightest-deadline service go first.

The argument in one glance

  1. Problem

    One request, hundreds of services, one deadline

    Microservice architectures decompose applications into small, independently scalable pieces — and recompose every user request into a dependency graph of parallel, sequential, and alternative calls across hundreds of microservices. The service-level agreement (SLA) binds only the end-to-end tail latency; how to divide that budget among graph nodes, each running hundreds of containers colocated with noisy batch jobs, is the resource manager’s problem.

  2. What people did

    Statistics, learning, or per-service tuning

    GrandSLAm assigns each microservice a latency target proportional to its average latency; Rhythm scores contributions from latency mean, variance, and correlation; Firm identifies critical microservices per path and tunes them with reinforcement learning; deep-learning managers search resource configurations directly.

  3. Why it fell short

    Fixed statistics, unscalable learning — and sharing ignored

    Statistical contributions are static while workloads are not; RL needs labeled critical microservices and mis-tunes when several exist; configuration-searching DL cannot scale to production services with 1,000+ microservices. And no prior system models the defining feature of production meshes: in Alibaba traces spanning 20,000+ microservices, 40% are shared by more than 100 online services — so one service’s traffic surge inflates every co-tenant’s latency at the shared node.

  4. This paper's idea

    Profile a curve, solve in closed form, prioritize at shared nodes

    Erms profiles each microservice’s tail latency as a piecewise-linear function of workload — with slope and knee shifted by host interference — then collapses arbitrary dependency graphs into chains via virtual microservices and splits each SLA into per-microservice latency targets by convex optimization with closed-form solutions. At shared microservices, services with tighter targets get (probabilistic) priority, converting sharing from a hazard into a 40%+ resource saving. Against state-of-the-art managers: 1.6× fewer containers and 5× fewer SLA violations.

Why this problem is worth solving

A modern online product is a

the tree of calls triggered by one user request — microservices invoking downstream microservices sequentially or in parallel; end-to-end latency is the longest path (critical path), and a graph may have several
. Requests to Alibaba-scale services touch hundreds of microservices; the
service-level agreement — here a bound on tail (95th-percentile) end-to-end latency, e.g., 50–200 ms
constrains only the total. Managing resources means answering, continuously: how many containers should each microservice get so that the sum along every critical path stays under budget — at minimum cost?

Two production realities sharpen the problem. First, interference: microservice containers share hosts with batch jobs (colocation is how clusters reach acceptable utilization — the same tension VELTAIR attacks for DL serving, covered elsewhere on this site), and interference visibly changes how latency responds to load. Second — the paper’s signature observation — sharing: the Alibaba traces show 40% of microservices serve more than 100 distinct online services, each with its own SLA and workload pattern. A surge in one product’s traffic queues everyone at the shared node; conversely, the shared node is exactly where global coordination can pay. The paper’s motivating experiment shows that simply prioritizing services correctly at one shared microservice saves over 40% of resources — an opportunity every prior per-service manager leaves untouched.

What people did before, and where it broke

Statistical decomposition. GrandSLAm splits the SLA proportionally to each microservice’s average latency; Rhythm weights contributions by mean, variance, and correlation with end-to-end latency. Both produce fixed per-microservice targets — but the right division depends on the current workload, because latency-vs-load curves are nonlinear and each microservice sits at a different point on its curve at any moment.

Learning-based managers. Firm labels critical microservices and tunes them with reinforcement learning — labeling is costly, and independently boosting several critical microservices in one service lands in sub-optimal corners (Firm shows the longest resource tail in the evaluation, 3× Erms’s containers in the extreme). Configuration-searching deep-learning approaches must evaluate many candidate allocations per decision — a non-starter at 1,000+ microservices per service.

The missing curve. All prior work models microservice latency by summary statistics. Measured reality (benchmarks and Alibaba traces alike) is a piecewise-linear curve with a knee: latency grows slowly with load until the container’s thread pool saturates, then climbs steeply as queueing takes over. Interference moves both parameters — on a heavily-loaded host the post-knee slope is 5× steeper and the knee arrives earlier. A manager that cannot see the knee cannot know which microservice is about to blow the budget.

Erms: profile, merge, solve, prioritize, place

  1. Latency + resource profiling new

    From tracing timestamps (Jaeger-style SEND/RECEIVE events, subtracting downstream response times), fit each microservice’s tail latency as a piecewise-linear function of workload per interference level — slope a, intercept b, knee auto-detected — plus a linear resource-usage model. Accuracy: 83–97%, matching XGBoost/neural networks while needing less data (85% accuracy from 70% of samples, where the NN collapses) and staying interpretable.

  2. Graph merge new

    A depth-first pass collapses an arbitrary dependency graph into a sequential chain by inventing virtual microservices: sequential neighbors merge with closed-form combined parameters (a square-root-weighted composition), parallel branches merge because optimal targets across parallel paths must be equal. Complex DAGs — even TrainTicket’s runtime-dynamic graphs — reduce to chains cheaply.

  3. Latency target computation new

    On the merged chain, minimizing total container-resource cost subject to the SLA is convex with a closed-form split: each microservice’s share of the budget follows the square root of its (slope × resource price × workload). Containers per microservice follow directly: n = a·γ / (target − b).

  4. Priority scheduling at shared microservices new

    Services with tighter latency targets at a shared node get higher priority (they embed more latency-sensitive work); priorities are probabilistic to avoid starvation. Each service then sees a modified cumulative workload — priority k queues behind 1..k — and targets are recomputed per service independently, sidestepping the n! joint orderings.

  5. Interference-aware placement new

    Containers are placed across hosts to minimize aggregate latency, pricing interference from batch jobs AND from the containers being placed — not merely balancing host utilization (the Erms-IPM baseline shows the difference).

Prototype on Kubernetes with a tracing coordinator; scalability comes from closed forms and low-complexity graph algorithms rather than search.

The idea

Profile the curve, not the moments. The piecewise-linear model L = a·(γ/n) + b — latency as slope times per-container load plus intercept, valid per segment, per interference level — is the load-bearing abstraction. It is invertible: given a latency target, it tells you the container count; given interference, it tells you the slope. Its simplicity is a feature twice over: it needs little training data (production microservices change often), and it makes everything downstream solvable rather than searchable.

Turn the graph into algebra. Splitting an end-to-end budget across a DAG looks combinatorial. Erms dissolves it with two observations. Parallel branches must receive equal targets at the optimum (otherwise the looser branch donates slack to the tighter one and saves containers). Sequential neighbors combine into a single virtual microservice whose effective slope has a closed form — the square-root-weighted composition that also answers how to split a budget between two stages optimally. Applying these two merges recursively, any graph becomes a chain, and the chain’s optimal budget split is a textbook convex problem with an explicit solution. No learning, no enumeration — which is why Erms scales to 1,000+-microservice services and dynamic graphs.

Make sharing pay. At a shared microservice, mixing all services’ traffic means the tightest deadline dictates provisioning for everyone’s load — the worst of all worlds. Erms orders services by their computed latency targets: tightest first. The intuition: a low target signals a service built from many latency-sensitive pieces; serving it first lets its target be met with few containers, while looser services absorb queueing where their budgets have slack. The modified-workload model makes this tractable — priority-k traffic sees the cumulative load of priorities 1..k, so each service’s targets can be recomputed independently instead of solving the coupled n!-ordering problem. Strict priority risks starvation, so priorities are enforced probabilistically. This scheduling alone cuts container counts by up to another 50%.

Place against interference, globally. Scaling uses average interference for tractability; placement then repairs the variance — assigning containers to hosts to minimize aggregate latency, accounting for both existing batch-job pressure and the interference the new containers will themselves create. Balancing raw utilization (the earlier Erms-IPM approach, kept as a baseline) ignores that different microservices degrade differently under the same pressure.

A traffic surge hits a shared microservice

Service A = checkout (tight 50 ms P95 SLA); Service B = browsing (loose 200 ms). Both call shared microservice S. L = a·(γ/n) + b: tail latency from slope a, workload γ, containers n, intercept b. Numbers illustrative; mechanics follow the paper's Sections 4–5.

Step 1 of 6

The profiles already know the curves

Offline, Erms fitted every microservice’s piecewise-linear latency curve from tracing data — per interference level. For shared microservice S it knows: slope doubles past the knee, and on hosts with heavy batch colocation the post-knee slope is up to 5× steeper. Profiling accuracy runs 83–97% with far less data than a neural network needs.

model: L = a·(γ/n) + b, per segment, per interference
knee + slope shift with host pressure

Why it works

  • Latency curves have knees and interference-dependent slopes → summary statistics miss exactly the regime changes that cause violations → an invertible piecewise-linear model turns “how many containers?” into arithmetic.
  • Parallel-equal and sequential-fusion merges are provably optimal local moves → any DAG collapses to a chain whose budget split has a closed form → SLA decomposition scales to 1,000+ nodes and runtime-dynamic graphs where search-based managers time out.
  • At shared nodes, deadlines and volumes are mismatched across tenants → serving tightest-deadline traffic first lets each target be met at its own price → sharing becomes the largest single source of savings (40–50%) instead of the largest hazard.
  • The cumulative-workload trick decouples the joint scheduling problem → per-service recomputation replaces n! orderings → priority scheduling stays cheap enough to run online.
  • Simple models are data-efficient and interpretable → profiles stay fresh as microservices evolve, and operators can read why a target moved — properties RL and DL managers lack at this scale.

What it costs

  • Profiling infrastructure. Continuous tracing (Jaeger-class), per-microservice/per-interference fitting, and the knee detection must stay current as code and traffic evolve.
  • Model risk at the edges. Piecewise linearity is an empirical fit; workloads sitting exactly at a knee, or interference outside profiled levels, degrade the closed forms’ accuracy.
  • Priority machinery. Request tagging and probabilistic priority queues at shared microservices touch the data plane; starvation is mitigated, not impossible.
  • Average-interference scaling. The scaling model sees mean interference; placement repairs variance afterward — a deliberate tractability split, not a guarantee.
  • Evaluation scale. The real cluster is 20 hosts with DeathStarBench/TrainTicket; production-scale evidence (1,000+-microservice Taobao graphs, 20,000-microservice traces) comes from profiling validation and trace-driven simulation.

The evaluation

Deployed on a 20-host Kubernetes cluster (32 cores / 64 GB each) running DeathStarBench (Social Network, Media, Hotel Reservation — 36/38/15 microservices, with shared microservices across services) and TrainTicket (~10 services, 23 shared microservices, dependency graphs that change shape per request), driven by static workloads from 600 to 100,000 requests/minute and dynamic Alibaba-trace replays; SLAs at P95 from 50 to 200 ms. Baselines: GrandSLAm, Rhythm, Firm, and Erms-IPM (the utilization-balancing placement variant).

SLA managers for shared microservice meshes

PropertyGrandSLAm / Rhythm (statistical)Firm (RL on critical microservices)Erms
How the SLA is divided
Containers used
SLA violationsReferenceReference
Sharing and dynamicsSharing unmodeled; static graphs assumedSharing unmodeled
20-host Kubernetes cluster (32 cores/64 GB per host; containers 0.1 core/200 MB); DeathStarBench + TrainTicket; workloads 600–100K req/min static plus Alibaba dynamic traces; SLAs at P95, 50–200 ms; profiling validated on 1,000+ Alibaba production microservices (accuracy up to 92%); interference injected via iBench. Erms-IPM ablation isolates interference-aware placement; probabilistic priorities measured to trade minor high-priority latency for large low-priority relief.Underlined values explain themselves when clicked.

Check your understanding

  1. 1. Rhythm and GrandSLAm divide the SLA using each microservice’s latency statistics (mean, variance, correlation). Predict their failure mode as workload rises toward saturation.

  2. 2. The motivating experiment shows that merely prioritizing services correctly at one shared microservice saves over 40% of resources. Where does the saving come from?

  3. 3. Erms collapses arbitrary dependency graphs into chains before computing latency targets. What justifies the two merge rules?

  4. 4. Erms’ profiling model (two-parameter linear segments) achieves 83–97% accuracy — no better than XGBoost or a neural network. Why does the paper prefer it anyway?

Related papers on Datacenter, Cloud & Networking

See all 163 →