Rebalancer
Rebalancer is a resource-allocation library developed at Meta for assigning objects to containers under constraints and optimization goals. Its C++ core runs in one process with multiple threads; applications can use C++ or Python interfaces.[2] Meta announced its open-source release on September 21, 2026, after more than nine years of internal use.[1]
Modeling an assignment
The model describes what can be placed, where it can go, and the properties relevant to placement. The same task-to-server problem can express limits on individual servers and requirements across racks.[3]
| Construct | Meaning | Task-placement example |
|---|---|---|
| Object | Item being assigned | Task |
| Container, also called a bin | Assignment destination | Server |
| Dimension | Numeric object or container property | Task CPU requirement or server CPU capacity |
| Scope | Grouping of containers | Servers belonging to a rack |
| Partition | Grouping of objects | Tasks belonging to jobs |
Dimensions can depend on both the object and its destination. Object groups need not be disjoint.[3]
Goals and constraints
Reusable specifications, or specs, describe placement requirements and quantities to optimize. The reference catalog contains more than 25 specs. Some support both goals and constraints; others support only one.[4]
| Spec | Example purpose | Supported role |
|---|---|---|
| Capacity | Keep utilization within limits | Both |
| GroupCount | Bound a group's utilization within each scope item | Both |
| Balance | Equalize utilization across scope items | Goal |
| AvoidAssignments | Exclude particular placements | Constraint |
| ToFree | Drain listed containers | Both |
| DisasterRecoveryCapacity | Reserve capacity for correlated failures | Both |
A constraint's policy matters when the initial assignment is invalid.[5]
| Policy | Treatment |
|---|---|
| DEFAULT | Preserve initially satisfied constraints. Repair existing violations as high-priority goals while prohibiting deterioration beyond their initial level. |
| HARD | Require satisfaction; inability to satisfy the constraint is an error. |
| SOFT | Penalize violations, which can remain or worsen when the overall objective improves. |
Multiple goals can share a weighted sum or occupy ordered priority buckets. Buckets are compared lexicographically: a lower-priority goal can improve only when earlier buckets tie. A large weight alone does not establish strict priority.[6]
Expression graph and solvers
Rebalancer translates specifications into a directed acyclic expression graph. The OSDI 2024 paper describes a representation that grows with objects plus bins, rather than the object-bin product of a direct mixed-integer formulation. The graph separates problem representation from the choice of solving algorithm.[7]
| Solver family | Approach | Important limitation |
|---|---|---|
| Local search | Improve an initial assignment through incremental moves | Can stop at a local optimum rather than the best possible assignment |
| Optimal solver | Translate the model for FICO Xpress, Gurobi, or open-source HiGHS | Large problems can exhaust resources; a time-limited result need not be optimal |
The model can remain unchanged when switching between these families.[2][8]
Local search is the default. Its configurable move types determine which neighboring assignments it evaluates. Time and applied-move limits provide stopping conditions; without configured stopping limits, it searches until reaching a local optimum. Discontinuous requirements can make incremental search get stuck.[9]
Production use at Meta
Meta uses Rebalancer for database-shard placement, allocating servers to services, traffic routing, serverless-function locality, and balancing online machine-learning training across regions. Its September 2026 release post reported the following operating scale.[1]
| Reported measure | Value and scope |
|---|---|
| Daily assignment problems | Roughly 40 million |
| Distinct problem formulations | More than 30 |
| 99th-percentile solve time | 12 seconds for a problem with 265,000 objects and 3,200 bins |
| Large-problem average | 171 seconds for problems exceeding 1 million objects with 5,000 bins; more than 3,400 such runs |
These figures describe Meta's workloads, not a guaranteed runtime for arbitrary models.[1]
Research and evaluation
Neeraj Kumar and eight coauthors presented Rebalancer at OSDI 2024. In one Azure-data placement experiment involving 10,000 pods and 500 nodes, the paper reported 94.6% placement with an optimal MIP solver, 92.8% with SINGLE_GREEDY, and 93.2% with SINGLE_RANDOM. SINGLE_RANDOM ran faster but placed fewer pods than the MIP baseline in that experiment.[7]
The paper's separate DCM comparison used published DCM measurements rather than running both systems on identical hardware, because of security and dependency restrictions.[7]
Explorer and distribution
Rebalancer Explorer is a web interface for inspecting solver inputs, assignments, goals, constraints, and solution scores. Its Next.js frontend communicates through a JSON proxy with a C++ Thrift backend. Docker Compose can start these components with example problem bundles. The proxy URL and bearer token are configurable; the token is required unless proxy authentication has explicitly been disabled.[10]
Rebalancer is distributed under Apache 2.0. Python installation uses pip install rebalancer; the repository also provides platform-specific native builds and packages. Building the C++ library from source does not itself create the Python package.[2]
See also
References
- ^1 ^2 ^3Engineering at Meta. Open-Sourcing Rebalancer: A Generic, High-Performance Library for Solving Assignment Problems. September 21, 2026.
- ^1 ^2 ^3Meta. Rebalancer repository and README. GitHub.
- ^1 ^2Meta. Core Concepts. Rebalancer documentation.
- ^Meta. Goals and Constraints. Rebalancer documentation.
- ^Meta. Constraint policy. Rebalancer documentation.
- ^Meta. Goal priorities. Rebalancer documentation.
- ^1 ^2 ^3Kumar, Neeraj, et al. Optimizing Resource Allocation in Hyperscale Datacenters: Scalability, Usability, and Experiences. OSDI 2024, pp. 507-528.
- ^Meta. Solver Overview. Rebalancer documentation.
- ^Meta. Local Search Solver. Rebalancer documentation.
- ^Meta. Rebalancer Explorer. Rebalancer documentation.
Improve this article
Add missing citations, update stale details, or suggest a clearer explanation. Every suggestion is reviewed for sourcing before it goes live.
1 revision · v1 · 929 words · full history
Fact-checks are independent of edits: a reviewer re-verifies the article against its sources and stamps the date. How we verify
Research and drafting on this wiki are AI-assisted, under named human editorial standards. How AI is used here
Reviewer note: Independent full-article review against 10 cited primary and academic sources, October 12, 2026. Checked subject identity, specifications, availability, benchmark conditions and limitations.
Cite this page: AI Wiki. "Rebalancer." aiwiki.ai, updated 11 Oct 2026, fact-checked 11 Oct 2026. CC BY 4.0. https://aiwiki.ai/wiki/rebalancer