Menu
Datadog Blog·August 19, 2026

Scaling Git Serving: Datadog's Gitretriever Architecture for High CI Traffic

This article details how Datadog re-architected its Git serving infrastructure with 'gitretriever' to handle a 20x increase in CI traffic efficiently. It outlines the challenges faced with their previous setup, the design decisions for the new distributed system, and the technical implementation that significantly reduced latency and backend CPU usage while improving scalability and reliability.

Read original on Datadog Blog

The Challenge: Scaling Git Access for CI Workloads

Datadog's continuous integration (CI) infrastructure experienced rapid growth, leading to a 20x increase in Git traffic. The existing Git serving setup, which likely involved direct Git repository access or a simplistic proxy, struggled with this load. Key issues included high latency for Git operations (clones, fetches), increased CPU load on Git servers, and potential reliability problems during peak usage. This scenario is a classic example of performance bottlenecks emerging under scale and requiring a fundamental architectural shift.

Gitretriever: A Distributed Proxy and Cache for Git

To address the scaling issues, Datadog developed gitretriever, a distributed proxy and caching layer specifically designed for Git operations. This system acts as an intermediary between CI jobs and the actual Git servers (like GitHub Enterprise or GitLab), offloading significant traffic and computational burden. The core idea is to bring data closer to the consumers and optimize common Git operations, making them faster and more efficient.

  • Smart Caching: gitretriever caches Git objects and references, reducing repetitive fetches from upstream Git servers. This is crucial as many CI jobs often fetch the same or similar data.
  • Optimized Data Transfer: It uses optimized Git protocols and techniques, potentially serving packfiles directly or employing shallow clones where appropriate.
  • Distributed Design: Deployed as a fleet of instances across multiple availability zones, ensuring high availability and fault tolerance. This horizontal scaling capability is key to handling fluctuating traffic.
  • Traffic Shaping & Load Balancing: Distributes requests across its fleet and potentially throttles requests to upstream Git servers to prevent overload.

Key Architectural Components

ℹ️

System Design Principle: Locality of Reference

gitretriever leverages the principle of locality of reference by caching frequently accessed Git data. This reduces network latency and load on origin servers, a common strategy in CDN, database, and API gateway designs. When designing such systems, consider cache invalidation strategies, cache eviction policies, and consistency models.

The architecture likely involves several components working in tandem:

  • Frontend/Gateway: Handles incoming Git requests from CI runners and routes them.
  • Caching Layer: Stores Git repository data, possibly using a combination of in-memory caches, local disk caches, or distributed object storage.
  • Upstream Connector: Communicates with the authoritative Git servers (e.g., GitHub Enterprise) to fetch data not present in the cache.
  • Metrics & Monitoring: Essential for understanding performance, identifying bottlenecks, and ensuring the system operates reliably. Datadog's own monitoring tools would naturally play a significant role here.
GitCI/CDCachingProxyScalabilityDistributed SystemsInfrastructureGo

Comments

Loading comments...