Meta Open-Sources Rebalancer A Solver That Handles 40M Assignment Problems Daily
A C++ library that decides where objects belong — servers, tasks, traffic — is now free for everyone.

Meta has released Rebalancer, a high-performance solver that helps assign objects to containers under strict rules. The tool has been running inside Meta for over nine years, solving about 40 million placement problems every day across more than 30 internal applications 1. It is now available to the public under the Apache 2.0 open-source license.
What It Does
Assignment problems ask a simple question: which object goes into which bin? The answer depends on rules — like CPU limits or storage caps — and goals, like keeping things balanced. At Meta, the same problem shows up everywhere: placing racks in datacenters, assigning servers to services, routing tasks to machines, and directing user traffic to regions.
The challenge is that many of these problems are NP-hard, meaning they are too large for most commercial solvers to handle efficiently 3. Engineers also struggle to turn their policies into precise formulas. Rebalancer tries to solve both problems by separating how a problem is described from how it is actually solved.
How It Works
Rebalancer uses a specification language with three layers. The modeling layer defines dimensions like CPU or memory, partitions of objects, and scopes of bins. The expression layer lets users combine those dimensions using operations like SUM or MAX. The spec layer provides dozens of built-in constraints and objectives, such as balancing utilization across servers or capping capacity per rack 3.
Under the hood, the spec compiles into an expression graph. From there, users can choose between two solving approaches. The local search solver starts with any valid assignment and repeatedly makes small improvements until no better move is found. It runs in parallel and can evaluate millions of possibilities per second, making it suitable for massive problems. The optimal solver translates the graph into a mixed-integer program and uses commercial or open-source backends like FICO Xpress, Gurobi, or HiGHS. It finds the best possible answer but works only on smaller problems 2.
Meta uses local search for nearly all its large-scale problems and reserves the optimal solver for smaller cases or quick prototypes 3.
Real Numbers
At scale, the system is impressive. Meta reports a P99 solve time of just 12 seconds for problems involving 265,000 objects and 3,200 bins 1. Even larger problems — over one million objects and 5,000 bins — average about 171 seconds to solve. The project ships with a Dockerized debugging tool called Rebalancer Explorer, which helps engineers understand why the solver made certain decisions 4.
Rebalancer is installable via PyPI as version 1.0.4 and requires Python 3.12 or newer 3. It still carries an Alpha classification on the package index, but Meta says it is production-ready.
Why It Matters
Other open-source tools like Google OR-Tools and Timefold Solver also handle assignment and scheduling problems. But Rebalancer stands out by letting users define a problem once in a clean specification and then run it on either a fast local search solver or a mathematically optimal one — without rewriting anything 3. For teams building infrastructure at scale, that flexibility could save a lot of engineering time.
Key facts
- Rebalancer solves roughly 40 million assignment problems per day at Meta
- P99 solve time is 12 seconds for problems with 265,000 objects and 3,200 bins
- Available on PyPI as v1.0.4 under the Apache 2.0 license
- Uses both local search and mixed-integer programming solvers
- Has been used internally at Meta for over nine years
Sources
- Meta AI Open-Sources Rebalancer: A C++ Assignment Solver That Runs About 40 Million Placement Problems a Day — marktechpost.com
- GitHub - facebook/rebalancer: Rebalancer is a domain-specific language ...
- Meta AI Open-Sources Rebalancer: A C++ Assignment Solver That Runs ... — syncai.news
- Meta Rebalancer is now open source: its C++ solver lands on PyPI — en.softonic.com
- Open-Sourcing Rebalancer: A Generic, High-Performance Library for ... — engineering.fb.com



