Skip to content
AnswerWell geo Documentation

Research · 7 min read · Answerwell

Virtual Waiting Room: Peak Traffic Queue, Thresholds, and Sessions

How edge waiting rooms queue visitors when traffic hits capacity limits, with thresholds, cookies, FIFO, and Cloudflare setup.

This page summarises Cloudflare documentation on Cloudflare Waiting Room: a virtual queue at the CDN edge that holds visitors when traffic nears limits you define, so the origin stays up and users see estimated wait times instead of errors.

Waiting Room queues visitors when your traffic approaches a previously defined threshold that might otherwise bring an application down.

— Cloudflare, About Waiting Room

Use a waiting room when a specific hostname or path expects surges—product drops, ticket sales, registration windows— and you want to cap simultaneous users and admission rate without overwhelming the origin. Cloudflare Waiting Room routes excess visitors to a branded holding page, keeps the application online, and shows wait estimates that refresh as slots open.

Availability is limited by plan: Business and Enterprise (plus Project Fair Shot qualified customers). Prerequisites include proxied DNS or a proxied load balancer for the hostname, CDN on the zone, and browsers that accept cookies. See Prerequisites and Plans.

Edge Workers and thresholds at the data center

Section titled “Edge Workers and thresholds at the data center”

Waiting Room runs on Workers in the nearest data center. Each request to a covered host/path hits a Waiting Room Worker, which chooses queue or origin using admin-defined thresholds and Waiting Room state (a traffic snapshot updated globally every few seconds via Durable Objects).

The two main threshold settings are:

Setting Meaning
Total active users Target cap on simultaneous active sessions on covered URLs.
New users per minute Target cap on how many new users per minute may enter the host/path (not “users added per minute”; it is an allowance threshold, ≤ total active users).

A user counts as active for session duration minutes after a request to any covered URL. Sharp spikes in either measure can trigger queueing. Because decisions are per data center with globally synced state, limits are targets—queueing can start slightly before or after configured numbers. See Queueing activation and Monitor waiting room status.

Visitor flow: FIFO, refresh, and session re-entry

Section titled “Visitor flow: FIFO, refresh, and session re-entry”

Once a room is active for a page:

If a page is not experiencing heavy traffic, a visitor accesses the page directly.

If page traffic approaches a user-defined threshold, a visitor enters a virtual waiting room until it is their turn to access the page.

— Cloudflare, About Waiting Room

In the default First In, First Out (FIFO) method, each visitor gets a cookie for ordered release. While queueing, the browser auto-refreshes about every 20 seconds for updated wait time. After admission, session duration lets them leave and return without re-queueing for that window. Dynamic inflow and outflow keep estimates closer to reality. Details: User flow, Queueing method.

__cfwaitingroom cookie: queue position and re-entry

Section titled “__cfwaitingroom cookie: queue position and re-entry”

The __cfwaitingroom cookie is required while queueing is active; visitors without cookies cannot access a protected host/path during an active queue.

The __cfwaitingroom cookie is only used to track visitors that access a waiting room enabled host and path combination for a zone. Visitors using a browser that does not accept cookies cannot visit the host and path combination while the waiting room is active.

— Cloudflare, Cloudflare Cookies

It tracks queue order, time on the application, and re-entry within session_duration. While in the queue, cookie expiry is five minutes but renews on each ~20s refresh. On the origin, expiry follows session_duration. Custom names use cookie_suffix (required when using additional_routes). See Waiting Room cookies and Configuration settings.

Configuration settings: hostname, path, and capacity

Section titled “Configuration settings: hostname, path, and capacity”

Key dashboard/API fields from Configuration settings:

Setting API parameter Notes
Hostname host Required; no http:// prefix.
Path path Case-sensitive; applies to all subpaths; no wildcards or query strings in the path rule.
Total active users total_active_users Required; must be > 200.
New users per minute new_users_per_minute Required; > 200 and ≤ total active users.
Session duration session_duration 1–30 minutes (default 5); sliding window while user keeps requesting covered URLs.

When specifying the Total active users in your configuration settings, set the value to 75% of your origin’s traffic capacity.

— Cloudflare, Best practices

Set new users per minute at roughly 100% of expected peak so queueing happens only when necessary (Configuration settings). If you run multiple rooms, the most specific subpath wins (Best practices, Place a waiting room).

Session duration and disable session renewal

Section titled “Session duration and disable session renewal”

Session duration avoids double-queueing within a transaction and enables dynamic outflow as inactive sessions expire (Configuration settings). Each request to a covered URL resets the active window (Control user session settings).

Disable session renewal (Enterprise advanced) caps browsing to one session period; when it ends during active queueing, the user goes to the back of the queue (Control user session settings).

Control waiting room traffic: Enabled, Queue-all, and queueing method

Section titled “Control waiting room traffic: Enabled, Queue-all, and queueing method”

From Control waiting room traffic:

  • Enabled On — Room is active; queueing starts when thresholds are approached (unless Queue-all overrides).
  • Queue-all On — Emergency or pre-event mode: all new visitors queue; no new visitors reach the origin until Queue-all is off. Active users already on site stay until session expiry. Queue-all overrides other settings including events.

Queueing methods (FIFO default on Business; more options on Enterprise advanced) set exit order: FIFO by cookie timestamp, Random for equitable lotteries, Passthrough to admit all traffic (useful for analytics-only or event toggles), Reject to block until an event allows traffic (Queueing method). Changing method during active queueing can change displayed wait times (Best practices).

Advanced customers can use scheduled events to override thresholds, pre-queue before a start time, or shuffle pre-queue users at event start (up to five events per room).

Create and manage a waiting room: dashboard and API

Section titled “Create and manage a waiting room: dashboard and API”
  1. In the Cloudflare dashboard, open Waiting Room under Traffic > Waiting Room and select Create, or call POST zones/{zone_id}/waiting_rooms on the Waiting Room API base https://api.cloudflare.com/client/v4.

  2. Set hostname, path, total_active_users, new_users_per_minute, and optional Turnstile modes (Create a waiting room, Configuration settings).

  3. Customise the default or custom HTML template, or enable JSON response for mobile/API clients (json_response_enabled; Advanced plan). Preview via dashboard or POST .../waiting_rooms/preview (Customize a waiting room).

  4. Review and save; new rooms are enabled by default (Create a waiting room).

Status checks: GET zones/{zone_id}/waiting_rooms/{id}/status returns queueing or not_queueing (API commands, Monitor waiting room status). Dashboard status labels include Not queueing, Queueing, Disabled, and Queue-all (Monitor waiting room status).

JSON response for mobile and non-browser clients

Section titled “JSON response for mobile and non-browser clients”

Enable JSON Response, then request the protected URL with header Accept: application/json exactly (no extra types). Poll every refreshIntervalSeconds (typically 20) and forward the __cfwaitingroom cookie on every request—missing cookies treat the client as a new user at the queue tail (Get JSON response). Turnstile does not apply to JSON responses.

Custom pages, rules, and product interaction

Section titled “Custom pages, rules, and product interaction”

Customization: Default pages support many languages; Enterprise can edit HTML/CSS (keep wait-time template fragments if showing estimates) (Customize a waiting room). Host waiting-room assets outside covered paths so static files are not trapped in the queue.

Waiting Room Rules (Enterprise advanced): Bypass rules skip the queue for matching traffic (paths, IPs, geo, assets). Bypassed traffic is not counted as active; no queue features apply to it.

Order relative to other Cloudflare products: DDoS, WAF, Bot Management, and Page Rules run before Waiting Room; Workers run after (FAQ). Rate limiting rules must allow at least one request every 20 seconds for queue page refresh (FAQ, Get started).

Use Waiting Room Analytics (30 days retention) to tune total_active_users, new_users_per_minute, and session settings from time-in-queue and time-on-origin metrics.

  • Path mismatch — Paths are case-sensitive; /Black-Friday-Sale does not match /black-friday-sale (FAQ).
  • Subpath surprise — A room on /shop also covers all subpaths; scope intentionally (Best practices).
  • Editing thresholds during queueing — Only when necessary; changes shift estimated wait times (Best practices).
  • Bots in FIFO — Bots without persistent cookies clog minute buckets; use Bot Management and optional Turnstile infinite_queue (FAQ).
  • Metric lag — Dashboard/API active and queued counts are estimates ~20–50 seconds behind (Monitor waiting room status).
  • Spike overshoot — Global state sync can take ~two minutes on very fast spikes, so new users per minute may briefly exceed target (FAQ).

For load validation, run tests longer than 2–3 minutes and review analytics (Test a waiting room). Feature matrix: Plans.

  1. Confirm the hostname uses a proxied DNS record and open Traffic > Waiting Room in the dashboard to verify Enabled and review Status (Monitor waiting room status).

  2. Request a covered URL in a private window with cookies enabled; if thresholds are low or Queue-all is on, confirm the waiting room page or JSON (Accept: application/json) and ~20s refresh (Get JSON response).

  3. Call GET .../waiting_rooms/{id}/status with a token that has Waiting Rooms Read and confirm queueing vs not_queueing matches live behaviour (Monitor waiting room status).

  4. During a controlled load test, compare Total active users and Queued users in Waiting Room Analytics to your total_active_users and new_users_per_minute settings (Test a waiting room).

  5. You can check automatically in Answerwell (our tool): https://answerwell.org/workspace

If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact passage you are asking about.