infrastructure cost serverless

The Serverless Trap: When 'Auto-Scale' Kills Your Margin

Why we moved from AWS Lambda to bare metal servers and cut our infrastructure costs by 87%.

February 13, 2026 — min read

Core Concept

“Serverless” is the ultimate venture pitch: Pay only for what you use. Infinite scale. Zero DevOps.

The reality: Serverless optimizes for getting started, not for profitability.

At 1K requests/month, Lambda costs $0.20. At 10M requests/month, Lambda costs $12,000. A $50/month VPS could handle that load.

The Constraint

The hidden costs of serverless:

  1. Cold starts: 500ms-2s latency for first request (kills UX)
  2. Vendor lock-in: Lambda functions aren’t portable (good luck migrating)
  3. Expensive at scale: Per-request pricing destroys unit economics
  4. No persistent connections: Can’t hold WebSockets or long-polling
  5. Limited execution time: 15-minute max (no background jobs)

Real numbers from ZBrain AI:

InfrastructureCost/MonthRequests/MonthCost per 1M Requests
AWS Lambda$14,20025M$568
Hetzner VPS (8 vCPU)$1,80025M$72

Savings: $148,800/year.

The Solution

We use serverless for exactly 2 things:

1. Webhook Handlers (Stripe, SendGrid)

Why: Unpredictable traffic spikes. You can’t size a server for 1 webhook/hour.

Stack: AWS Lambda (or Cloudflare Workers)

2. Scheduled Jobs (Reports, Cleanup)

Why: Runs once a day. Paying for a 24/7 server is wasteful.

Stack: Lambda with EventBridge triggers

Everything else runs on dedicated servers.

The Architecture

Our standard stack:

  • API Layer: Hetzner VPS (8 vCPU, 16GB RAM, $50/month)
  • Load balancer: Cloudflare (free tier)
  • Database: Supabase (managed Postgres)
  • Object storage: Cloudflare R2 (S3-compatible, $0.015/GB)
  • CDN: Cloudflare (automatic)

Deployment: Docker Compose + Caddy reverse proxy

Cost for 10M requests/month: $200 (vs $12K with Lambda)

The Trade-Off

What you lose:

  • Auto-scaling magic (but you don’t need it until Series B)
  • “Zero DevOps” promise (you need basic Linux knowledge)

What you gain:

  • 87% cost reduction (real margin, not fake gross margin)
  • Persistent connections (WebSockets, Redis, Postgres connections)
  • No cold starts (always-on servers)
  • Portability (move providers in 1 hour with Docker)

The Investor Truth

When you pitch Series A, VCs calculate unit economics:

Bad: “Our AWS bill grows linearly with users” (red flag)
Good: “We serve 10M users on $2K/month infrastructure” (they invest)

Example: Instagram was acquired for $1B while running on a single $8K/month server cluster. Meanwhile, companies burning $50K/month on serverless never reach profitability.

The First Principle: Infrastructure should be a fixed cost, not a variable cost. Serverless inverts this, making you poorer as you grow.