What 10,000 WebSocket connections actually cost on Vercel, Cloudflare, and a VPS
By Nihar Ranjan Das · Mon Oct 19 2026 · 8 min read · 0 views
View as a Web StorySoftware#vercel#hosting#pricing#websocket#cloudflare

A plain VPS costs a flat $24 a month in our model. The workload: 10,000 idle WebSocket connections, one message a minute each. Cloudflare Durable Objects costs roughly $32 a month for the same workload. Vercel Functions costs roughly $149. Those numbers come from each platform's own published pricing, applied to one explicit workload, with every assumption shown.
Why idle WebSocket connections are a different billing problem than requests
Most serverless pricing is built around short-lived requests, for example an API endpoint that wakes a function up, does work, and returns within milliseconds. A WebSocket connection breaks that model, because it can stay open for minutes or hours with almost nothing happening most of that time. How a platform charges for that idle stretch decides which platform is cheap for this specific shape of workload. Nothing, a reduced rate, or the same rate as active work are the three options, and each platform picks differently.
Resident memory while idle is a server-side engineering concern we measured directly: WebSocket vs SSE vs Socket.IO: we measured the memory, not the opinions. This post is the matching billing question: once you know a connection costs some amount of RAM, what does each hosting platform charge you for holding that RAM open?
The workload we priced
Our methodology fixes one scenario and runs it through each platform's own published rate card. This keeps the comparison fair across three very different billing models:
- 10,000 simultaneous WebSocket connections, held open continuously for a 30-day month.
- Each connection receives one message per minute — a light chat or notification workload, not a high-frequency trading feed.
- No burst traffic modeled — a steady, even rate across the month.
Every number below is this workload, priced against each platform's own documentation. Change the message rate or connection count and every number changes with it — the method is what's reusable, not the dollar figures.
Cloudflare Durable Objects: $32/month modeled
A GB-second is a billing unit equal to one gigabyte of memory held for one second. Serverless platforms use it to meter memory consumed over time, not just duration.
Durable Objects is Cloudflare's stateful compute primitive. It's the platform's recommended way to hold long-lived WebSocket connections. Each Durable Object instance can hold one or more sockets and persist state between messages. Its WebSocket-specific pricing has two parts, per Cloudflare's pricing page:
- Requests: incoming WebSocket messages count toward the request allowance at a 20:1 ratio — 20 messages bill as one request. At 432 million messages in our 30-day workload (10,000 connections × 1 message/minute × 60 × 24 × 30), that's 21.6 million billed requests. The paid plan includes 1 million requests monthly, then charges $0.15 per million for the rest — about $3.09 for this workload.
- Duration: billed in GB-seconds, but only while a Durable Object is actively processing, not while hibernating. Cloudflare's Hibernation API lets an idle object stop billing for duration — a GitHub docs discussion notes hibernation starts after roughly 10 seconds of inactivity. Modeling 50 milliseconds of active processing per message, at a 128 MB Durable Object, gives roughly 2.7 million GB-seconds for the month. The plan includes 400,000 GB-seconds, then charges $12.50 per million — about $28.75 here.
Total: roughly $3.09 + $28.75 = $31.84 a month, above the $5 monthly minimum Cloudflare's paid plan already requires.
Vercel Functions: $149/month modeled
Vercel Functions gained WebSocket support through experimental_upgradeWebSocket(), documented on Vercel's Functions pages. A connection stays pinned to one function instance for its lifetime once the upgrade completes. Vercel's Fluid Compute pricing has three meters that matter here:
- Provisioned Memory: billed in GB-hours for the instance's entire lifetime, including idle time. Unlike Cloudflare's hibernation model, there's no documented way to stop paying for memory while a connection sits quietly open. Modeling 10 function instances, each holding 1,000 connections with 1 GB of provisioned memory running continuously for 720 hours, gives 7,200 GB-hours total. At $0.0106 per GB-hour, with 360 GB-hours included, that's roughly $72.50.
- Active CPU: billed only while code actively executes, not while a connection idles. Modeling 5 milliseconds of CPU time per incoming message across 432 million messages gives roughly 600 CPU-hours. At $0.128 per hour, with 4 hours included, that's roughly $76.29.
- Invocations: at $0.60 per million, with the WebSocket upgrade itself as the billed invocation rather than each message, 10,000 connection-opens costs a negligible fraction of a cent.
Total: roughly $72.50 + $76.29 = $148.79 a month.
Advertisement
A plain VPS: $24/month flat
A VPS, or virtual private server, is a slice of a physical machine rented at a flat monthly rate, with no metering tied to requests, connections, or messages. A 4 GB VPS is a mid-tier instance from any major provider, commonly around $24 a month. It runs a plain Node.js process with no per-connection or per-message billing at all. Our own measured figures, from testing raw ws WebSocket connections directly, put server memory at roughly 11.4 KB per idle connection. That means 10,000 connections cost about 114 MB of RAM, comfortably inside a 4 GB instance with enormous headroom for message processing, TLS overhead, and growth. The monthly bill doesn't move whether those connections send one message a minute or ten.
| Platform | Modeled monthly cost |
|---|---|
| VPS (4 GB) | $24 |
| Cloudflare | ~$32 |
| Vercel | ~$149 |
What drives each number. The VPS is fixed, regardless of connections or messages. Cloudflare is mostly message-volume billing, with hibernation limiting the idle cost. Vercel bills Provisioned Memory for the full idle connection lifetime.

How a bursty workload changes the ranking
The workload above is deliberately the case that favors a VPS and Cloudflare: long-lived, mostly idle connections. A different shape of traffic tells a different story. Consider 10,000 connections that each open, exchange ten rapid messages over two seconds of real work, then close — repeating that cycle once an hour instead of staying open continuously.
That workload barely touches Vercel's Provisioned Memory meter. Each connection's instance only needs to stay allocated for the few seconds it's actually active, not the full month. Active CPU becomes the dominant Vercel cost instead, and it scales with real work done, not wall-clock time. Cloudflare's Durable Objects follow a similar shift: with hibernation kicking in almost immediately between bursts, both its request-count and duration billing shrink toward the message volume alone. The VPS, by contrast, still costs the same flat $24 — it was never metering activity in the first place, so a workload doing less idle waiting doesn't make it any cheaper.
This is the general shape of the tradeoff. A VPS's cost is a ceiling that doesn't move with usage. Vercel's and Cloudflare's costs are floors that rise and fall with how much idle time your actual traffic generates. The workload we priced above sits deliberately close to the idle-heavy end of that range, where the floor for serverless platforms is highest relative to the VPS ceiling.
Why the gap is this large
The VPS and Cloudflare numbers are both close to each other and far below Vercel's, for related reasons. A VPS doesn't meter idle time at all — you've already paid for the box. Cloudflare's hibernation API is purpose-built to approximate that: it stops billing duration once a Durable Object goes quiet, so an idle connection costs almost nothing beyond its share of the message-count billing.
Vercel's Provisioned Memory meter has no equivalent documented idle discount for this use case. It bills for the memory an instance holds for as long as the instance is alive, whether that memory is doing anything or not. For a workload defined by mostly-idle connections, that is the single biggest line item in the model. It is also why this comparison flips as the workload changes. A bursty workload with short-lived connections and heavy Active CPU use, rather than many quiet, long-lived ones, would shrink Vercel's Provisioned Memory bill and could change this ranking entirely.
What to actually do with this
If your workload is mostly idle, long-lived connections, a VPS or Cloudflare's hibernation-aware billing are the cheaper starting points on paper, by this model. Think of a chat app with quiet hours, a dashboard nobody's actively watching most of the day, or a notification channel. If your workload is bursty and connection-light instead, where connections open, do real work, and close quickly, the picture changes. Vercel's per-invocation and Active CPU billing stops penalizing you for idle time you're not actually generating. The platform's other infrastructure conveniences may then be worth the premium on this specific cost line.
Either way, run this same method against your own actual connection count and message rate before committing to a platform on cost alone — consider logging real connection duration and message frequency for a week before modeling anything. The ranking above is for one workload, with the assumptions stated — your traffic shape can move these numbers by an order of magnitude in either direction.
A checklist before you pick a platform
- Count your actual connection pattern first. Mostly idle and long-lived, or bursty and short-lived? That single fact predicts which platform wins in this model more than any feature comparison.
- Re-run this method with your own numbers. Connection count, message rate, and average processing time per message all move the result, sometimes by an order of magnitude.
- Check whether your workload needs Cloudflare's or Vercel's other infrastructure, like edge routing, built-in auth, or a framework integration already in place. A cost difference this size can still be worth paying for convenience you'd otherwise build yourself.
- Revisit the model after launch, not just before. Real traffic patterns rarely match the estimate exactly. A platform that looked cheap on paper can surprise you once usage settles in. Vercel's own usage dashboard and Cloudflare's analytics both expose the real per-meter numbers once you're live.
- Treat a VPS's simplicity as a cost too. It is cheapest on paper here, but patching, scaling, and failover are now your job instead of the platform's.
Advertisement
FAQ
Does Vercel charge for idle WebSocket connections?
Yes, through its Provisioned Memory meter, which bills in GB-hours for the entire time a function instance holding a WebSocket connection stays alive, including idle time, since Vercel's documentation describes no hibernation mechanism that pauses this billing the way Cloudflare's does for Durable Objects.
How does Cloudflare bill WebSocket messages on Durable Objects?
Incoming WebSocket messages count toward the request allowance at a 20:1 ratio, so 20 messages bill as a single request, per Cloudflare's Durable Objects pricing page. Combined with the Hibernation API, which stops duration billing once an object goes idle, this keeps the cost of a mostly-quiet connection low relative to its message count alone.
Is a VPS cheaper than serverless WebSocket hosting?
For a workload of many long-lived, mostly idle connections, yes, in our model - a VPS charges a flat monthly rate regardless of connection count or message volume, while both Vercel Functions and Cloudflare Durable Objects meter some combination of memory, duration, or message count that scales with how long connections stay open.
What is Vercel's Active CPU pricing for Functions?
Active CPU is billed per CPU-hour, only while code is actively executing rather than idling or waiting on I/O, starting at $0.128 per hour on the Pro plan with 4 hours included monthly, according to Vercel's Functions pricing documentation.
Comments
Loading…
Sign in to join the conversation.
Related posts

What Claude's new OpenTelemetry traces actually send out
Claude API OpenTelemetry traces are now in public beta, and the default setting sends no prompts at all. We ran the Anthropic Python SDK against a mock server and counted what leaves your app.
Mon Oct 19 2026 · 10 min read · 0 views

Porting AutoGen to Microsoft Agent Framework: what breaks
An AutoGen to Microsoft Agent Framework migration is mostly a rename, except for four defaults that change silently. We ported a two-agent writer and reviewer team on Python 3.15.0, from AutoGen 0.7.5
Mon Oct 19 2026 · 10 min read · 0 views

MCP went stateless: what breaks when versions mix
The MCP 2026-07-28 migration is less frightening than the headlines suggest. The Model Context Protocol removed sessions and its connection handshake, and the official MCP blog says the release
Mon Oct 19 2026 · 10 min read · 0 views