Cloudflare has introduced a novel technique called “Shard and Conquer” that dramatically reduces cold starts in its serverless platform, Cloudflare Workers. By leveraging consistent hashing to intelligently route traffic within data centers, the company has reduced its cold start rate by a factor of 10, achieving a sustained warm request rate of 99.99% across all requests.
The innovation represents a significant evolution in serverless architecture, addressing one of the technology’s most persistent challenges: the latency penalty users experience when serverless functions must initialize from a cold state. As serverless platforms increasingly support larger, more complex applications, minimizing cold starts has become critical to maintaining competitive performance.
Platform Evolution Drives Need for Advanced Cold Start Mitigation
Cloudflare’s initial approach to cold start mitigation relied on pre-warming Workers during the TLS handshake, effectively hiding initialization time from end users. This technique performed adequately for simple applications but began failing as developers demanded support for increasingly sophisticated workloads.
In response to user requirements, Cloudflare relaxed several platform constraints: script size limits increased from 1MB to 10MB for paying customers, while startup CPU time expanded from 200ms to 400ms. These changes enabled richer application development but created an unintended consequence.
The accommodations for larger applications simultaneously lengthened Worker cold start duration, frequently exceeding the time required for modern TLS 1.3 handshakes. As a result, cold start latency could no longer be entirely concealed from users, necessitating a fundamentally different approach to minimize cold start frequency rather than duration.
The challenge reflects a broader tension in serverless computing. As one technical community observer noted, the serverless value proposition centers on simplicity: “Because attractiveness of Workers/Lambdas/Functions is whole ‘write simple amount of code and pay pennies to run it.’ Downside is cold starts, twisting yourself into knots you will do at scale to make them work, and vendor lock-in.”
Consistent Hashing Eliminates Redundant Cold Starts Across Data Centers
To address cold start frequency, Cloudflare adapted a technique from its own content delivery network: consistent hashing. The previous architecture allowed requests arriving at any server to trigger redundant cold starts, even when warm Worker instances already existed on nearby machines within the same data center.
This inefficiency particularly impacted low-volume Workers. These instances faced frequent eviction across multiple servers due to scattered, low-traffic patterns, resulting in high cold start rates despite aggregate traffic volumes that should have maintained warm instances.
The Shard and Conquer architecture implements a fundamentally different routing strategy. Each Worker’s script identifier maps onto a consistent hash ring shared across all servers within a data center. This mapping determines a single, primary “shard server” responsible for running that specific Worker instance.

All requests for a given Worker route to its designated shard server, keeping the instance warm indefinitely regardless of traffic distribution. This approach simultaneously reduces memory usage across the cluster by eliminating redundant Worker instances on multiple machines.
The technique represents an elegant solution to resource allocation in distributed systems. By concentrating instances rather than distributing them, Cloudflare transforms intermittent, scattered traffic into consistent utilization on designated servers, maintaining warm states that would otherwise expire.
Cap’n Proto RPC Enables Graceful Load Shedding Without Latency Penalty
A critical engineering challenge for sharding involves handling traffic spikes. Even with dedicated shard servers, individual Worker instances can become overwhelmed by sudden demand, requiring horizontal scaling to additional servers. The system must instantiate new Workers elsewhere without incurring the latency of pre-flight coordination checks.
Cloudflare achieved low-latency load shedding by integrating Cap’n Proto RPC, its cross-instance communication framework. The mechanism operates through several coordinated steps that elegantly manage overload scenarios.
First, the shard client—the server initially receiving a request—optimistically sends the complete request to the designated shard server. Critically, the client includes a Cap’n Proto capability within the request payload: a handle to a lazily-loaded local Worker instance.
If the shard server determines it cannot process additional requests due to overload, it returns the client’s own lazy capability rather than a simple error. The client’s RPC system recognizes this returned capability as local, immediately stopping request proxying to the remote server.
This recognition triggers what Cloudflare calls “short-circuiting the trombone”—the client serves the Worker locally via rapid cold start, having confirmed the shard server cannot handle the request. The approach achieves horizontal scaling for burst traffic without introducing additional round-trip latency for coordination.
The technique extends to complex invocation scenarios where Workers call other Workers through Service Bindings. The system serializes and passes entire invocation context stacks between shard servers, maintaining architectural coherence even for sophisticated application patterns.
Architectural Trade-offs Balance Performance Against Flexibility
The Shard and Conquer approach represents calculated trade-offs in distributed system design. By concentrating traffic onto designated servers, Cloudflare accepts potential load imbalance across its infrastructure in exchange for dramatically reduced cold start rates.
This design philosophy contrasts with traditional load-balancing approaches that distribute traffic as evenly as possible across available resources. The consistent hashing strategy intentionally creates “hot spots” for individual Workers, betting that the performance benefits of warm instances outweigh potential inefficiencies in resource utilization.
The architecture also demonstrates how serverless platforms increasingly borrow techniques from adjacent technologies. Consistent hashing has long been fundamental to content delivery networks and distributed caching systems. Cloudflare’s application of this concept to serverless routing shows the convergence of architectural patterns across cloud infrastructure domains.
For developers using Cloudflare Workers, the improvements arrive transparently without requiring code changes or configuration adjustments. The 99.99% warm request rate represents a significant enhancement to user experience, particularly for applications with variable or low-volume traffic patterns that previously suffered from frequent cold starts.
The achievement also highlights ongoing maturation in serverless computing. As platforms support increasingly complex applications, architectural innovations like Shard and Conquer become essential for maintaining the performance characteristics users expect from traditional, always-on infrastructure.
Looking forward, the technique may influence how other serverless providers approach cold start mitigation. The combination of consistent hashing for traffic concentration and capability-based load shedding offers a blueprint for balancing resource efficiency against performance optimization in distributed serverless architectures.