How Waiting Room makes queueing decisions on Cloudflare's highly distributed network
Sep 20, 2023George Thomas

Summary
This post details the evolution of Cloudflare Waiting Room's queuing decision algorithm. It explains how the system now makes decisions at the worker level, distributing available slots based on historical traffic patterns ('trafficHistory') and active workers ('globalWorkersActive', 'dataCenterWorkersActive'). The algorithm aims to balance admitting users to the origin with queuing excess traffic, using configured limits ('total active users', 'new users per minute') and session duration to manage user sessions. The use of Durable Objects for state aggregation and encrypted cookies for tracking admitted users is also highlighted.
More from the Website Security & Threat Management trail
- We tested our own WAF with frontier AI models. Here’s what we found
- When scanners miss the attack: how Cloudflare Client-Side Security protects storefronts
- Introducing automatic remediation policies with Cloudflare CASB
- Introducing context-aware vulnerability discovery and remediation with Cloudflare Managed Defense and OpenAI Daybreak Models
- Introducing Adaptive Intelligence: undermining the economics of every bot attack