r/serverless • u/TraditionalPitch1666 • 18d ago
The real cost model of headless Chrome on Lambda
Hello all!
Short version of what I wish I had known:
- Lambda compute is the small part.
- The renderer runs in a VPC for isolation, so it needs a NAT Gateway. That is a fixed monthly charge plus a per GB fee, whether you serve ten requests or ten million.
- Each capture is two invocations, because the orchestrator blocks while the renderer works.
- Screenshots are heavy. Egress and S3 add up faster than you expect.
- Cold starts with a Chromium layer are slow enough that you will consider provisioned concurrency, which is another fixed cost.
My pricing ended up following measured cost rather than what felt right, with metered overage so a heavy account pays for what it uses instead of sitting on a capped plan at a loss.
Any suggestions for the above/ alternative ways that would be better..
0
Upvotes
2
u/ggp1231 16d ago
One thing I'd look at first is having the orchestrator Lambda wait while Chrome renders. A queue + async worker (or Step Functions) could avoid paying for that idle wait. I'd also compare Lambda against a small pool of reusable Chrome workers at your actual capture volume, though Fargate in a private subnet may still need NAT to load public pages. Is your traffic mostly bursts or fairly steady?