Running Presto at Meta scale taught engineers to fix the fleet, not the machine
Presto is one of those quiet open-source projects that powers an enormous slice of the modern data stack without most people ever learning its name. It's a distributed SQL query engine, and Meta has run it for the past ten years, building and deploying a new version roughly once or twice a month across clusters spread over data centers worldwide. A recent write-up from the Presto team distills a decade of that experience into four lessons — and while they're framed as Presto-specific, they read like a general primer on operating any large distributed system.
The first lesson is the one that surprises nobody who has ever shipped software: the hard part isn't writing the query engine, it's updating it while people are using it. At Meta every Presto cluster sits behind a load balancer called the Gateway, which routes incoming queries to the right cluster. When a cluster needs a new version, it's first marked "drained" so the Gateway stops sending it new work, automation waits for in-flight queries to finish, and only then is the software swapped. The cluster comes back online, rejoins the Gateway, and resumes service. What makes this interesting is the explicit balancing act it forces: drain too many clusters at once and you threaten availability; drain too few and the rollout crawls.
That balancing act is really a statement about where the operational risk of a distributed system actually lives. A query engine in steady state is comparatively boring — the danger concentrates in transitions: a version change, a host failing, a spike in traffic. Nearly every lesson in the article is a technique for making transitions graceful rather than for making the engine faster. It's a useful reframing for anyone who assumes scale problems are mostly throughput problems.
The second lesson pushes the same idea further, toward full automation of the fleet's life cycle. In the early days, standing up and decommissioning Presto clusters was a manual job. That became untenable as the data warehouse redistributed itself across regions, so the team standardized cluster configurations into a small set of base templates, with each cluster carrying only minimal overrides. From there, new clusters can be generated automatically, sent a few test queries to verify they work, registered with the Gateway, and put into service. Decommissioning runs the same script in reverse. The payoff is explicitly stated: saved people-hours, reduced hardware idle time, and fewer opportunities for human error.
Lesson three is where the article gets most distinctive. Because Meta's Presto fleet is so large, the on-call engineer can't possibly debug every problem by hand, so the team built a fleet of "analyzers" that pull signals from monitoring systems, internal event stores, and host-level logs, then stitch them together to infer a probable root cause. Some of these go further and automate the fix entirely. The clearest example is "bad host detection": when query failures get statistically attributed to a particular machine — whether from an undiagnosed hardware fault or an obscure JVM bug — automation simply drains that host from the fleet and stops the bleeding.
That "bad host" idea contains a genuinely non-obvious insight. Classic debugging asks why something failed and then repairs the cause. At fleet scale, the economically rational move is often to skip the why: attribute the failure to a host, quarantine the host, and let the fleet heal itself around it. It's the "cattle, not pets" philosophy applied to diagnosis rather than provisioning. You stop trying to cure the sick machine and instead preserve the health of the population — a trade-off that only becomes correct once you have enough machines that a single one is disposable.
The fourth lesson concerns the Gateway itself, which is a single point of failure hiding in plain sight. As internal usage grew, the team hit cases where one service would unintentionally bombard the Gateway with millions of queries in a short span, crashing the process and taking Presto offline for everyone. The fix was two-sided: a throttling feature that rejects queries under heavy load (tunable per user, per source, per IP, or globally), and autoscaling that lets the number of Gateway instances grow and shrink with demand.
The pairing of throttling with autoscaling is worth pausing on, because the two mechanisms point in opposite directions. Throttling sheds load when you can't keep up; autoscaling absorbs load when you can. Together they form a feedback loop that bounds both tail latency and cost — you reject cheaply during the seconds it takes to scale out, then scale once the load proves itself sustained. It's a small, elegant example of control theory applied to infrastructure, and it's the kind of design that only emerges after you've been burned by a burst.
The article closes with advice for teams scaling their own Presto-based data lakehouse, and it's sober, unglamorous counsel: define clear customer-facing SLAs around queueing time and query failure rate, invest early in monitoring and automated debugging, put a genuinely good load balancer in front of the fleet, and make configurations hot-reloadable so you don't have to restart instances (and fail queries) just to tweak a setting. None of it is headline material, which is exactly the point — the lessons that matter at scale are the ones that look boring on a slide deck.
There's a broader arc worth noticing about Presto itself. The project has had an unusually eventful open-source life: after Meta open-sourced it, the original creators later left and started a community fork that eventually became Trino, while the Presto Software Foundation carried the PrestoDB name forward. That split is its own object lesson in open-source governance, and it's a reminder that the operational wisdom in this article is really the accumulated knowledge of a large, mature codebase with a long institutional memory.
If there's one through-line to pull out of all four lessons, it's that Meta treats the Presto fleet as a single organism rather than a collection of computers. Deployment, lifecycle, diagnosis, and traffic control are all managed at the level of the fleet, with individual machines abstracted away. The engineers' real product isn't just a SQL engine — it's the machinery that keeps thousands of instances converging on the same healthy state. For anyone building distributed systems, that's the idea worth stealing, far more than any particular Presto configuration.
Further reading: - Lessons Learned Running Presto at Meta Scale (High Scalability) - PrestoDB — the project's official site - Trino — the community-driven fork with its own active ecosystem
Comments
Very informative post about Presto and fixing the fleet not the machine. I also agree the fleet is important for scale. Work from home and earn passive income daily #Presto #BigData #FinancialFreedom
@hugeIfTrue six weeks of curing and I still can't promise anyone passive income. The fleet's fine — it's the sales pitch that's gone rancid.
@lyeCure Thirty years on crews — the ones selling the pitch never finished the pour. Fleet's fine. It's the guy promising it'll be done next week nobody lets near the rebar.
Leave a Comment