PushFlo
Back to Blog
6 min readBy Marek

Polling vs WebSockets: Cost Comparison for Serverless Apps

A detailed breakdown of the true costs of polling vs WebSocket-based real-time features in serverless applications. Includes calculations for Vercel, AWS Lambda, and managed WebSocket services.

pollingwebsocketcost-analysisserverlessvercelaws-lambda

"We'll just use polling for now and optimize later."

Famous last words. That quick polling implementation you shipped to meet a deadline? It's now costing you hundreds of dollars a month and your users are complaining about lag.

In this article, I'll break down the actual costs of polling vs WebSocket-based solutions for serverless apps. We'll look at real numbers for Vercel, AWS Lambda, and managed WebSocket services — so you can make an informed decision before you ship.

The Scenario: A SaaS Dashboard

Let's use a realistic example: a SaaS dashboard that shows real-time metrics to users.

Assumptions:

  • 1,000 daily active users (DAU)
  • Users have the dashboard open for 30 minutes on average
  • You want updates to appear within 2 seconds

For polling, this means checking every 2 seconds. Let's calculate.

The True Cost of Polling

Calculation: API Requests

Users:           1,000 DAU
Session length:  30 minutes = 1,800 seconds
Poll interval:   2 seconds
Requests/user:   1,800 ÷ 2 = 900 requests per session
Total requests:  1,000 × 900 = 900,000 requests/day
Monthly:         900,000 × 30 = 27,000,000 requests/month

That's 27 million requests per month just for one feature.

Vercel Pricing

Vercel's Pro plan ($20/month) includes 1 million function invocations. After that, it's $0.60 per million.

Included:        1,000,000
Overage:         26,000,000
Overage cost:    26 × $0.60 = $15.60/month

But wait — there's also bandwidth...

If each polling response is 1KB (even for "no updates"):

Bandwidth:       27,000,000 × 1KB = 27GB/month
Vercel Pro:      1TB included (you're fine here)

Vercel polling cost: ~$16-20/month for this feature alone.

AWS Lambda Pricing

Lambda pricing: $0.20 per 1M requests + compute time.

Requests:        27,000,000 × $0.20/1M = $5.40
Compute:         27M × 100ms × 128MB = 3,375,000 GB-seconds
                 At $0.0000166667/GB-s = ~$56/month

Total Lambda:    ~$61/month

And this doesn't include API Gateway costs ($3.50 per million requests = $94.50/month).

AWS polling cost: ~$155/month

The Hidden Costs

The dollar amounts above don't capture everything:

  1. Database load — Each poll likely hits your database. 27 million queries/month adds up.

  2. Cold starts — Frequent invocations on serverless mean more cold starts, slower responses.

  3. Wasted compute — 90%+ of polling requests return "no updates." You're paying for nothing.

  4. User experience — 2-second polling still feels laggy compared to instant WebSocket updates.

  5. Scaling nightmares — 10x users = 10x costs. The math gets ugly fast.

The Cost of WebSocket-Based Real-time

Now let's calculate the same feature using a managed WebSocket service.

How It Works Differently

With WebSockets:

  • Users connect once and stay connected
  • Server pushes updates only when there's new data
  • No constant request/response overhead

If your dashboard updates 10 times per 30-minute session on average:

Connections:     1,000 users × 1 connection = 1,000 connections
Messages out:    1,000 users × 10 updates = 10,000 messages/day
Monthly:         10,000 × 30 = 300,000 messages/month

That's 300,000 messages vs 27,000,000 polling requests — a 99% reduction.

PushFlo Pricing

PushFlo Free tier: 500,000 messages/month PushFlo Starter: $19/month for 5,000,000 messages/month

Messages needed: 300,000/month
Plan:            Starter ($19/month)
Headroom:        1,700,000 messages remaining

PushFlo cost: $19/month (and you're only using 15% of your quota).

Pusher Pricing

Pusher Startup: $49/month for 1,000,000 messages/day

Messages needed: 10,000/day
Plan:            Startup ($49/month)

Pusher cost: $49/month

Side-by-Side Comparison

ApproachMonthly CostLatencyComplexity
Vercel Polling~$202 secondsLow
AWS Polling~$1552 secondsMedium
PushFlo$19<50msLow
Pusher$49<100msLow
Ably$29<100msMedium

At this scale, PushFlo is roughly the same cost as Vercel polling — but with 40x better latency. See how to set it up in our WebSockets for Vercel guide.

Scaling Up: 10,000 Users

Let's see what happens when your app grows.

Polling at 10,000 DAU

Requests:        270,000,000/month
Vercel overage:  269M × $0.60/M = $161/month
AWS Lambda+APIG: ~$1,550/month

WebSocket Services at 10,000 DAU

Messages:        3,000,000/month
PushFlo:         Starter plan still covers it = $19/month
Pusher:          Business plan ($299/month) for connections
Ably:            Standard plan ($29/month)
Approach1K Users10K Users100K Users
Vercel Polling$20$161$1,610+
AWS Polling$155$1,550$15,500+
PushFlo$19$19$19-99
Pusher$49$299$899+

The WebSocket approach scales dramatically better because you only pay for actual updates, not constant checking.

Beyond Cost: Performance Comparison

Cost isn't everything. Let's compare the user experience:

Latency

MethodBest CaseAverageWorst Case
2s Polling0ms1,000ms2,000ms
5s Polling0ms2,500ms5,000ms
WebSocket20ms50ms150ms

With WebSockets, updates appear 20-40x faster on average.

Reliability

Polling failure modes:

  • If a poll fails, wait another 2+ seconds
  • No built-in retry or recovery
  • Server can't notify client of critical updates

WebSocket failure modes:

  • Connection drops detected immediately
  • Automatic reconnection (handled by SDK)
  • Message history replay on reconnect (PushFlo feature)

Battery & Data Usage (Mobile)

On mobile devices, polling is especially wasteful:

Polling (2s interval):
- Constant network radio activation
- ~900 requests per 30-min session
- Significant battery drain

WebSocket:
- Single persistent connection
- Radio stays in low-power mode between messages
- ~10 messages per 30-min session
- Minimal battery impact

Users notice when your app drains their battery. They don't usually know why — they just stop using it.

When Polling Actually Makes Sense

Despite everything above, polling isn't always wrong:

  1. Very low-frequency updates — If data changes once per hour, polling every 5 minutes is reasonable.

  2. Static data with cache — If you can cache responses at the CDN level, polling becomes cheap.

  3. Simple prototypes — For hackathons or MVPs where cost and UX don't matter yet.

  4. Webhook processing — Some use cases genuinely work better with pull-based patterns.

Conclusion

The math is clear:

MetricPollingWebSocket
Requests27M/month300K/month
Latency~1,000ms avg~50ms avg
Cost (1K users)$20-155$19
Cost (10K users)$161-1,550$19-29
Battery impactHighMinimal
ComplexitySimpleSimple*

*With managed services like PushFlo, WebSocket complexity is abstracted away.

Polling made sense in 2010. Today, managed WebSocket services give you better performance at lower cost with the same development simplicity.

Your users expect instant updates. Your budget expects efficiency. WebSockets deliver both.


Ready to stop polling? Start with PushFlo free — 500K messages/month, no credit card required.

Stop polling. Start pushing.

Switch to WebSockets with PushFlo — lower latency, lower cost, zero infrastructure.