How switching from a shared connection to many cut frontier-model uploads and their global replication from days to minutes.
by Tian Ouyang, James Scott and Cindy Zou
Databricks Unity Gateway provides capacity for frontier LLMs such as Kimi, GLM, and Qwen, hosted our own inference services and GPUs. We operate at a massive scale, serving more than 125T tokens per year across all our models.
To make new frontier models available on day zero, the weights have to be uploaded and replicated to all regions within a few hours of release. As models grew past a terabyte, this has become increasingly challenging: a 600 GB model took more than 12 hours to upload and up to three days to reach every region, and the 1.56 TB Kimi-K3 was effectively too large to ship.
The bottleneck was not the network. It was that our HTTP/2 client multiplexed all concurrent transfers onto a single connection, whose shared flow-control window capped throughput no matter how much bandwidth was free. We fixed it by giving each transfer its own connection and window, first by switching the client to HTTP/1.1, and by replicating a model's files in parallel. Throughput rose from about 15 MB/s to about 800 MB/s: Kimi-K3 now uploads in about 32 minutes and reaches every region in a few hours.
A model goes through three stages before it serves traffic. First, upload: the weights are copied once into a central "leader" region of the Artifact Registry. Second, replication: the registry copies the model out to every serving region. Third, runtime download: when a serving node starts, it pulls the model and loads it to begin answering requests.
We had previously invested heavily in making the runtime download fast, using our image-acceleration technology and optimized "fast puller" (link: How Superhuman and Databricks built a 200K QPS inference platform together). This post is about the first two stages, the upload and the replication.
The problem grew with the model size. Kimi-K2.7 (600 GB) took more than 12 hours to upload. Replicating it to every region took about 3 days, because these long-running cross-region transfers dropped from time to time and had to restart. Kimi-K3 (1.56 TB) was projected roughly a day to upload and a week to replicate worldwide on the old path.
Those durations limited the pace at which the Unity Gateway team could ship. A model can't serve traffic in a region until it has been uploaded and replicated there, so this pipeline sits on the critical path of every launch and every update. When it takes days and can fail partway through, ordinary work like validating a new checkpoint, shipping a fix, or rolling out a new version turns into a multi-day operation someone has to watch. At Kimi-K3's size it was effectively unusable, and because each new frontier model is larger than the last, compounding the problem with every release.
Upload ran at about 15 MB/s, far below the network bandwidth limit. Using AI agents, we benchmarked each stage of the pipeline, ran experiments, and compared the results to find the bottleneck.
We started with the cross-region network and found ample headroom. Next, we tested the object storage on the receiving end; it could accept data much faster than we were sending it. Then we checked CPU, memory, and local disk. They were all far from saturated, and upload stayed at about 15 MB/s.
The clue was that running more transfers in parallel over HTTP/2 didn't help. Throughput stayed flat at about 15 MB/s no matter how many we ran at once. So we measured throughput per connection and tried switching the client to HTTP/1.1, which unexpectedly sent throughput into the hundreds of MB/s. A single connection topped out at about 17–18 MB/s, but spreading the transfers across separate connections scaled almost linearly, past 200 MB/s. The limit wasn't the number of transfers, but that they were all sharing one connection.
Replication had its own bottleneck on top of the connection limit. Each model was replicated by a single job that copied its files one at a time, utilizing one shared connection. For Kimi-K3, over a hundred large files had to be copied sequentially. Held to the single-connection rate, and with transient errors occasionally resetting a file, this would have taken days to complete.
Both upload and replication used HTTP/2. HTTP/2 is designed to carry many concurrent requests over a single reused connection, which is the right choice for the many small requests a web page makes. But a single connection has one flow-control window (a limit on how much data can be in flight before the receiver acknowledges it), and over long cross-region round trips that window, not the network, sets the ceiling. So every transfer, both the pusher's parallel uploads and the replication job's file copies, ran over one connection and was capped by its window; adding more transfers added no capacity.
Once we knew the shared connection was the ceiling, the fix was simple: give each transfer its own connection instead of sharing one enforced by HTTP/2. HTTP/1.1, unlike HTTP/2, does not enforce multiplexing, so the client uses separate connections with their own flow-control windows for concurrent transfers. We switched our client to HTTP/1.1, and throughput jumped into the hundreds of MB/s.
We also implemented a worker pool for cross-region replication. Each worker copies a file independently, over its own connection, so a model's files are copied in parallel.
Other changes that helped:
Together, these changes raised throughput from about 15 MB/s to about 800 MB/s and removed the retries and mid-transfer failures.
The results are dramatic: upload is about 50x faster and replication about 20x, across models from hundreds of gigabytes to over a terabyte. The pipeline also became far more reliable, as the connection resets and retries that used to stretch a run out over days are gone.
| Model | Size | Upload | Replication | | | | | |---|---|---|---|---|---|---|---| | | | Before | After | Improvement | Before1 | After | Improvement | | Kimi-K2.7 | 600 GB | ~12h | 14m | ~98% (~50x) | 8h52m / ~3 days | 26m / 70m | ~95% (~20x) | | Kimi-K3 | 1.56 TB | ~30h | 32m | ~98% (~55x) | ~27h / ~7 days (est.) | ~1.5h / 3h | ~95% (~18x) |
Replication "X / Y": X for one region, Y to reach all regions (some require multiple hops).
Upload throughput was improved from about 15 MB/s to 600–800 MB/s, and replication from 18 MB/s to 340–420 MB/s. Kimi-K3 (1.56 TB), which we projected would take about a day to upload and a week to replicate everywhere, now uploads in 32 minutes and reaches all regions in about 3 hours. A new model can now be in production worldwide the same day.
Even though the throughput has been significantly improved, it's still well below the network bandwidth available. The remaining ceiling is structural: an OCI registry is content-addressed (every object is identified by the digest of its bytes), so each object's bytes must pass through the registry server sequentially for it to compute that digest. The registry sits in the data path, and adding more connections can't move it out of the way. The further improvements being considered are:
We're always looking for engineers who enjoy tackling gnarly performance and distributed systems challenges. If problems like these excite you, we'd love to hear from you, please check out open roles at databricks.com/careers!
Learn more about serving models on Databricks Mosaic AI Model Serving and Unity Gateway. (link)
Subscribe to our blog and get the latest posts delivered to your inbox.
原文来源:databricks.com