Meta Introduces ZGateway: A Stateless Proxy Tier That Unifies ZippyDB Traffic and Handles Over 1 Billion Operations Per Second

2026年9月15日 04:28
站內 AI 整理稿

Meta engineering team introduced ZGateway, a proxy tier that now sits between client applications and ZippyDB, the Meta’s most widely used key value store.ZippyDB backs product metadata, counters, and configuration at billions of operations per second.

ZGateway started as a fix for connection sprawl across more than a million client hosts and grew into the home for batching, admission control, caching, and failover.Why ZippyDB Needed a Proxy Under direct access, every ZippyDB client connected to every database host it needed.

A single client could touch tens of thousands of shards across hundreds of thousands of hosts, so both a typical client and a typical database host carried tens of thousands of TLS connections.

Each idle connection consumed memory, CPU, and a file descriptor on both ends, and inbound counts grew with every client cohort.

Reconnection storms caused crashes from file descriptor exhaustion and OOMs; in one incident a routing bug made every client open a connection per shard and the fleet fell into a reboot loop.Client-side fixes were impractical because hundreds of teams own the client fleet.

What is ZGateway ZGateway is a stateless proxy tier between ZippyDB clients and the ZServer database fleet.Per Meta, it handles more than 1 billion operations per second and carries about 40% of ZippyDB traffic, projected to pass 60%, at about 6% computational overhead for an average use case.

It runs as regional tiers discovered through ServiceRouter, Meta’s service mesh, in two flavors: a pure proxy and a read-through cache.The engine is Meta’s thick C++ ZippyDB client, so ZGateway is effectively a ZippyDB client run as a managed service.

A client sends requests over a sticky connection to a regional ZGateway host, which terminates TLS, authorizes against the use case’s ACLs, applies per-tenant admission control and shaping, resolves the shard, checks the local cache on caching tiers, batches the request with other in-flight work for that shard, and forwards it to the correct replicas.

Responses are demultiplexed back with per-use-case metrics, traces, and quota usage recorded.TLS stays in the Thrift/ServiceRouter stack and replica selection stays in the embedded client.

The Fan-In and Fan-Out Math Meta models the fleet as balls thrown into bins: with B shards and H hosts, a host is hit with probability E(H,B)=H(1−e−B/h)E(H,B) = H\left(1 – e^{-B/h}\right).

With mock figures of 20 regions, 500,000 database hosts, 30,000 proxy hosts, 1,000,000 clients, and 50,000 shards per client, per-host connection counts collapse by roughly 97 to 98% and total persistent connections drop about 19x.

The deeper win is scaling: direct-access fan-in grows linearly with clients, while ZGateway fan-in reduces to roughly regions times shard density per host, independent of both fleets.

Capabilities That Followed Safe migration: Configuration flags scoped per service and shard prefix provide a percentage ramp, a region filter, and a global kill switch.

Discriminant Load Shedding (DLS): Requests map to per-tenant buckets split by priority that drain round-robin, so a flooding tenant only fills its own bucket.In a controlled overload above 90% CPU across roughly 1,350 tenant buckets, only 6 noisy neighbors shed load, the rest executed 99.

9% of requests with zero rejections, goodput held near 97 to 98%, and the machinery cost about 8% of CPU.Read caching: Cache tiers serve hot reads in-process, take a per-key fill lock on misses, and stay fresh via change-data-capture events under a bounded-staleness contract.

Load balancing: Tiers mix roughly 26-core to 126-core hosts, so a control-plane balancer nudges each host’s ServiceRouter weight opposite to its recent CPU load.Cross-region resilience: Global routing, mega-regions, and rings let a saturated regional tier fail over to healthy capacity nearby.

Transactions: Client-side bookkeeping moved into the gateway, consolidated in nine phases to 100% of transaction traffic with no reliability regression.window.addEventListener("message",function(e){if(e.data&&e.data.mtpZgHeight){var f=document.getElementById("mtp-zg-frame");if(f)f.style.height=e.

data.mtpZgHeight+"px";}}); Key Takeaways ZGateway handles over 1B ops/sec and carries about 40% of ZippyDB traffic at roughly 6% overhead.The proxy turns database fan-in from linear in client count into a bounded number Meta controls.

Cross-client batching and coalescing kill hot-key stampedes and retired fragile client libraries.DLS isolated 6 noisy tenants out of about 1,350 under 90%+ CPU with 97 to 98% goodput.Not deployable outside Meta; the value is in the patterns, not a package.

Check out the Meta Engineering blog post and the X announcement.All credit goes to the researcher of this project.Also, feel free to follow us on Twitter and don’t forget to join our 150k+ML SubReddit and Subscribe to our Newsletter.Wait!are you on telegram?now you can join us on telegram as well.

Need to partner with us for promoting your GitHub Repo OR Hugging Face Page OR Product Release OR Webinar etc.?Connect with us The post Meta Introduces ZGateway: A Stateless Proxy Tier That Unifies ZippyDB Traffic and Handles Over 1 Billion Operations Per Second appeared first on MarkTechPost.

Related

相關文章

“AI 教父”辛頓參與聯署公開信:科技巨頭應保證第三方評估人員工作無幹預、受保護

作者:清源 責編:清源 評論: 9 月 18 日消息,據《商業內幕》今天(18 日)晚間報道,由多家監督組織組成的 AI 評估機構論壇發佈了一封公開信,為第三方風險評估劃出一套最低條件,認為 Anthropic 和 OpenAI 等 AI 實驗室只有滿足特定的要求,才能與外部評估機構開展更有效的合作。

3 小時前

加州一縣擬議新政:用機器人替代人力的企業,應提供同酬就業機會或遣散費、培訓費

作者:清源 責編:清源 評論: 9 月 18 日消息,據外媒 TechSpot 今天(18 日)傍晚報道,美國加州的聖馬特奧縣監事會本週通過了一套“首創性”機器人許可制度,針對使用自主 AI 控制機器人的企業建立監管框架。該條例由縣監事雷 · 穆勒提出,不僅針對鋰電池起火等機器人使用過程中的潛在公共安全風險,更受關注的是如何處理機器人取代人工後對員工造成的影響。

6 小時前

Palantir CEO 卡普:美國前沿 AI 實驗室或在謀求“國有化”,以避開知識產權訴訟

作者:清源 責編:清源 評論: 9 月 18 日消息,Palantir CEO 亞歷克斯 · 卡普認為,Anthropic 呼籲政府加強 AI 監管,背後並不只是安全考量。當地時間 17 日,卡普接受 CNBC 採訪時指出,Anthropic 等前沿 AI 實驗室真正謀求的可能是國有化,從而獲得政府保護,應對未來因涉嫌竊取知識產權而可能面臨的大量訴訟。

8 小時前

智能眼鏡疑似被用來實施性騷擾行為,巴黎檢方展開刑事調查

作者:清源 責編:清源 評論: 9 月 18 日消息,據路透社今天(18 日)下午報道,針對疑似利用智能眼鏡實施性騷擾的行為,巴黎檢方展開了刑事調查,法國數據保護機構也收到企業投訴,多個國家開始重新審視這類設備帶來的隱私和安全問題。Meta 與依視路陸遜梯卡合作推出的 AI 智能眼鏡內置小型攝像頭,佩戴者可以在不易引起他人注意的情況下拍攝。

9 小時前