每天,在 GitHub 上,数百万开发者构建着客户赖以生存的产品,贡献于开源项目,并追求个人项目。多年来,GitHub 的架构不断演变,以支持这些工作以及依赖它的开发者和组织日益增长的需求。
智能体驱动的软件开发正在推动下一次架构变革。随着开发者和智能体在每天接收数十亿次提交的仓库中协同工作,这些工作负载需要一种不同的 Git 架构。我们正在重建 GitHub 的 Git 基础设施以支持它们。本文探讨了塑造这一工作的需求及其背后的设计原则。
当前最高容量的工作负载展示了我们构建的目标规模。典型仓库与最繁忙仓库之间的差距比大多数人预期的要宽得多。以下是 2026 年 8 月 GitHub 上仓库活动分布的大致情况:
在分布的最远端,仓库活动急剧攀升。GitHub 上最繁忙的仓库在 8 月份经历了大约十亿次请求。
除了这些最高容量的工作负载之外,GitHub 上的 Git 总活动量也在迅速增长:2025 年 9 月至 2026 年 8 月期间,其规模增至之前的两倍以上,从每月 2182 亿次事件增加到 4733 亿次。
仅在 9 月份,开发者和智能体就在 GitHub 上提交了 73.8 亿次 commit,是去年同期的五倍多。
处于这一曲线顶端的仓库展示了前沿智能体开发的样貌:大型工程团队在繁忙的 CI 管道旁运行着不断扩大的智能体舰队。支持这些团队意味着构建能够以少数仓库目前所达到的规模进行持续、并发读取和写入的 Git 基础设施。我们正在深入投资 Git 基础设施,以满足智能体软件开发的需求,并为团队提供为其最雄心勃勃的工作负载而构建的基础。
为这种规模构建意味着要解决几个架构挑战:
每个智能体的 commit 周转时间成为瓶颈。在紧密循环中的智能体几乎在每个操作后都会提交或检查点。其速度受限于单次 push 完成的快慢,因此人类永远不会注意到的延迟成为了限制因素。
写入吞吐量需求呈数量级增长。push 量同比增长了 4.9 倍,从每月 6.9 亿次增加到 33.5 亿次。数千个智能体在一个仓库中各自在自己的分支上工作,产生了一个持续写入速率,该速率汇聚到我们架构中的单个点。
合并操作在单一引用上竞争。基于主干的开发、发布列车和合并队列将所有这些工作引导至一个必须吸收每次合并的单一 ref。GitHub 上的 pull request 合并量已增长到一年前的近 4 倍。
每次 push 都会衍生出数千次读取。例如,CI 和代码扫描每分钟克隆或获取同一分支尖端数千次,而这种扇出成本必须低廉。仅 GitHub Actions 在 9 月份就运行了 32.6 亿次,是去年同期的 4 倍多。
对仓库的操作必须继续保持快速。为了保持其速度,我们不断压缩仓库数据并清理不再需要的对象。每次新写入都增加了这项工作,且随着体积攀升,成本会累积叠加。
这就是为什么快速克隆只能解决部分问题。读取相对容易扩展:增加缓存、增加副本,并向更多客户端提供相同的字节。扩展读取至关重要,但这些工作负载需要更多。写入要困难得多。每次 push 都必须持久存储,并在下一个智能体或 CI 作业能够在其基础上构建之前保持一致地可见。
当前架构如何应对新需求
当前的架构多年来一直为开发者提供了良好的服务。每个存储库都由 Spokes 存储,它在几台文件服务器的本地磁盘上保留完整副本,默认情况下为五个。这些快速的本地磁盘让 Git 操作能够以低延迟读取原生存储库数据,而额外的副本则提供冗余,并将读取负载分散到多台文件服务器上。当推送更新引用时,三阶段提交协议利用法定人数确保 CI、Web UI 和 API 客户端看到一致的存储库状态。这种配对目前服务于十亿个存储库。
然而,我们用于持久性的机制与我们用于扩展的机制是相同的。磁盘上的副本是事实来源,因此增加读取容量意味着增加另一个持久的副本。每个副本都参与每次写入,因此推送的速度仅取决于其集合中最慢的副本。总体效果是:增加副本以吸收读取负载会使写入变慢。
对于大多数存储库来说,这种权衡效果良好。在最高活动水平下,它成为一个瓶颈:增加读取副本会增加写入开销,丢失一个副本会减少读取容量,而丢失法定人数则完全停止写入。为了满足以智能体为首的需求,我们需要在不丧失团队今天所依赖的功能的前提下,将持久性与扩展性分离开来。
为最繁忙的场景构建,惠及所有人
我们在 GitHub 持续运行的同时重建基础设施。不存在世界代码停止流动的任何维护窗口,也不存在要求人们在我们要进行此项工作时改变其软件开发方式的工作版本。
我们是为 GitHub 上最具挑战性的工作负载而构建的:一个在严格监管要求下交付的企业,一个跨存储库部署更改以构建操作系统的团队,以及针对单个代码库运行数千个智能体的组织。为这种规模进行工程化建设提高了所有人的基准线。跨越时区审查贡献内容的维护者以及提交第一个拉取请求的学生,都将获得同样更快、更具弹性的基础架构。
新架构还必须保留团队已经运行的控制措施。维护者需要分支保护和强制审核,以确保未经审核的更改永远不会到达默认分支。安全团队需要审计日志和存储库可见性来调查可疑的访问事件。值班工程师需要可靠的自动化和足够的可观测性,以了解部署失败的原因。
为了让平台在扩展以应对最繁忙的工作负载的同时继续服务于这里的每个人,这些是我们的指导原则:
建立在开发者已经信任的工作流之上。团队依赖分支、审核、合并和历史记录等工作流来大规模地构建、交付和管理软件。我们的新基础设施旨在支持相同的工作流,同时处理高得多的活动量。
将可靠性放在首位。我们将每个决策与开发者和组织所需的可靠性进行衡量。对平台的信心使得工程组织能够构建自动化、按计划交付、满足合规义务并理解其生产的软件。这项工作将实质性地提高吞吐量和扩展能力,而这些收益将扩展已有的信任基础。
让人掌控自己的代码。如果系统不能帮助使用它的人和组织,并且不在他们的控制之下,那么它就值得去构建。随着智能体承担更多工作,拥有代码的人仍然可以审核、理解和批准它。
方法
我们正在构建一种新的 GitHub 架构,能够以更高效的方式实现扩展。我们的方法围绕核心分布式系统设计原则展开,并将其应用于代理式软件开发(agentic software development)的并发性和规模挑战中。我们的目标是继续推动全球开源社区和企业向前发展,这些社区和企业已基于 Git 和 GitHub 构建了他们的项目,同时保留并调整围绕其的功能与控制机制,以适应代理时代的新需求。
减少协调
接收大量推送的存储库必须快速接受并发布更新。协调在保护正确性时是有价值的,但过多的协调会限制写入吞吐量,并使繁忙的存储库成为瓶颈。我们当前的架构在某些地方耦合过紧,这限制了我们在不进行艰难权衡的情况下扩展读取和写入的能力。我们正在重新设计系统,以保留 Git 语义所需的协调,并让其他一切独立进行。
仅对需要达成一致的部分进行协调。推送中真正需要达成一致的是引用更新本身。存储底层对象、验证对象连接性以及秘密扫描等工作量更大,但其中大部分可以与其他写入操作并行发生。这将推送的关键路径缩小到需要协调的小步骤,因此其余工作不再延迟确认。
将维护移出服务路径。压缩和垃圾回收是存储库执行的最繁重的工作之一,而在当前架构中,它们在响应实时 Git 请求的同一主机上运行。在新架构中,单独的工人直接针对持久化存储处理维护工作。繁忙的存储库可以在后台持续优化,而不会减慢推送和拉取的速度。
将存储与计算解耦
目前,本地磁盘上的完整存储库副本既作为持久化存储,又作为响应 Git 请求的层。将两者分离使我们能够独立扩展每一层。
在不增加持久化副本的情况下扩展读取能力。在新架构中,读取容量来自缓存数据以响应请求的轻量级工人。存储库的权威副本位于下方的持久化存储层中。这样,平台可以吸收来自 CI 扇出、代理集群以及大规模克隆的大量读取峰值,而无需为每次推送增加工作负担。
让每一层只做一件事。权威的存储库数据存储在 Azure Blob Storage 中,它已在 Azure 规模上提供了持久化和复制能力。计算层针对最低延迟下的吞吐量进行了优化。
从故障中更快恢复。当存储和计算耦合时,丢失主机将同时降低容量和持久性,而恢复意味着重建完整的存储库副本。当它们分离时,丢失计算工人更接近于缓存未命中:替换的工人可以立即开始响应请求,并随着流量到达从持久化存储填充其缓存。
将容量与需求相匹配。可以根据流量的变化添加或移除计算工人,而不是提前为峰值负载进行配置。经历活动激增(如发布或新的代理集群上线)的存储库可以获得额外的容量以应对突发情况。一旦高峰过去,这些容量便会释放。
综上所述,这些原则使我们能够在不放弃用户所需的可靠性和控制机制的情况下,支持更高的吞吐量和更多的并发工作。
接下来是什么
我们正在构建一种旨在提供最高吞吐量和可靠性的架构。读取和写入独立扩展,系统能够从故障中优雅恢复。在内部基准测试中,它实现了高达 35 倍的写入吞吐量提升,读取容量则能够根据需求自行扩展。
随着自动化开发提高了软件变更的频率和并发度,GitHub 将在不牺牲团队所依赖的治理和控制的前提下,演进其基础架构。我们已经在着手构建这一基础。在本系列的下一篇博文中,我们将深入探讨我们的未来架构以及促成这一目标的历程。
作者
Brian 是一名首席软件工程师,负责开发支撑 GitHub 上所有仓库交互的存储和核心服务。
Every day on GitHub, millions of developers build the products their customers rely on, contribute to open source, and pursue personal projects. GitHub’s architecture has changed steadily over the years to support that work and the growing demands of the developers and organizations who depend on it.
Agentic software development is driving the next architectural shift. With developers and agents working concurrently in repositories that receive millions of commits a day, these workloads demand a different Git architecture. We’re rebuilding GitHub’s Git infrastructure to support them. This post explores the demands shaping that work and the design principles behind it.
Today’s highest-volume workloads show the scale we’re building for. The gap between a typical repository and the busiest ones is wider than most people expect. Here’s a rough picture of the monthly repository activity distribution on GitHub from August 2026:
Repository activity climbs sharply at the far end of the distribution. The busiest repository on GitHub saw roughly a billion requests in August.
Beyond these highest-volume workloads, total Git activity on GitHub is also growing rapidly: between September 2025 and August 2026, it increased to more than 2x its previous level, from 218.2 billion events per month to 473.3 billion.
In September alone, developers and agents made 7.38 billion commits on GitHub, more than five times as many as a year earlier.
The repositories at the top of this curve show what agentic development looks like at its leading edge: large engineering teams running busy CI pipelines alongside growing fleets of agents. Supporting these teams means building Git infrastructure for sustained, concurrent reads and writes at a scale few repositories reach today. We’re investing deeply in Git infrastructure to meet the demands of agentic software development and give teams a foundation built for their most ambitious workloads.
Building for this scale means addressing several architectural challenges:
Commit turnaround becomes a bottleneck per agent. An agent in a tight loop commits or checkpoints after nearly every action. Its speed is bounded by how fast a single push completes, so latency that a human would never notice becomes the limiting factor.
Write throughput demand is increasing by orders of magnitude. Pushes grew 4.9x year over year, from 0.69 billion to 3.35 billion per month. Thousands of agents working on their own branches in one repository produce a sustained write rate that converges on a single point in our architecture.
Merges contend on one reference. Trunk-based development, release trains, and merge queues funnel all that work onto a single ref that has to absorb every merge. Pull request merges on GitHub grew to nearly 4x their volume a year ago.
Each push multiplies into thousands of reads. For example, CI and code scanning clone or fetch the same branch tip thousands of times per minute, and that fan-out has to be cheap. GitHub Actions alone ran 3.26 billion times in September, more than 4x as many as a year ago.
Operations on a repository must continue to be fast. To keep them fast, we continually compact repository data and clean up objects that are no longer needed. Every new write adds to that work, and the cost compounds as volume climbs.
This is why fast clones only solve part of the problem. Reads are relatively easy to scale: add caches, add replicas, and serve the same bytes to more clients. Scaling reads is essential, but these workloads require more than that. Writes are way harder. Every push has to be stored durably and made visible consistently before the next agent or CI job can build on it.
Where today’s architecture meets new demands
The current architecture has served developers well for years. Every repository is stored by Spokes , which keeps a full copy on the local disks of several fileservers, five by default. Those fast local disks let Git operations read native repository data with low latency, and the extra copies provide redundancy while spreading reads across fileservers. When a push updates a reference, a three-phase commit protocol uses a quorum to ensure that CI, the web UI, and API clients see a consistent repository state. That pairing serves a billion repositories today.
However, the mechanism we use for durability is the same one we use for scale. The copies on disk are the source of truth, so adding read capacity means adding another durable replica. Every replica participates in every write, so a push is only as fast as the slowest replica in its set. The net effect: adding replicas to absorb read load makes writes slower.
For most repositories, this tradeoff works well. At the highest activity levels, it becomes a ceiling: adding read replicas adds overhead to writes, losing a replica reduces read capacity, and losing quorum stops writes entirely. To meet agent-first demands, we need to separate durability from scale without losing what teams rely on today.
Built for the busiest, better for everyone
We’re rebuilding the infrastructure while GitHub keeps running. There’s no maintenance window where the world’s code stops moving, and no version of this work where we ask people to change how they build software while we do it.
We’re building for the most demanding workloads on GitHub: an enterprise shipping under strict regulatory requirements, a team landing a change across a repo that builds an operating system, and an organization running thousands of agents against a single codebase. Engineering for that scale raises the floor for everyone. The maintainer reviewing contributions from volunteers across time zones and the student opening their first pull request get the same faster, more resilient foundation.
The new architecture also must preserve the controls teams already operate on. A maintainer needs branch protections and required reviews so an unreviewed change never reaches the default branch. A security team needs audit logs and repository visibility to investigate a suspicious access event. An on-call engineer needs dependable automation and enough observability to understand why a deployment failed.
For the platform to keep serving everyone here while it scales for the busiest workloads, these are our guiding principles:
Build on the workflows developers already trust. Teams rely on workflows like branching, review, merge, and history to build, ship, and govern software at scale. Our new infrastructure is designed to support those same workflows at much higher volumes of activity.
Put reliability first. We measure every decision against the reliability that developers and organizations require. Confidence in the platform is what lets an engineering organization build automation, ship on a schedule, meet compliance obligations, and understand the software it produces. This work will meaningfully improve throughput and scale, and those gains extend a foundation of trust that’s already there.
Keep people in control of their code. If the system isn’t helping the people and organizations who use it, and isn’t under their control, it isn’t worth building. As agents take on more of the work, the people who own the code can still review, understand, and approve it.
The approach
We are building a new GitHub architecture that can scale much more effectively. Our approach centers around core distributed systems design tenets, applied to the concurrency and scale of agentic software development. Our goal is to continue the forward momentum for open-source communities and enterprises around the world who have built their projects with Git and GitHub, while preserving and adapting the features and controls around it to meet the new needs of the agentic era.
Minimize coordination
A repository that receives many pushes must accept and publish updates quickly. Coordination is valuable when it protects correctness, but too much of it limits write throughput and can turn a busy repository into a bottleneck. Our current architecture is tightly coupled in places it doesn’t need to be, which limits our ability to scale across reads and writes without tough trade-offs. We’re redesigning the system to preserve the coordination that Git semantics require and let everything else proceed independently.
Coordinate only what needs agreement. The part of a push that truly needs agreement is the reference update itself. Storing the underlying objects, validating object connectivity, and secret scanning are much more work, but most of it can happen in parallel to other writes. That shrinks the critical path of a push to the small step that needs coordination, so the rest of the work no longer delays the acknowledgment.
Move maintenance off the serving path. Compaction and garbage collection are among the heaviest work a repository does, and today they run on the same hosts that answer live Git requests. In the new architecture, separate workers handle maintenance directly against durable storage. A busy repository can be optimized continuously in the background without slowing pushes and fetches.
Decouple storage from compute
Today, complete repository copies on local disks serve both as durable storage and as the layer that answers Git requests. Separating the two lets us scale each one independently.
Scale reads without adding durable copies. In the new architecture, read capacity comes from lightweight workers that cache data to serve requests. The authoritative copy of the repository lives in a durable storage layer underneath. That way, the platform can absorb large read spikes from CI fan-out, agent fleets, and large clones without adding work to every push.
Let each layer do one job. Authoritative repository data lives in Azure Blob Storage, which already provides durability and replication at Azure scale. The compute layer is optimized for throughput at the lowest latency.
Recover faster from failures. When storage and compute are coupled, losing a host reduces both capacity and durability, and recovery means rebuilding a full repository copy. When they’re separate, losing a compute worker is closer to a cache miss: a replacement worker can start serving requests right away and fill its cache from durable storage as traffic arrives.
Match capacity to demand. Compute workers can be added or removed as traffic changes instead of provisioning for peak load in advance. A repository going through a burst of activity, like a release or a new agent fleet coming online, can get extra capacity for the burst. Once it passes, that capacity goes away.
Together, these tenets allow us to support higher throughput and more concurrent work without abandoning the reliability and controls that our users need.
What comes next
We’re building an architecture designed to provide the highest throughput and reliability available. Reads and writes scale independently, and the system recovers gracefully from failures. In internal benchmarks, it has delivered up to 35 times higher write throughput, with read capacity that scales on its own to meet demand.
As automated development increases the frequency and concurrency of software change, GitHub will evolve its foundations without trading away the governance and control that teams rely on. We’re already putting that foundation in place. In the next post in this series, we’ll dive deeper into our future architecture and the journey that led us there.
Written by
Brian is a Principal Software Engineer working on the storage and core services that power all repository interactions on GitHub.
首次收录 · 2026-10-07 · 9.91 分