Source: https://speech.unidatum.com/rnd/serverless-cloudflare/  
All pages as markdown: https://speech.unidatum.com/llms.txt

# Serverless and Cloudflare for live speech

Can a CPU speech service (a Go front and Python workers, about 1 GB of models) run on Cloudflare's serverless products, and what changes when the audio is live instead of a file? Short answer: **serverless is a good fit for batch and for bursts, and a poor fit for the first caller of a live stream.** The design that works is an always-on base with serverless as the overflow.

- [measured] our own runs: solid lines and bars, data files linked
- [sourced] a price or fact read from a vendor page, with the page and date
- [modelled] theory or a what-if: **dashed lines, hatched bars, a dashed frame**, its assumptions listed under the chart and the model script linked
- [assumption] an input we chose, editable in the data

- Verdict
- What Cloudflare offers
- Cold start
- Real-time fit
- Cost model
- Base plus burst
- Scenarios
- Architecture
- Drawbacks
- Not yet measured
- Sources

## Verdict

### Live streaming

**Run it warm, not scale-to-zero.** Cloudflare Containers can carry the service, but only as many small always-on boxes: 4 vCPU at most, amd64 only, public beta, no autoscaling, two to three streams each, about $0.125 per busy stream-hour [estimate] against $0.040 on EC2 Graviton4 [measured] capacity and $0.288 on Deepgram [sourced].

### Batch

**A good fit.** A container job that wakes, drains a queue and sleeps costs about $0.65 per 1,000 audio minutes [estimate], against Deepgram's $4.30 [sourced]. A cold start does not matter for a file.

### The first caller

**"Slow first, then fine" is half true.** Once the service is up, the first session is as fast as any later one [measured]. But an idle instance goes back to sleep and repeats the whole start on the next wake-up: about 10 to 20 seconds for a Cloudflare container [estimate].

### Base plus burst

**The right shape.** An always-on base sized for the normal load, burst capacity warmed ahead of need and only given calls after it passes a test, live calls never moved, a hosted provider as the last overflow. It saves about 70% on spiky traffic against sizing for the peak [estimate], and EC2 spot is about five times cheaper than Cloudflare containers as the burst tier.

Any base plus overflow design beats sending everything to Deepgram from about 51,000 minutes a month [estimate]; a serverless or spot burst tier beyond Deepgram overflow starts to pay at about a million minutes a month. Below 50,000 minutes a month, a hosted provider alone is simpler and cheaper.

## What Cloudflare offers today

Everything here was read from Cloudflare's own pages on 2026-12-05 [sourced]; the date in brackets is each page's own *last modified* date. "Not found" means the page does not say.

| Item | What the documentation says | Source |
| --- | --- | --- |
| Status | Available on the Workers Paid plan; launched in beta in June 2025; the newer scheduling policy is "in public beta". No page read says generally available. | [containers](https://developers.cloudflare.com/containers/) (2026-12-03), [scheduling policy](https://developers.cloudflare.com/containers/configuration/scheduling-policy/) (2026-12-03) |
| Largest instance | **4 vCPU, 12 GiB, 20 GB disk** (standard-4); custom sizes allowed within the account limits (15,000 vCPU and 60 TiB memory in total; 50 GB of images). | [limits](https://developers.cloudflare.com/containers/platform/limits/) (2026-12-03) |
| CPU | "Containers should be built for the linux/amd64 architecture." No ARM. What a vCPU is, and its speed: not found. | [architecture](https://developers.cloudflare.com/containers/concepts/architecture/) (2026-12-03) |
| Cold start | "Can often be in the 1-3 second range, but this is dependent on image size and code execution time." With the newer policy, a benchmark of small sandboxes gave a median of 648 ms. | [faq](https://developers.cloudflare.com/containers/faq/) (2026-12-03), [blog](https://blog.cloudflare.com/faster-agent-sandboxes/) (2026-09-30) |
| Sleep | An inactivity timeout of up to 6 hours; without one the container stops shortly after its Durable Object goes idle; billing stops when it sleeps. An open WebSocket keeps the Durable Object active. | [API](https://developers.cloudflare.com/containers/api/durable-object-container/) (2026-12-03), [WebSocket example](https://developers.cloudflare.com/containers/examples/websocket/) (2026-12-03) |
| Autoscaling | "Not today", planned. Routing over a pool is the developer's job; `max_instances` defaults to 20. | [faq](https://developers.cloudflare.com/containers/faq/) (2026-12-03), [rollouts](https://developers.cloudflare.com/containers/configuration/rollouts/) (2026-12-03) |
| Placement | Chosen by Cloudflare from request routing, capacity and image availability. The Durable Object and its container "are not guaranteed to run in the same location". | [faq](https://developers.cloudflare.com/containers/faq/) (2026-12-03) |
| Price | CPU $0.000020 per vCPU-second, **billed on active use**; memory $0.0000025 per GiB-second and disk $0.00000007 per GB-second, billed on what is provisioned while the container runs; egress $0.025 per GB in North America and Europe (1 TB included). Some allowances are included on the Workers Paid plan. | [pricing](https://developers.cloudflare.com/containers/platform/pricing/) (2026-11-13) |
| GPU | Not found on any Containers page. | limits, pricing, faq (2026-11-13 to 2026-12-03) |

| Item | What the documentation says | Source |
| --- | --- | --- |
| Workers limits | 128 MB memory per isolate; CPU time per request 30 s by default, 5 minutes at most on the paid plan; no limit on how long a client stays connected. A 0.6-billion-parameter model (our final worker alone uses 1.4 GB) does not fit. | [limits](https://developers.cloudflare.com/workers/platform/limits/) (2026-11-25) |
| Workers price | $5 a month minimum; a WebSocket is one request, and messages routed through a Worker are not billed; no charge for duration. | [pricing](https://developers.cloudflare.com/workers/platform/pricing/) (2026-12-03) |
| Durable Objects | $12.50 per million GB-seconds after 400,000; a WebSocket accepted by an object is billed on its duration for as long as it is connected; hibernation stops billing only for objects that are WebSocket servers and idle. A proxy in front of a container cannot hibernate while streams are open. | [pricing](https://developers.cloudflare.com/durable-objects/platform/pricing/) (2026-11-13), [WebSockets](https://developers.cloudflare.com/durable-objects/best-practices/websockets/) (2026-11-18) |
| WebSocket idle timeout | Cloudflare closes a WebSocket with no data "for a period of time"; **no number is published**. The "100 seconds" often quoted comes from a forum post, not the documentation. A release of Cloudflare's network "may restart servers, which terminates WebSockets connections". | [websockets](https://developers.cloudflare.com/network/websockets/) (2026-08-14), [connection limits](https://developers.cloudflare.com/fundamentals/reference/connection-limits/) (2026-11-13) |
| Tunnel | "Available on all plans"; up to 25 replicas (100 connections) per tunnel, traffic to the closest replica. **No page states a price.** | [tunnel](https://developers.cloudflare.com/tunnel/) (2026-11-18), [configuration](https://developers.cloudflare.com/tunnel/configuration/) (2026-12-03) |
| Load Balancing | "Starting at $5/mo"; pools tried in order with a fallback pool; an unhealthy endpoint gets no new requests but existing WebSocket connections "are not terminated"; session affinity by cookie, cookie plus IP or header; monitors can match status code or a body substring (minimum interval 15 s on the limits page, 60 s on Pro on the monitor page: the two disagree). | [plans](https://www.cloudflare.com/plans/network-cdn.md), [health details](https://developers.cloudflare.com/load-balancing/understand-basics/health-details/) (2026-04-16), [planned maintenance](https://developers.cloudflare.com/load-balancing/additional-options/planned-maintenance/) (2026-07-23), [session affinity](https://developers.cloudflare.com/load-balancing/understand-basics/session-affinity/) (2026-11-04) |
| R2 | $0.015 per GB-month, egress free. Download speed into a container: not found; a mounted bucket is "not native SSD-like performance". Baking the models into the image is the safe choice. | [pricing](https://developers.cloudflare.com/r2/pricing/) (2026-10-30) |

| Item | What the documentation says | Source |
| --- | --- | --- |
| Speech to text | Whisper (three sizes), **Deepgram Nova-3** (REST $0.0052 and WebSocket $0.0092 per audio minute) and **Deepgram Flux** (WebSocket $0.0077). Deepgram's own streaming price for Nova-3 is $0.0048. Rate limit for speech recognition: 720 requests per minute. | [pricing](https://developers.cloudflare.com/workers-ai/platform/pricing/) (2026-11-18), [limits](https://developers.cloudflare.com/workers-ai/platform/limits/) (2026-09-17) |
| Text to speech | Deepgram Aura-1 and Aura-2 (English, Spanish) at the same price as Deepgram direct; MeloTTS is listed as deprecated from 2026-11-20. | [models](https://developers.cloudflare.com/workers-ai/models/) (2026-08-12) |
| Realtime, voice agents | The WebRTC SFU is $0.05 per GB of egress (first 1,000 GB free); RealtimeKit's transcription uses Deepgram Nova-3; the Agents voice SDK (beta) plugs in speech providers but offers no bring-your-own-model pipeline. None of it hosts our workers. | [SFU](https://developers.cloudflare.com/realtime/sfu/platform/pricing/) (2026-09-22), [RealtimeKit](https://developers.cloudflare.com/realtime/realtimekit/platform/pricing/) (2026-11-05), [voice](https://developers.cloudflare.com/agents/agent-class/communication-channels/voice/) (2026-11-21) |

## Cold start: where the time goes

We started the service from nothing on a spare set of cores and a separate port (never the running service), with the model files evicted from the operating system's cache so that they came from disk, and timed it [measured]. **Process start to ready took 8.0 to 8.7 seconds** (6.2 s with a warm cache). The service reports healthy only after every worker has loaded, so ready means "can take a stream". The critical path is the final worker loading Whisper small (5.2 s) and then Parakeet (2.6 s) one after the other; the streaming workers load in parallel in 3.9 s.

**Then the first stream was no slower than later ones:** first partial 0.90 to 0.91 seconds on the very first session and on the second. There is no warm-up inside the service.

On Cloudflare the container start (1 to 3 s from the documentation) and an image pull come first. Our image is about 2 GB; pulling it to a host that does not have it is not documented and was not measured, so the Cloudflare columns are an [estimate] of **10 to 20 seconds for the first caller** after an idle period.

*Chart: Cold start: seconds until the first caller can be served. Four local runs are measured (process start to ready). The two Cloudflare columns are estimates: the container start is from the docs, the image pull is not measured. The numbers are in the tables and in the data files under https://speech.unidatum.com/data/.*

*Chart: Cold-start timeline: models loaded against seconds since the caller arrived. Measured: the local service started from nothing with the files on disk. Dashed: the same loading after a Cloudflare container start and image pull (estimates). The numbers are in the tables and in the data files under https://speech.unidatum.com/data/.*

| event | seconds | models loaded of 7 | status |
| --- | --- | --- | --- |
| process start | 0 | 0 | [measured] |
| three fast workers loaded | 4.6 | 3 | [measured] |
| Whisper small loaded in both final workers | 6.1 | 5 | [measured] |
| Parakeet loaded in both final workers: ready | 8.7 | 7 | [measured] |

| run | status | container start s | image pull s | model load s | total s | first partial s |
| --- | --- | --- | --- | --- | --- | --- |
| local cold disk run 1 | [measured] | 0 | 0 | 8.7 | 8.7 | 0.91 |
| local cold disk run 2 | [measured] | 0 | 0 | 8 | 8 | 0.9 |
| local warm page cache run 1 | [measured] | 0 | 0 | 6.2 | 6.2 | 0.9 |
| local warm page cache run 2 | [measured] | 0 | 0 | 6.2 | 6.2 | 0.9 |
| Cloudflare container first caller (low) | [modelled] | 1 | 1 | 8 | 10 | 0.95 |
| Cloudflare container first caller (high) | [modelled] | 3 | 8 | 8.7 | 19.7 | 0.95 |

### Keeping warm, and what it costs

There is no "minimum instances" setting in the pages read. An instance stays awake while an open WebSocket keeps its Durable Object active, with an inactivity timeout of up to six hours, or with a periodic touch from a cron Worker. Because CPU is billed on active use only, an idle 4 vCPU / 8 GiB container costs only the provisioned memory and disk: **about $56 a month** (about $83 for the preset 12 GiB size) plus about $4 for the Durable Object that fronts it [estimate]. Caveat: the pricing page does not define "active"; if a container's whole running time were billed on its vCPUs, the always-warm fleet would cost about three times more. The first invoice of a test settles it.

## Real-time fit: size, routing, limits

| Question | Answer | Status |
| --- | --- | --- |
| Does our 24-core layout fit? | No. The reference layout is 24 worker processes (18 fast, 6 final) on 24 vCPUs and about 20 GB, carrying 28 streams cleanly on Graviton4 (first partial 1.0 s, final 1.1 s). A container is at most 4 vCPU, so the design becomes six containers of 3 fast and 1 final worker. Memory is not the limit (3.5 to 5 GB per container, 8 GiB is enough); cores are. | [measured] layout and capacity |
| Streams per container | Graviton4 carries 1.17 streams per vCPU at the knee, AMD c7a 0.83, Intel c7i 0.50. Cloudflare is amd64 only and does not say what its vCPU is, so a 4 vCPU container carries about 1.7 to 2.8 streams after our 0.85 derate: plan on 2. Six containers carry 10 to 17 streams, not 28. | [measured] on EC2, [estimate] for Cloudflare |
| Session affinity | A stream is one WebSocket that stays on one container for life (decoder state, voice-activity state, the open utterance). Affinity is by Durable Object id; the routing layer that picks a container for a new caller is ours to write. | [sourced] design |
| Burst of new callers | There is no autoscaling, and each new container pays the full cold start for two or three streams. The platform can start thousands of small containers quickly; our 2 GB image and model load are the slow part. | [estimate] |
| WebSocket limits and reconnects | No maximum duration is documented; the idle timeout is unpublished, so clients ping every 20 to 30 s. Connections are not durable (a release of the network can restart servers), and the service has no resume: clients keep a ring buffer and resend the last seconds after reconnecting. | [sourced] |
| Edge hop | The client reaches Cloudflare's edge in 21 to 59 ms here (TCP connect, three samples). The extra Worker, Durable Object and container legs are not measured; the object and container may be in different places. We estimate 10 to 60 ms each way, 20 to 120 ms in all, 2 to 13% of a 0.95 s first partial. | [measured] to the edge, [estimate] beyond |
| Long connections against batch | Live: a Worker bills no duration; the Durable Object in front of a container is a fixed few dollars a month, shared by its streams; memory and disk are billed all the time the container is awake, CPU only for the audio decoded. Batch: the container is awake only while it works. | [sourced] prices |

### Streams per instance, capacity curves and latency

Measured on EC2 (the left chart's first three bars and the capacity curves), against an assumed Cloudflare container. A server is full at the knee, where the lag of the finals starts to climb; the planning value keeps 15% back.

*Chart: Live streams carried by 4 vCPUs. Measured streams per vCPU at the knee on EC2, times four, and the planning value after the 0.85 derate. The Cloudflare container is an assumption: its vCPU is not documented. The numbers are in the tables and in the data files under https://speech.unidatum.com/data/.*

*Chart: Streams per server, measured on EC2. p90 lag of each final behind the speech it covers, against simultaneous English streams, on 24 vCPUs (c8g, c7a) or 12 (c7i); a fresh service for every point. The numbers are in the tables and in the data files under https://speech.unidatum.com/data/.*

*Chart: Final lag against load. Median lag of each final behind the speech it covers, with the band up to the maximum. Each stream plays 60 s of real-time speech. The numbers are in the tables and in the data files under https://speech.unidatum.com/data/.*

*Chart: Latency of one live stream. Medians over 25 clips (20 on the Mac), endpointing 300 ms. The final includes the 0.3 s of silence that ends the utterance. The numbers are in the tables and in the data files under https://speech.unidatum.com/data/.*

*Chart: Time to first partial: direct against through the Cloudflare edge. The service's measured 0.95 s, plus the extra network legs of a Cloudflare route (estimate: 10 to 60 ms each way). The numbers are in the tables and in the data files under https://speech.unidatum.com/data/.*

| path | status | service first partial s | extra path s | total s | note |
| --- | --- | --- | --- | --- | --- |
| direct to the service | [measured] | 0.95 | 0 | 0.95 | median first partial after speech starts |
| through the Cloudflare edge: low | [modelled] | 0.95 | 0.02 | 0.97 | 10 ms each way |
| through the Cloudflare edge: high | [modelled] | 0.95 | 0.12 | 1.07 | 60 ms each way |

## Cost model

The model is `docs/data/costs.py` with the prices and assumptions in `docs/data/costs.csv`; every row carries its status, source and the date it was read (table at the end of this section). Cloudflare is modelled as 4 vCPU / 8 GiB containers carrying two streams, CPU billed on active use, the included allowances applied, a Durable Object per container and the $5 Workers plan. Operations hours are left out of every column.

*Chart: Cost of one busy live stream for an hour. US dollars per stream-hour with every channel busy. Cloudflare is a model (capacity not measured there); the EC2 capacities are measured. The numbers are in the tables and in the data files under https://speech.unidatum.com/data/.*

*Chart: Monthly cost against monthly minutes, with break-even points: traffic round the clock. Live streaming, infrastructure only, no operations hours. Dashed lines: the volume at which an option first costs less than Deepgram pay-as-you-go. The numbers are in the tables and in the data files under https://speech.unidatum.com/data/.*

*Chart: Monthly cost against monthly minutes, with break-even points: traffic in business hours only. The same options when the load is weekdays 10 hours: an always-on fleet idles most of the month, so it breaks even later. The numbers are in the tables and in the data files under https://speech.unidatum.com/data/.*

| traffic | option | cheaper than | minutes per month | status |
| --- | --- | --- | --- | --- |
| roundclock | Cloudflare containers (scale to zero) | deepgram | 2100 | [modelled] |
| roundclock | Cloudflare containers (always warm) | deepgram | 37700 | [modelled] |
| roundclock | EC2 Graviton4 on-demand | deepgram | 59700 | [modelled] |
| roundclock | EC2 Graviton4 1-year plan | deepgram | 44800 | [modelled] |
| roundclock | Own desktops | deepgram | 10600 | [modelled] |
| roundclock | EC2 Graviton4 on-demand | cf_scale_to_zero | 94600 | [modelled] |
| roundclock | EC2 Graviton4 on-demand | cf_always_warm | 106200 | [modelled] |
| business | Cloudflare containers (scale to zero) | deepgram | 2100 | [modelled] |
| business | Cloudflare containers (always warm) | deepgram | never under 31M | [modelled] |
| business | EC2 Graviton4 on-demand | deepgram | 112500 | [modelled] |
| business | EC2 Graviton4 1-year plan | deepgram | 44800 | [modelled] |
| business | Own desktops | deepgram | 10600 | [modelled] |
| business | EC2 Graviton4 on-demand | cf_scale_to_zero | never under 31M | [modelled] |
| business | EC2 Graviton4 on-demand | cf_always_warm | 71000 | [modelled] |

| Minutes/month | Peak streams | Deepgram PAYG | Workers AI Nova-3 WS | Cloudflare Containers always-warm | Cloudflare Containers scale-to-zero | EC2 c8g on-demand | EC2 c8g 1-yr SP | i9 desktop class (amortised) |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 10,000 | 0.3 | $48.0 | $92.0 | $138 (2x) | $32.0 (up to 1x) | $275 (2x xlarge) | $209 (2x xlarge) | $48.2 (1x) |
| 100,000 | 3.4 | $480 | $920 | $268 (2x) | $296 (up to 2x) | $277 (2x xlarge) | $211 (2x xlarge) | $48.2 (1x) |
| 1,000,000 | 34 | $4,800 | $9,200 | $2,530 (18x) | $2,970 (up to 18x) | $1,239 (5x 2xlarge) | $909 (5x 2xlarge) | $241 (5x) |
| 10,000,000 | 342 | $48,000 (over concurrency limit) | $92,000 | $24,789 (172x) | $29,709 (up to 172x) | $11,849 (49x 2xlarge) | $8,619 (49x 2xlarge) | $2,074 (43x) |

| Minutes/month | Peak streams | Deepgram PAYG | Workers AI Nova-3 WS | Cloudflare Containers always-warm | Cloudflare Containers scale-to-zero | EC2 c8g on-demand | EC2 c8g 1-yr SP | i9 desktop class (amortised) |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 10,000 | 1.1 | $48.0 | $92.0 | $138 (2x) | $32.0 (up to 1x) | $275 (2x xlarge) | $209 (2x xlarge) | $48.2 (1x) |
| 100,000 | 11 | $480 | $920 | $510 (6x) | $296 (up to 6x) | $510 (2x 2xlarge) | $378 (2x 2xlarge) | $96.5 (2x) |
| 1,000,000 | 114 | $4,800 | $9,200 | $4,884 (57x) | $2,970 (up to 57x) | $4,082 (17x 2xlarge) | $2,961 (17x 2xlarge) | $724 (15x) |
| 10,000,000 | 1136 | $48,000 (over concurrency limit) | $92,000 | $48,746 (569x) | $29,709 (up to 569x) | $38,856 (163x 2xlarge) | $28,109 (163x 2xlarge) | $6,898 (143x) |

| Option (pre-recorded audio) | $ per audio minute | $ per 1,000 audio minutes | Status of the number |
| --- | --- | --- | --- |
| Deepgram Nova-3 PAYG | $0.0043 | $4.30 | published |
| Deepgram Nova-3 Growth | $0.0036 | $3.60 | published |
| Deepgram Whisper Large | $0.0048 | $4.80 | published |
| Amazon Transcribe batch | $0.006 | $6.00 | from AWS's own example; tiers not read |
| Cloudflare Workers AI Whisper (large-v3-turbo) | $0.0005 | $0.50 | published; audio leaves our machines |
| Our service on Lambda, Parakeet, container image | $0.00159 | $1.59 | estimate from our CPU numbers; no cold-start or idle cost |
| Our service on c8g.4xlarge on-demand, queue, 90% busy | $0.00043 | $0.43 | estimate |
| Our service on a Cloudflare container (4 vCPU / 8 GiB, scale-to-zero, queue) | $0.00065 | $0.65 | estimate; amd64 only, vCPU speed not stated, needs the proof |
| Same on spot | $0.00023 | $0.23 | estimate; spot price is third party |

Reading it: scale-to-zero containers are cheaper than Deepgram at any volume shown and cheaper than EC2 Graviton below about 95,000 minutes a month on round-the-clock traffic; always-warm containers undercut Deepgram from about 38,000 minutes round the clock but never on business-hours traffic; Graviton on a 1-year plan undercuts Deepgram from about 45,000; and at volume containers cost about twice EC2 Graviton and five to fifteen times our own hardware. All of this assumes capacity we have **not measured on Cloudflare**.

Every Cloudflare price, limit and assumption in the model, with status, source and date read `docs/data/costs.csv`

| item | value | unit | status | source | date read |
| --- | --- | --- | --- | --- | --- |
| cf_wai_whisper_min | 0.0005 | USD per audio minute | verified | https://developers.cloudflare.com/workers-ai/platform/pricing/ (dateModified 2026-11-18) | 2026-12-04 |
| cf_wai_nova3_min | 0.0052 | USD per audio minute | verified | https://developers.cloudflare.com/workers-ai/platform/pricing/ | 2026-12-04 |
| cf_wai_nova3_ws_min | 0.0092 | USD per audio minute | verified | https://developers.cloudflare.com/workers-ai/platform/pricing/ | 2026-12-04 |
| cf_wai_flux_ws_min | 0.0077 | USD per audio minute | verified | https://developers.cloudflare.com/workers-ai/platform/pricing/ | 2026-12-04 |
| cf_wai_aura2_1k | 0.03 | USD per 1000 characters | verified | https://developers.cloudflare.com/workers-ai/platform/pricing/ | 2026-12-04 |
| cf_wai_melotts_min | 0.0002 | USD per audio minute | verified | https://developers.cloudflare.com/workers-ai/platform/pricing/ | 2026-12-04 |
| cf_wai_neuron_1k | 0.011 | USD per 1000 neurons | verified | https://developers.cloudflare.com/workers-ai/platform/pricing/ | 2026-12-04 |
| cf_workers_paid_month | 5 | USD per month | verified | https://developers.cloudflare.com/workers/platform/pricing/ | 2026-12-03 |
| cf_container_vcpu_s | 0.00002 | USD per vCPU-second | verified | https://developers.cloudflare.com/containers/platform/pricing/ (dateModified 2026-11-13; billed on active CPU) | 2026-12-04 |
| cf_container_gib_s | 0.0000025 | USD per GiB-second | verified | https://developers.cloudflare.com/containers/platform/pricing/ (provisioned memory) | 2026-12-04 |
| cf_container_standard4_vcpu | 4 | vCPU | verified | https://developers.cloudflare.com/containers/platform/limits/ | 2026-12-04 |
| cf_container_standard4_gib | 12 | GiB | verified | https://developers.cloudflare.com/containers/platform/limits/ | 2026-12-04 |
| cf_container_egress_gb | 0.025 | USD per GB | verified | https://developers.cloudflare.com/containers/platform/pricing/ (North America and Europe; 1 TB included) | 2026-12-04 |
| cf_do_request_million | 0.15 | USD per million | verified | https://developers.cloudflare.com/durable-objects/platform/pricing/ | 2026-12-04 |
| cf_do_gb_s_million | 12.5 | USD per million GB-seconds | verified | https://developers.cloudflare.com/durable-objects/platform/pricing/ | 2026-12-04 |
| cf_r2_gb_month | 0.015 | USD per GB-month | verified | https://developers.cloudflare.com/r2/pricing/ | 2026-12-04 |
| cf_tunnel_month | 0 | USD per month | [modelled] | Tunnel docs say available on all plans; no pricing page was read | 2026-12-04 |
| cf_container_disk_gb_s | 7e-8 | USD per GB-second | verified | https://developers.cloudflare.com/containers/platform/pricing/ (dateModified 2026-11-13; provisioned disk) | 2026-12-05 |
| cf_container_incl_gib_h | 25 | GiB-hours per month | verified | https://developers.cloudflare.com/containers/platform/pricing/ | 2026-12-05 |
| cf_container_incl_vcpu_min | 375 | vCPU-minutes per month | verified | https://developers.cloudflare.com/containers/platform/pricing/ | 2026-12-05 |
| cf_container_incl_disk_gb_h | 200 | GB-hours per month | verified | https://developers.cloudflare.com/containers/platform/pricing/ | 2026-12-05 |
| cf_do_incl_gb_s | 400000 | GB-seconds per month | verified | https://developers.cloudflare.com/durable-objects/platform/pricing/ (dateModified 2026-11-13) | 2026-12-05 |
| cf_lb_month | 5 | USD per month | [modelled] | https://www.cloudflare.com/plans/network-cdn.md (Starting at $5/mo; per-origin and per-request prices not found) | 2026-12-05 |
| cf_container_custom_gib | 8 | GiB | [assumption] | custom instance sizes are allowed within the account limits (https://developers.cloudflare.com/containers/platform/limits/) | 2026-12-05 |
| cf_container_ref_type | c7a.2xlarge | instance type | [assumption] | Cloudflare does not state the vCPU model or speed (amd64 only); we plan with the measured AMD c7a figure per vCPU | 2026-12-05 |
| cf_streams_per_container | 2 | streams | [assumption] | floor(4 vCPU x 0.83 measured streams per vCPU x 0.85 derate) = 2 on c7a-like vCPUs; 1 on c7i-like | 2026-12-05 |
| cf_fill | 0.5 | fraction | [assumption] | average fill of the containers that are awake under scale-to-zero (streams are not packed perfectly) | 2026-12-05 |
| cf_session_min | 5 | minutes | [assumption] | average call length | 2026-12-05 |
| cf_wake_fraction | 0.1 | fraction | [assumption] | share of sessions that arrive at a sleeping container and wake it | 2026-12-05 |
| cf_sleep_after_min | 2 | minutes | [assumption] | inactivity timeout kept as a tail after the last session (the docs example uses 2 minutes) | 2026-12-05 |
| cf_cold_start_local_s | 8 | seconds | [measured] | local test instance on i9-14900K desktop efficiency cores 16-22 2026-12-05 with the model files evicted from the page cache (8.0 and 8.7 s; 6.2 s with a warm cache): process start to /health 200 (docs/CLOUDFLARE-SERVERLESS.md) | 2026-12-05 |
| hy_hour_peak | 1.25 | factor | [assumption] | peak concurrency inside an hour against the hour's mean (capacity must cover the peak; the earlier tables use 1.5 against a window average) | 2026-12-05 |
| hy_warm_lead_cf_min | 0.5 | minutes | [assumption] | pre-emptive start of a Cloudflare container until health check and test transcript pass (docs: 1-3 s container start; 8 s model load measured; image pull unmeasured: this is optimistic) | 2026-12-05 |
| hy_warm_lead_ec2_min | 2 | minutes | [assumption] | EC2 launch from a pre-baked AMI in an Auto Scaling group until the same checks pass (launch 60-90 s plus 8 s model load) | 2026-12-05 |
| hy_drain_min | 2 | minutes | [assumption] | time a burst instance stays after its last session before it is released (the hysteresis against flapping) | 2026-12-05 |
| hy_burst_fill | 0.7 | fraction | [assumption] | fill of burst instances that were started on purpose (sessions are steered to them) | 2026-12-05 |
| hy_base_threshold | 0.65 | fraction | [assumption] | base utilisation at which the router starts warming burst capacity | 2026-12-05 |
| hy_spot_discount_note | 0 | n/a | [assumption] | c8g spot price per vCPU is taken from c8g.4xlarge ($0.349 an hour; third-party Vantage figure) and scaled linearly to c8g.xlarge | 2026-12-05 |
| hy_handoff_replay_cpu_s_per_audio_s | 0.59 | cpu-s per audio-s | [measured] | same as the streaming cost: a replay is decoded like live audio | 2026-12-05 |
| hy_min_base_share | 0.25 | fraction | [assumption] | with a Cloudflare or spot burst tier the base always carries at least this share of the peak (spot and warm-up capacity cannot be trusted to be the whole fleet: spot pools run dry and give 2 minutes notice) | 2026-12-05 |

## Base plus burst: an always-on server in front, serverless behind it

The idea: an always-on base, our own machines or EC2, takes the traffic. When it passes a utilisation threshold (65% here) a serverless tier is warmed in advance; new sessions go to it only after a health check and a test transcript; it is drained and released after the burst. **New sessions are routed; live ones are never moved.** A call that finds everything full falls back to a hosted provider, which our clients already support. It is the only way serverless makes sense for live audio, because the cold start is hidden behind capacity that is already running.

```mermaid
flowchart TB
%% title: Base plus burst: new calls go to the always-on base first, to warm burst capacity second and to a hosted provider last
CALL[Callers and clients] --> EDGE[Cloudflare edge: hostname, TLS, rate limit]
EDGE --> ROUTE{Router: pools in order}
ROUTE -->|1. below 65%| BASE[Base pool, always on]
ROUTE -->|2. when READY| BURST[Burst pool, warm]
ROUTE -.-> WATCH[Warm-up controller: reads sessions and capacity]
ROUTE --> HOSTED[3. Hosted provider, when all is full]
WATCH -.->|start, test, mark READY| BURST
```

```mermaid
sequenceDiagram
%% title: A burst instance is started before it is needed, tested, and only then given calls; a call that finds everything full goes to the hosted provider
participant K as Client
participant R as Router
participant B as Base
participant W as Controller
participant S as Burst instance
K->>R: open stream
R->>B: base at 58%: use the base
Note over B: base reaches 65%
W->>S: start two instances now
Note over S: load models, about 8 s
W->>S: health check, then test clip
S-->>W: 200 and the expected text
W->>R: mark ready
K->>R: open stream (base at 90%)
R->>S: new call goes to the burst instance
K->>R: open stream (everything full)
R-->>K: 503 CAPACITY: use the hosted provider
Note over S: idle 2 min: drained, released
```

### Readiness gate and warm-up arithmetic

Instance up is not ready. The controller waits for the health check (the service answers healthy only after every worker has loaded) and then streams a 6.5-second sample and compares the text. Only then does the router see the instance. Warm-up must finish before the base fills: the base can take (1 minus the threshold) times its capacity while the burst tier warms, so the arrival rate it can absorb is that headroom divided by the warm-up time. For a 28-stream base at 65%, about 10 streams of headroom: a 20-second warm-up covers about 30 new sessions a minute, a 2-minute EC2 launch about 5 a minute [estimate]. A working day's ramp fits both; **a flash crowd fits neither, and that is what the hosted provider is for.**

### The warm pool over a campaign day

A simulated day [estimate]: a base of 24 streams, a campaign from 13:00 that roughly quadruples the load, and a six-minute flash crowd at 14:30. The controller warms burst instances when the forecast passes 65% of the base; they take calls two minutes later and are released when the load no longer needs them. The numbers are a fluid model (`docs/data/burst_sim.py`), not a measurement.

*Illustration: Interactive animation of the modelled campaign day. On the left, callers arrive as moving dots. A base server of 24 stream slots (six units of four) fills with amber light as demand rises. When the forecast passes 65% of the base, burst instances appear on the right with a green warm-up bar that fills over two minutes; once ready they light blue and take new sessions. During the flash crowd at 14:30 (peak about 70 streams) the hosted-provider cloud at the top right lights red with the streams nothing else could take. After the campaign the instances drain and disappear. Readouts show the simulated clock, streams wanted, served on the base, on burst instances and by the hosted provider, instances ready and starting, and base utilisation. Over the charted day: 53.7 stream-hours on burst instances and 0.6 on the hosted provider.*

*Chart: Where each call is served during a campaign day. Simulated: a base of 24 streams, burst instances warmed at 65% and ready after 2 minutes, a hosted provider for the rest. Streams over time, 11:00 to 18:00. The numbers are in the tables and in the data files under https://speech.unidatum.com/data/.*

*Chart: Base utilisation and the burst pool warming. Percent of the base's 24 streams in use (left) triggers warm-up at 65%; the lower chart counts burst instances starting and ready. The numbers are in the tables and in the data files under https://speech.unidatum.com/data/.*

*Chart: Burst instances over the same day. Instances starting (not yet given calls) and ready. They are started ahead of the need and released after 2 idle minutes. The numbers are in the tables and in the data files under https://speech.unidatum.com/data/.*

|  | Cloudflare Load Balancing and Tunnel | A Worker with a Durable Object registry |
| --- | --- | --- |
| How it picks | Pools in order, base first; a monitor on a readiness URL makes the base "unhealthy" for new sessions above the threshold, so the next pool gets them | The Worker asks a registry (open sessions and readiness per backend) and proxies the WebSocket to the chosen backend |
| Open streams when a pool flips | Not terminated, per Cloudflare's documentation [sourced] | Under our control |
| Reaction time | Monitor interval, retries and up/down counts: 30 to 120 s [estimate] | Seconds, if the Worker reads each backend's health itself |
| Cost | From $5 a month plus Tunnel (price not stated) | $5 Workers plan plus about $4 for an awake registry object |
| Needs | A small service change: a readiness URL that fails above a configurable utilisation | Our proxy code in the audio path |

Recommended: Load Balancing pools for the data path (no code of ours in the audio path) and a small cron Worker for the warm-up controller; move to the Worker router only if the monitor interval proves too slow.

### Can a live stream be handed off mid-call? Measured

A stream carries decoder state and the service has no resume, so we tested what a handoff costs: three LibriSpeech clips (10.4, 3.3 and 6.6 s) with pauses, a second fresh session standing in for the new backend, compared with the same audio in one session [measured], one machine, no network in the path.

| scenario | replay audio s | replay speed | words differing pct | final lag s | baseline final lag s |
| --- | --- | --- | --- | --- | --- |
| at a pause after the final: no replay | 0 | n/a | 0 | 0.57 | 0.58 |
| at a pause: replay of the last 1 s | 1 | 2 | 0 | 0.56 | 0.58 |
| at a pause: replay of the last 3 s | 3 | 2 | 0 | 0.56 | 0.58 |
| mid-utterance (5 s into 10.4 s): replay from utterance start at 2x | 5 | 2 | 0 | 2.1 | 2.15 |
| mid-utterance: replay from utterance start at 4x | 5 | 4 | 0 | 2.13 | 2.15 |
| mid-utterance: no replay | 0 | n/a | 25.9 | n/a | 2.15 |

- **At a pause a handoff is free:** after a final and a short silence there is nothing to rebuild; the new backend can start with no replay.
- **Mid-sentence it works if the proxy replays the open utterance:** the model state rebuilds from the audio and the result was identical, with the final on time. The glitch is a 1.25 to 2.5 second stall while the audio so far is replayed at 2 to 4 times real time, and about 3 CPU-seconds for 5 s of audio. Keep the replay at 2x or below on a shared host.
- **Without replay,** 25.9% of the words of the sentence were lost.
- Someone has to hold the audio since the last final (a ring buffer of at most one utterance), offset the new session's timestamps and drop duplicate finals. That proxy does not exist yet, so the first version routes new sessions only; handoff becomes worth building for drain-and-deploy and for spot interruptions (two minutes' notice).

### Cost: a base for the normal load against sizing for the peak

Base: Graviton4 units of 4 vCPU (about 4 streams each, measured), always on, at least two, behind the Cloudflare front door. Traffic shapes: business hours, round the clock, and business hours plus four three-hour campaigns at four times the load. The size of the base is the cheapest for each case; warm-up waste is included [estimate].

*Chart: Base plus burst against sizing for the peak: one million minutes a month. US dollars per month, infrastructure only, by traffic shape. The base is sized for the normal load; the burst tier takes the rest. The numbers are in the tables and in the data files under https://speech.unidatum.com/data/.*

| Traffic | Minutes/month | Peak streams | All on Deepgram PAYG | EC2 c8g sized for the peak, always on | Base + Deepgram overflow | Base + Cloudflare containers burst | Base + EC2 spot burst | Own machines base + Deepgram overflow |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| business hours | 100,000 | 11 | $480 | $366 (3x) | $323 (base 2x, burst 24%) | $289 (base 2x, burst 15%) | $254 (base 2x, burst 3%) | $101 (own base 2x) |
| business hours | 1,000,000 | 109 | $4,800 | $3,378 (28x) | $3,147 (base 22x, burst 16%) | $2,334 (base 7x, burst 64%) | $1,179 (base 7x, burst 28%) | $680 (own base 14x) |
| business hours | 10,000,000 | 1089 | $48,000 | $33,129 (275x) | $31,429 (base 220x, burst 16%) | $23,225 (base 69x, burst 64%) | $11,646 (base 69x, burst 29%) | $6,586 (own base 136x) |
| round the clock | 100,000 | 4 | $480 | $246 (2x) | $246 (base 2x, burst 0%) | $246 (base 2x, burst 0%) | $246 (base 2x, burst 0%) | $101 (own base 2x) |
| round the clock | 1,000,000 | 44 | $4,800 | $1,450 (12x) | $1,340 (base 11x, burst 1%) | $1,261 (base 9x, burst 14%) | $674 (base 3x, burst 46%) | $294 (own base 6x) |
| round the clock | 10,000,000 | 445 | $48,000 | $13,616 (113x) | $13,241 (base 107x, burst 3%) | $12,519 (base 92x, burst 11%) | $6,648 (base 29x, burst 47%) | $2,692 (own base 55x) |
| business hours plus 4 campaign days | 100,000 | 37 | $480 | $1,209 (10x) | $349 (base 2x, burst 29%) | $407 (base 3x, burst 10%) | $376 (base 3x, burst 2%) | $158 (own base 2x) |
| business hours plus 4 campaign days | 1,000,000 | 366 | $4,800 | $11,207 (93x) | $3,421 (base 18x, burst 36%) | $3,278 (base 24x, burst 12%) | $2,986 (base 24x, burst 3%) | $1,330 (own base 12x) |
| business hours plus 4 campaign days | 10,000,000 | 3660 | $48,000 | $111,180 (923x) | $34,082 (base 184x, burst 35%) | $31,656 (base 231x, burst 12%) | $28,745 (base 231x, burst 3%) | $13,127 (own base 115x) |

| Traffic | Base + Deepgram overflow beats all-Deepgram from | Base + Cloudflare burst from | Base + EC2 spot burst from | Peak-sized always-on EC2 from |
| --- | --- | --- | --- | --- |
| business hours | 51k | 52k | 51k | 51k |
| round the clock | 51k | 51k | 51k | 51k |
| business hours plus campaign days | 59k | 56k | 52k | never (under 30M) |

- The saving depends on how spiky the traffic is: steady traffic gains little (round the clock, $1,450 against $1,261 to $1,340 at a million minutes); campaign traffic falls from $11,207 for a fleet sized for the peak to about $3,000 to $3,400, about 70% less.
- The cost curve is flat around the optimum (a base of 2, 5, 10 or 20 units costs within 25% of each other at a million business-hour minutes): choose the base for resilience and ramp speed, not the last dollar.
- Hosted overflow needs no warm-up and no router state, but pay-as-you-go caps live streams at 150; a campaign peak of hundreds needs a contract. Own machines as the base are the cheapest base of all.

| Burst tier | Warm-up to hide | Per busy stream-hour | Fit |
| --- | --- | --- | --- |
| Hosted provider (Deepgram) | none | $0.288 [sourced] | Best first overflow, already in the clients; concurrency caps; audio leaves our network |
| EC2 Auto Scaling group, spot | about 1.5 to 2 min [assumption] | about $0.031 [estimate] | Cheapest burst tier at volume; spot gives two minutes' notice before it reclaims an instance ([AWS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-instance-termination-notices.html)); warm pools do not support Spot in mixed groups ([AWS](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-warm-pools.html)) |
| EC2 on-demand group | same | about $0.057 [estimate] | Can use a warm pool of stopped instances (pay only for the disks) |
| Cloudflare Containers | 10 to 20 s [estimate] | about $0.163 [estimate] | Acceptable as a small pool; 4 vCPU per container; no autoscaling; beta |

## Scenarios and what-ifs [modelled]

**Everything in this section is theory.** These charts are produced by scripts from stated assumptions; none of the dashed lines or hatched bars is a measurement. Each chart lists its assumptions under it and links the script, which is in the repository and downloadable here: [`scenarios.py`](https://speech.unidatum.com/data/scenarios.py), [`burst_sim.py`](https://speech.unidatum.com/data/burst_sim.py), [`costs.py`](https://speech.unidatum.com/data/costs.py). Change an assumption, re-run (`python3 docs/data/scenarios.py`), rebuild the site, and the charts redraw.

### Cold start under different assumptions

The one measured number is the local start (8.7 s). Everything on Cloudflare depends on how long an image pull takes, which Cloudflare does not document, and on how the service loads its models. Modelled: **9.7 s** if the host already has the image, **15.7 s** if a 2 GB image is pulled at 400 MB/s, **31.7 s** at 100 MB/s. Loading Whisper and Parakeet in parallel saves about 2.6 s; serving the English route first (Parakeet only) saves about 4.1 s. So the cheapest improvement is in our own start-up code, not in the platform.

*Chart: Cold-start timelines under different assumptions. Share of the models a stream needs that are loaded, against seconds since the caller arrived. Solid: measured locally. Dashed: modelled for a Cloudflare container. The numbers are in the tables and in the data files under https://speech.unidatum.com/data/.*

*Chart: Time until a caller can be served, by scenario. Platform overhead (container start and image pull) plus model loading. Hatched bars are modelled. The numbers are in the tables and in the data files under https://speech.unidatum.com/data/.*

| scenario | platform overhead s | loading s | ready s | basis |
| --- | --- | --- | --- | --- |
| Local service, measured | 0 | 8.7 | 8.7 | [measured] |
| Cloudflare, image already on the host (start 1 s) | 1 | 8.7 | 9.7 | [modelled] |
| Cloudflare, start 2 s + pull 2 GB at 400 MB/s | 7 | 8.7 | 15.7 | [modelled] |
| Cloudflare, start 3 s + pull 2 GB at 100 MB/s | 23 | 8.7 | 31.7 | [modelled] |
| As the 400 MB/s case, Whisper and Parakeet loaded in parallel | 7 | 6.1 | 13.1 | [modelled] |
| As the 400 MB/s case, English route only (Parakeet, no Whisper) | 7 | 4.6 | 11.6 | [modelled] |

### Burst response: a sudden step of 20 streams

What happens in the first five minutes if 20 streams arrive at once while the base is full: the hosted provider catches what no warm instance can take. The slower the controller notices (a Load Balancing monitor takes about 60 s) and the slower the warm-up (a Cloudflare container 20 s, an EC2 spot instance 120 s, both assumed), the longer the spill. Modelled spill in the first five minutes: **8 stream-minutes** with a Worker router and containers, **60** with a monitor and spot instances, **17** if three instances were already warm. At Deepgram's $0.0048 a minute that is 4 cents to 29 cents per step: **a slow burst tier costs little money when a hosted overflow exists; what it costs is dependence on that overflow**.

*Chart: Burst response: streams spilling to the hosted provider after a sudden step. 20 extra streams arrive at t=0 while the base is full. Lines show streams that no warm instance can take yet. The numbers are in the tables and in the data files under https://speech.unidatum.com/data/.*

| scenario | reaction delay s | warm up s | spill stream minutes in 5 min | spill cost usd | basis |
| --- | --- | --- | --- | --- | --- |
| Worker router, Cloudflare container (2 streams each), warm-up 20 s | 5 | 20 | 8.3 | 0.04 | [modelled] |
| Load Balancing monitor, Cloudflare container, warm-up 20 s | 60 | 20 | 26.7 | 0.128 | [modelled] |
| Worker router, EC2 spot instance (4 streams each), warm-up 120 s | 5 | 120 | 41.7 | 0.2 | [modelled] |
| Load Balancing monitor, EC2 spot, warm-up 120 s | 60 | 120 | 60 | 0.288 | [modelled] |
| Pre-warmed: threshold crossed earlier, 3 spot instances already ready | 5 | 120 | 16.7 | 0.08 | [modelled] |

### Warm pool and base plus burst over a simulated day

The campaign-day charts in the section above show one run. Here the same simulation is varied. **Lead time only matters when the load ramps fast:** with a 5-minute ramp a 10-minute warm-up spills about 2.2 stream-hours to the hosted provider in the day; with a 20-minute ramp about 0.2; with an hour's ramp nothing. **A lower threshold helps only when the warm-up is slow** (40 to 50% instead of 65% cuts the spill by about a quarter at a 5-minute lead), at the price of more burst instance-hours. **The base size is a resilience decision, not a cost one:** in the model the cheapest base is the smallest (about $15 a day for 12 streams against $25 for 24 and $61 for 64) because burst capacity covers the campaign, but that assumes the burst tier is ready on time.

*Chart: Warm-up lead time against how fast the load ramps. Hosted-provider stream-hours over the simulated day (calls that found no capacity), warm-up at 65% of the base, by the length of the campaign ramp. The numbers are in the tables and in the data files under https://speech.unidatum.com/data/.*

*Chart: Warm-up threshold against lead time, for a fast ramp. Hosted-provider stream-hours over the simulated day with a 5-minute campaign ramp, by the base utilisation at which warm-up starts. The numbers are in the tables and in the data files under https://speech.unidatum.com/data/.*

*Chart: How big should the always-on base be? Cost of the simulated day by base size. Day cost = base on-demand + burst instances + hosted overflow, for bases of 12 to 64 streams. The numbers are in the tables and in the data files under https://speech.unidatum.com/data/.*

### Cost across volumes if the Cloudflare vCPU were different

The biggest unknown is the speed of a Cloudflare vCPU. If it is like an Intel c7i (0.5 streams per vCPU), always-warm containers cost about as much as Deepgram at a million minutes a month (about $4,500 against $4,800). If it is like an AMD c7a, about $2,500. If it were Graviton4-class (it is not on offer: Cloudflare is amd64 only), about $1,750, still above EC2 Graviton4's $1,240. A vCPU twice as fast as c7a gets to about $1,150. And if "active CPU" billing turned out to mean the whole running time, the AMD-like always-warm figure roughly doubles, to about $4,900.

*Chart: Cloudflare always-warm cost if the vCPU were slower or faster. Monthly cost against monthly minutes, traffic round the clock. How fast a Cloudflare vCPU is decides whether containers beat Deepgram and EC2. The numbers are in the tables and in the data files under https://speech.unidatum.com/data/.*

*Chart: Cloudflare scale-to-zero cost if the vCPU were slower or faster. The same what-if for containers that sleep between calls (50% fill, 2-minute tail). The numbers are in the tables and in the data files under https://speech.unidatum.com/data/.*

### Capacity as clock speed or core count changes

Measured knees on 24 vCPUs: 28 streams on Graviton4 (2.7 GHz), about 20 on AMD c7a (3.5 GHz) and 12 on Intel c7i (3.2 GHz, scaled from a smaller run). Fitting a straight proportionality to clock speed times per-clock work through each point gives what faster or slower silicon would do: **at 4.5 GHz, about 47, 26 and 17 streams.** More cores help linearly up to the 24 we measured; beyond that the model assumes each doubling loses 8% to the shared final-pass pool, which is a guess: a 96-vCPU Graviton4 would carry about 94, not 112. Nothing here is measured away from the measured points.

*Chart: What if the clock speed changed? Streams on a 24 vCPU server. Modelled lines through the measured point of each CPU family (dots): streams at the knee against all-core clock speed, 24 vCPUs. The numbers are in the tables and in the data files under https://speech.unidatum.com/data/.*

*Chart: What if the core count changed? Streams against vCPUs. Modelled at each family's own clock: linear to 24 vCPUs (where we measured), then 8% lost per doubling to the shared final-pass pool (an assumption). The numbers are in the tables and in the data files under https://speech.unidatum.com/data/.*

### Re-running the scenarios

Three scripts in `docs/data/` (Python 3, no dependencies) write the CSVs that these charts read:

- `python3 docs/data/costs.py`: the cost model, the break-even points and the cost curves (reads `costs.csv` and `instances.csv`, where each price carries its source and date).
- `python3 docs/data/burst_sim.py`: the campaign-day warm-pool simulation (and the functions the grid below uses).
- `python3 docs/data/scenarios.py`: cold-start timelines, burst response, the threshold, lead and base-size grid, the vCPU cost what-ifs and the clock and core what-ifs. The assumptions are the constants at the top of the file.

The data files are served under [/data/](https://speech.unidatum.com/data/) and the scripts next to them.

| study | threshold pct | lead min | ramp min | base units | hosted stream hours | burst instance hours | instance starts | day cost usd | basis |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| threshold_lead_ramp | 40 | 1 | 5 | 6 | 0 | 26.6 | 8 | 25.29 | [modelled] |
| threshold_lead_ramp | 50 | 1 | 5 | 6 | 0 | 25.5 | 8 | 25.19 | [modelled] |
| threshold_lead_ramp | 65 | 1 | 5 | 6 | 0 | 23.7 | 8 | 25.04 | [modelled] |
| threshold_lead_ramp | 80 | 1 | 5 | 6 | 0 | 23.7 | 8 | 25.04 | [modelled] |
| threshold_lead_ramp | 90 | 1 | 5 | 6 | 0.01 | 23.6 | 8 | 25.04 | [modelled] |
| threshold_lead_ramp | 40 | 2 | 5 | 6 | 0.03 | 26.8 | 9 | 25.31 | [modelled] |
| threshold_lead_ramp | 50 | 2 | 5 | 6 | 0.03 | 25.6 | 9 | 25.22 | [modelled] |
| threshold_lead_ramp | 65 | 2 | 5 | 6 | 0.04 | 23.8 | 9 | 25.06 | [modelled] |
| threshold_lead_ramp | 80 | 2 | 5 | 6 | 0.04 | 23.8 | 9 | 25.06 | [modelled] |
| threshold_lead_ramp | 90 | 2 | 5 | 6 | 0.11 | 23.8 | 9 | 25.08 | [modelled] |
| threshold_lead_ramp | 40 | 5 | 5 | 6 | 0.55 | 27.8 | 15 | 25.56 | [modelled] |
| threshold_lead_ramp | 50 | 5 | 5 | 6 | 0.55 | 26.6 | 14 | 25.45 | [modelled] |
| threshold_lead_ramp | 65 | 5 | 5 | 6 | 0.76 | 24.7 | 14 | 25.34 | [modelled] |
| threshold_lead_ramp | 80 | 5 | 5 | 6 | 0.76 | 24.7 | 14 | 25.34 | [modelled] |
| threshold_lead_ramp | 90 | 5 | 5 | 6 | 0.76 | 24.7 | 14 | 25.34 | [modelled] |
| threshold_lead_ramp | 40 | 10 | 5 | 6 | 1.67 | 30.3 | 21 | 26.09 | [modelled] |
| threshold_lead_ramp | 50 | 10 | 5 | 6 | 1.67 | 29.2 | 21 | 26 | [modelled] |
| threshold_lead_ramp | 65 | 10 | 5 | 6 | 2.21 | 27.2 | 21 | 25.98 | [modelled] |
| threshold_lead_ramp | 80 | 10 | 5 | 6 | 2.21 | 27 | 20 | 25.97 | [modelled] |
| threshold_lead_ramp | 90 | 10 | 5 | 6 | 2.21 | 27 | 20 | 25.97 | [modelled] |
| threshold_lead_ramp | 40 | 1 | 20 | 6 | 0 | 24.8 | 7 | 25.14 | [modelled] |
| threshold_lead_ramp | 50 | 1 | 20 | 6 | 0 | 23.7 | 7 | 25.04 | [modelled] |
| threshold_lead_ramp | 65 | 1 | 20 | 6 | 0 | 21.8 | 7 | 24.87 | [modelled] |
| threshold_lead_ramp | 80 | 1 | 20 | 6 | 0 | 21.7 | 7 | 24.87 | [modelled] |
| threshold_lead_ramp | 90 | 1 | 20 | 6 | 0 | 21.7 | 7 | 24.86 | [modelled] |
| threshold_lead_ramp | 40 | 2 | 20 | 6 | 0 | 25 | 8 | 25.15 | [modelled] |
| threshold_lead_ramp | 50 | 2 | 20 | 6 | 0 | 23.9 | 8 | 25.05 | [modelled] |
| threshold_lead_ramp | 65 | 2 | 20 | 6 | 0 | 22 | 8 | 24.89 | [modelled] |
| threshold_lead_ramp | 80 | 2 | 20 | 6 | 0 | 21.9 | 8 | 24.88 | [modelled] |
| threshold_lead_ramp | 90 | 2 | 20 | 6 | 0 | 21.9 | 8 | 24.88 | [modelled] |
| threshold_lead_ramp | 40 | 5 | 20 | 6 | 0 | 25.6 | 10 | 25.2 | [modelled] |
| threshold_lead_ramp | 50 | 5 | 20 | 6 | 0 | 24.3 | 9 | 25.09 | [modelled] |
| threshold_lead_ramp | 65 | 5 | 20 | 6 | 0 | 22.4 | 9 | 24.93 | [modelled] |
| threshold_lead_ramp | 80 | 5 | 20 | 6 | 0 | 22.3 | 9 | 24.92 | [modelled] |
| threshold_lead_ramp | 90 | 5 | 20 | 6 | 0 | 22.3 | 9 | 24.92 | [modelled] |
| threshold_lead_ramp | 40 | 10 | 20 | 6 | 0.07 | 26.4 | 11 | 25.29 | [modelled] |
| threshold_lead_ramp | 50 | 10 | 20 | 6 | 0.07 | 25.2 | 11 | 25.19 | [modelled] |
| threshold_lead_ramp | 65 | 10 | 20 | 6 | 0.2 | 23.2 | 11 | 25.05 | [modelled] |
| threshold_lead_ramp | 80 | 10 | 20 | 6 | 0.26 | 23 | 10 | 25.05 | [modelled] |
| threshold_lead_ramp | 90 | 10 | 20 | 6 | 0.26 | 23 | 10 | 25.05 | [modelled] |
| threshold_lead_ramp | 40 | 1 | 60 | 6 | 0 | 20.2 | 7 | 24.74 | [modelled] |
| threshold_lead_ramp | 50 | 1 | 60 | 6 | 0 | 19.1 | 7 | 24.63 | [modelled] |
| threshold_lead_ramp | 65 | 1 | 60 | 6 | 0 | 17.1 | 7 | 24.46 | [modelled] |
| threshold_lead_ramp | 80 | 1 | 60 | 6 | 0 | 16.9 | 7 | 24.44 | [modelled] |
| threshold_lead_ramp | 90 | 1 | 60 | 6 | 0 | 16.7 | 7 | 24.43 | [modelled] |
| threshold_lead_ramp | 40 | 2 | 60 | 6 | 0 | 20.4 | 7 | 24.75 | [modelled] |
| threshold_lead_ramp | 50 | 2 | 60 | 6 | 0 | 19.2 | 7 | 24.64 | [modelled] |
| threshold_lead_ramp | 65 | 2 | 60 | 6 | 0 | 17.2 | 7 | 24.47 | [modelled] |
| threshold_lead_ramp | 80 | 2 | 60 | 6 | 0 | 17 | 7 | 24.45 | [modelled] |
| threshold_lead_ramp | 90 | 2 | 60 | 6 | 0 | 16.8 | 7 | 24.44 | [modelled] |
| threshold_lead_ramp | 40 | 5 | 60 | 6 | 0 | 20.8 | 8 | 24.79 | [modelled] |
| threshold_lead_ramp | 50 | 5 | 60 | 6 | 0 | 19.5 | 7 | 24.68 | [modelled] |
| threshold_lead_ramp | 65 | 5 | 60 | 6 | 0 | 17.5 | 7 | 24.5 | [modelled] |
| threshold_lead_ramp | 80 | 5 | 60 | 6 | 0 | 17.3 | 7 | 24.48 | [modelled] |
| threshold_lead_ramp | 90 | 5 | 60 | 6 | 0 | 17.1 | 7 | 24.47 | [modelled] |
| threshold_lead_ramp | 40 | 10 | 60 | 6 | 0 | 21.7 | 9 | 24.86 | [modelled] |
| threshold_lead_ramp | 50 | 10 | 60 | 6 | 0 | 20.5 | 9 | 24.76 | [modelled] |
| threshold_lead_ramp | 65 | 10 | 60 | 6 | 0 | 18.4 | 9 | 24.57 | [modelled] |
| threshold_lead_ramp | 80 | 10 | 60 | 6 | 0 | 18 | 8 | 24.54 | [modelled] |
| threshold_lead_ramp | 90 | 10 | 60 | 6 | 0 | 17.9 | 8 | 24.53 | [modelled] |
| base_size | 65 | 2 | 20 | 3 | 0.61 | 42.8 | 21 | 15.39 | [modelled] |
| base_size | 65 | 2 | 20 | 4 | 0.61 | 33.6 | 20 | 18.42 | [modelled] |
| base_size | 65 | 2 | 20 | 6 | 0.61 | 23.8 | 18 | 25.22 | [modelled] |
| base_size | 65 | 2 | 20 | 8 | 0.61 | 16.7 | 16 | 32.26 | [modelled] |
| base_size | 65 | 2 | 20 | 10 | 0.61 | 9.8 | 14 | 39.32 | [modelled] |
| base_size | 65 | 2 | 20 | 12 | 0.61 | 5 | 11 | 46.55 | [modelled] |
| base_size | 65 | 2 | 20 | 16 | 0.21 | 1.7 | 8 | 61.46 | [modelled] |

## The best Cloudflare-based deployment

Cloudflare as the global edge in front of always-warm backends we control; Containers for batch, and as an optional small overflow pool. TLS ends at Cloudflare, so audio transits its network: fine for general traffic, a decision for sensitive customers, who can use the own-machine install directly.

```mermaid
flowchart LR
%% title: The best Cloudflare-based deployment: Cloudflare as the global edge in front of always-warm backends, containers for batch
CALL[Callers] --> EDGE[Cloudflare edge]
EDGE --> LB[Load Balancing and health checks]
LB -->|Tunnel| OWN[Own machines]
LB -->|Tunnel| EC2[EC2 Graviton4, always on]
LB -.->|overflow, kept warm| BURST[Spot group or containers]
UP[Upload to R2] --> Q[Queue] --> JOB[Batch container job] --> RES[Results in R2]
```

### Recommendation by volume

1. **Under about 50,000 minutes a month:** a hosted provider alone, or our own machine. No hybrid.
2. **About 50,000 to a million:** own machines (or two small Graviton servers) as the base, Cloudflare edge and Tunnel in front, the hosted provider as overflow through the existing client fallback. The burst tier would be at most a quarter of the bill.
3. **Above a million, or with campaign peaks:** add an EC2 spot group as the second pool, warmed on a 65% threshold and a schedule, hosted provider last; keep a base of 25 to 50% of the peak.
4. **Cloudflare Containers as the burst tier** only if a test shows a short, repeatable warm-up and a vCPU at least as fast as the AMD c7a.
5. **Do not move live streams in the first version.**

## Drawbacks of serverless for live use, in order of importance

1. **Cold start on every wake-up**: about 10 to 20 seconds for us (8 s of model loading measured, plus container start and an unmeasured image pull). Unacceptable for a live caller; avoided only by keeping containers awake, which turns serverless into a provisioned fleet.
2. **No autoscaling and small boxes:** a burst means many cold starts of two- to three-stream containers, with a router we must write and run.
3. **4 vCPU and 12 GiB ceiling, amd64 only, vCPU unspecified:** our 24-core layout becomes six containers carrying 10 to 17 streams instead of 28, and the Graviton advantage is unavailable.
4. **Price per stream:** about twice Graviton EC2 in the monthly model and three times per busy stream-hour; still half of Deepgram at volume.
5. **Public beta**, with moving parts: the default scheduling policy is deprecated and the older container class is maintained only to the end of 2026.
6. **WebSocket reliability is under-documented:** no published idle timeout; servers can restart on a release; no resume for a stateful decoder, so clients need replay logic.
7. **The Durable Object and container may be in different places**, adding an unmeasured hop.
8. **Billing details are unclear in places:** what "active" CPU means, and how a proxied WebSocket's messages are counted.
9. **Audio leaves our network,** and Workers AI's Nova-3 and Flux are Deepgram's models, not ours.
10. **Prices not stated:** Tunnel and Access on any page read, and Load Balancing beyond "starting at $5 a month".

## Not yet measured

No container has been run on Cloudflare yet; every Cloudflare figure above that is not a documented price is an [estimate]. A one-hour test on a throwaway Worker, torn down afterwards (under three dollars), would measure: what the vCPU is (the biggest unknown); time from first request to ready with a never-used image, after an idle sleep and with a warm host; first partial through the Worker against direct; streams per 4 vCPU container at one to four streams; a WebSocket held for 10 minutes and two hours with and without pings, and a redeploy during a stream; the bill for the hour (what "active CPU" means); and the image pull in a second location. Until then, plan with the numbers on this page and treat the Cloudflare capacity as the least certain input.

Service changes the base-plus-burst design needs, not yet made: a readiness URL with a configurable utilisation ceiling, and a drain mode (stop accepting streams, finish the open ones, exit).

## Sources

All read on 2026-12-05; the date in brackets is the page's own last-modified date where it shows one. The full report with every row is `docs/CLOUDFLARE-SERVERLESS.md` in the repository.

- Containers: [overview](https://developers.cloudflare.com/containers/) (2026-12-03), [limits](https://developers.cloudflare.com/containers/platform/limits/) (2026-12-03), [pricing](https://developers.cloudflare.com/containers/platform/pricing/) (2026-11-13), [FAQ](https://developers.cloudflare.com/containers/faq/) (2026-12-03), [architecture](https://developers.cloudflare.com/containers/concepts/architecture/), [WebSocket example](https://developers.cloudflare.com/containers/examples/websocket/), [blog](https://blog.cloudflare.com/faster-agent-sandboxes/) (2026-09-30), [launch post](https://blog.cloudflare.com/containers-are-available-in-public-beta-for-simple-global-and-programmable/) (2025-06-24)
- Workers and Durable Objects: [limits](https://developers.cloudflare.com/workers/platform/limits/) (2026-11-25), [pricing](https://developers.cloudflare.com/workers/platform/pricing/) (2026-12-03), [Durable Objects pricing](https://developers.cloudflare.com/durable-objects/platform/pricing/) (2026-11-13), [WebSockets](https://developers.cloudflare.com/durable-objects/best-practices/websockets/) (2026-11-18), [runtime API](https://developers.cloudflare.com/workers/runtime-apis/websockets/) (2026-11-18)
- Network, Tunnel, Load Balancing: [WebSockets](https://developers.cloudflare.com/network/websockets/) (2026-08-14), [connection limits](https://developers.cloudflare.com/fundamentals/reference/connection-limits/) (2026-11-13), [Tunnel](https://developers.cloudflare.com/tunnel/) (2026-11-18), [monitors](https://developers.cloudflare.com/load-balancing/monitors/create-monitor/) (2026-07-23), [limitations](https://developers.cloudflare.com/load-balancing/reference/limitations/) (2026-04-16), [R2](https://developers.cloudflare.com/r2/pricing/) (2026-10-30)
- Workers AI and Realtime: [pricing](https://developers.cloudflare.com/workers-ai/platform/pricing/) (2026-11-18), [limits](https://developers.cloudflare.com/workers-ai/platform/limits/) (2026-09-17), [models](https://developers.cloudflare.com/workers-ai/models/) (2026-08-12), [Realtime](https://developers.cloudflare.com/realtime/) (2026-10-19), [voice agents](https://developers.cloudflare.com/agents/agent-class/communication-channels/voice/) (2026-11-21)
- AWS (pages carry no date): [spot interruption notices](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-instance-termination-notices.html), [Auto Scaling warm pools](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-warm-pools.html), [on-demand pricing](https://aws.amazon.com/ec2/pricing/on-demand/)
- Our data: [cloudflare_coldstart.csv](https://speech.unidatum.com/data/cloudflare_coldstart.csv), [cloudflare_handoff.csv](https://speech.unidatum.com/data/cloudflare_handoff.csv), [costs.csv](https://speech.unidatum.com/data/costs.csv), [instances.csv](https://speech.unidatum.com/data/instances.csv), and the [cost model](https://speech.unidatum.com/costs/) and [EC2 benchmark](https://speech.unidatum.com/performance/#ec2) pages.

Deepgram, Nova, Flux and Aura are trademarks of Deepgram, Inc.; Cloudflare, Workers and R2 of Cloudflare, Inc.; AWS and Amazon EC2 of Amazon.com, Inc.
