In Cheap enough to give away I wrote that madtown.today's bill is almost entirely a “who's here” heartbeat. That came from the README, which I wrote when the heartbeat was the only live thing on the page. Then I opened the actual bill. The heartbeat is a small part of it. This note is what I found, and the plan to make madtown.today cost about as much as Dungeon Garden does, written before I start, so I can check it against what really happens.
The bill
What madtown.today costs to run is the $15 Upstash Redis database, for about 376 visitors a day. The site itself is on Vercel Pro, which is my own choice: I upgraded when my build and test runners went past the free plan's CPU time, and nobody using the site pays for it. Pro is a $20 fee that includes $20 of usage, so anything past $20 of usage is extra. Counting it all, I pay about $45 a month. One Vercel billing cycle, 24 October to 21 November, looked like this:
| Vercel line | Usage | Charge |
|---|---|---|
| Observability Plus events | 13.97 million events | $13.45 |
| Functions (CPU, invocations, memory, transfer) | 4.56 million invocations, 22 hours of CPU | $7.05 |
| Builds | 26 hours of build CPU | $5.25 |
| Function and deployment storage | 22 GB-months | $2.24 |
| Web Analytics | 38,300 events | $1.15 |
| CDN requests and transfer | 2.78 million requests, 14 GB | $0.15 |
| Total usage | $29.29 | |
The site's own stats count 10,914 visitor-days in the same 29 days, between 285 and 575 a day. So Vercel alone came to about 0.27¢ per visitor per day, and almost all of that grows with traffic. It isn't a flat fee that more people could share for free.
What I got wrong
I'd guessed the build and test runners were the expensive part. They're part of it, but three other things matter more.
- The biggest line is a monitoring add-on. Observability Plus keeps 30 days of logs and traces, and charges $1.20 per million events. It was 46% of the Vercel usage. Vercel now turns it on by default for new Pro teams. The free version keeps a day of history, which is plenty for a site this size. Turning it off is a toggle in the billing settings.
- The room, not the heartbeat. The Who's here card grew into a little shared room: you can wave at people and paint pixels on a canvas together. To keep that live, every open tab asks the server for the room every 4 seconds whenever two or more people are on the page. That's 15 requests a minute per tab, each about 12 Redis commands, next to 2 heartbeats a minute. 4.56 million function calls in 29 days is about 157,000 a day, or about 420 for each visitor. Almost none of them are people doing something. They're open tabs asking whether anything changed.
- A build for every branch. Vercel builds a preview of every branch pushed to the repository, and the repository has about 275 branches. Each build runs the full test suite first, which also runs on GitHub. That's the $5.25.
GitHub Actions turned out to be the cheap part. The $15 is a budget, not usage: the repository runs well inside the 2,000 minutes a month that a private repository gets for free.
The plan
The rule I took from Dungeon Garden is that the bill should grow with what people do, not with how long they keep a tab open. madtown.today breaks it in the most literal way: a tab open on a quiet afternoon costs money every 4 seconds.
Dungeon Garden fixed the same problem with a Cloudflare Durable Object: one small server-side object that browsers keep a WebSocket open to. Being connected is being here, so there's no heartbeat. When someone waves or paints, the object tells everyone. When nothing happens, it sleeps and isn't billed. Only the connection counts as a request, messages from browsers count as one request per 20, and messages to browsers are free. At madtown.today's size, that's a couple of thousand billed requests a day, against a free allowance of 100,000.
| Step | What changes | What I pay a month | Effort |
|---|---|---|---|
| Today | Next.js on Vercel Pro, Upstash Redis | about $45 | |
| 1. Settings | Observability Plus off, previews only for pull requests, shorter retention | about $35 | an evening |
| 2. Durable Object | Who’s here, presence and live tallies over WebSockets; Upstash dropped | about $20 | about a week |
| 3. Off Vercel | The Next.js site on Cloudflare Workers, beside the Durable Object | about $5 | two to three more weeks |
Step 2 alone stops at about $20 because that's Vercel Pro's minimum, however little the site uses. Step 3 moves the site itself to Cloudflare Workers. Next.js runs there through an adapter, so the pages stay Next.js. I tried a test build with the OpenNext adapter before writing this. It built, and the homepage, the Gazette and the embeds rendered. Three things didn't work yet: the puzzles and share-image fonts are read from disk, which a Worker can't do, so they have to be bundled into the build; the adapter needs a slightly newer Next.js; and its support for the request middleware is still experimental.
The $5 is Cloudflare's paid Workers plan. The free plan allows 10 ms of CPU per request, and on Vercel madtown.today averaged about 17 ms per call, so I'm planning on paying it.
How many people the free plan would carry
A rough guess, until there are real numbers to check it against. Once the 4-second polling is gone, a visit is mostly loading the page, starting and finishing a few puzzles, voting on the day's question and staying connected to the room. I count that as about 20 to 50 requests a person a day that reach a Worker. Static files like scripts, fonts and images don't count, because Cloudflare serves those for free.
- Requests: the free plan allows 100,000 a day, so that's roughly 2,000 to 5,000 people a day. The room barely adds to it: being connected is one request, and only one in every 20 messages from browsers is billed.
- CPU is the real limit: a free Worker gets 10 ms per request, and a server-rendered page takes longer than that today. The free plan would hold the room on its own, but not the whole site, unless the pages get a lot lighter.
- On the $5 plan: 10 million requests a month is about 330,000 a day, so around 6,000 to 15,000 people a day before any extra cost.
Today's traffic is about 376 a day, so either plan has plenty of headroom. I'll replace these guesses with the real request counts after the move.
What stays the same
Nobody should notice any of this. The puzzles, the streaks and the Who's here room work the same way. Streaks live in each person's browser, so a new server can't lose them. The count of people here now should update faster, because it's pushed instead of polled.
What I'll check afterwards
Every number above about the future is an estimate. When each step ships, I'll come back with the next full billing cycle and the request counts, and update this note with what it actually cost.
Prices used
Checked on 22 November 2026.
- Vercel Pro: $20 a month including $20 of usage. Observability Plus: $1.20 per million events.
- Durable Objects: free plan 100,000 requests and 100,000 rows written a day. Incoming WebSocket messages count 20 to a request, and outgoing ones aren't billed.
- Cloudflare Workers: free plan 100,000 requests a day. Paid plan $5 a month with 10 million requests. Static files are free. Limits: 10 ms of CPU per request on the free plan.
- Upstash Redis: $0.20 per 100,000 commands, or fixed plans from $10 a month.