Back to blog
System Design Architecture Vercel Serverless Cost SaaS

Polling vs Pub/Sub: Stop Paying Your Server to Say "Nothing New"

By Ken B Portfolio · Published on November 4, 2026
Illustration of a developer working at a laptop

Your hosting bill grows faster than your users. Often the reason is a screen that keeps asking the server “anything new?”, and the answer is almost always no.

Serverless hosts like Vercel bill for every request and every second the server is busy. So a question with an empty answer still costs money.

The problem: polling

I found this in a job-alert app I built. Its dashboard showed new jobs without a refresh button. It did that by asking the server for the full job list every 10 seconds while the page was open.

New jobs only arrive a few times an hour. So almost every answer was “nothing new”, sent back as a full list of up to 100 jobs.

Today: the dashboard asks for all jobs every 10 seconds, plus other repeated calls shown in red

In two minutes that is 12 questions. 11 of them come back empty. For one busy user, I counted about 10,000 requests a day from the code.

Polling asks 12 times in 2 minutes; pub/sub fetches once, right when new jobs arrive

The fix: pub/sub

Pub/sub means publish / subscribe. Whoever has news publishes it. Whoever wants it subscribes and gets told.

  • The dashboard subscribes to its own channel and waits.
  • When new jobs are saved, the server publishes one short note: “new jobs”.
  • The dashboard gets the note and fetches the new jobs once.

Now only real work starts the server: a job check that finds something. The dashboard costs nothing while it waits.

After: the server sends a note through a pub/sub service, and the dashboard fetches once

Why a separate service holds the line

To be told about news, the dashboard needs a connection that stays open all day. A serverless function bills an open connection like a phone call, by the minute.

So a pub/sub service (here: Ably) holds those open connections. Its free plan covers 200 open dashboards; after that it is $29 a month. The server only makes a one-second call to it when there is news.

Who sees what

Each user has their own channel. The server hands each dashboard a pass that opens only that channel. The note says “new jobs” and nothing else. The jobs themselves come from the server, which checks the login. No user can see another user’s data.

Same idea, four more places

The same app had four other “busy for nothing” habits. The fix is the same each time: do work only when something happened.

HabitNowAfter
Activity log from the browser extensionevery minute, all nightonly real events
Extension settingsdownloaded hundreds of times a dayonly after an edit
Alerts (email, chat)sent one at a timesent together
Databasekept awake all nightsleeps when idle

What it saves

My estimate from the code: hosting for one heavy user drops from about $3–6 a month to about $0.40. Users see no change: same jobs, same alerts, same speed.

These are estimates. I will measure the real numbers on the hosting bill the week before and the week after the change.

Check your own app

You can spot this without reading code. Ask your developer:

  • Which screens update by themselves? For each one: does it ask on a timer, or is it told?
  • How often does that data really change? If it changes a few times an hour, a 10-second timer is almost all waste.
  • Is the hosting billed per request? On serverless hosts, every empty answer is on the bill.
  • What happens when the push service is down? The screen should fall back to a slow check, not go blank.

Polling is fine when the data changes every few seconds anyway, when few people keep the screen open, or when the server costs the same whether it is busy or not.

More on what grows your bill as users grow: SaaS scaling readiness checklist.

You don’t need to find these yourself. I read the code, count what each screen asks for and how often, and make the change. Your users see the same app.

The short version

Polling pays the server to say “nothing new” all day. Pub/sub lets the server speak only when there is news.

How does your app’s dashboard stay up to date today?

ISYOURAPPPAYINGFORNOTHING?

Tell me how your dashboard stays up to date and I'll tell you what it costs per user, and what it should.

More Posts

All posts