MONII Glossary Function duration
Glossary

Function duration

Memory allocated multiplied by execution time. The fastest-moving line item on either platform — a loop here can do real damage inside an hour.

What it is. Serverless execution billed as GB-hours: memory allocated multiplied by time running. A 1 GB function running for one hour is one GB-hour.

Two dials, and both multiply. Doubling memory doubles the cost even if the function finishes just as fast.

What makes it go up.

  • Retry loops without backoff. The worst case on this entire list — invocations and duration climb together, and it compounds.
  • Functions calling functions, especially anything that can reach itself indirectly.
  • Waiting on slow external APIs. You are billed for the wait, not the work.
  • Over-provisioned memory on functions that do not need it.

How to reduce it.

  1. Timeouts on every outbound call. A function blocked on a hung request bills the entire time it waits.
  2. Exponential backoff and a hard retry cap. Not "retry until success".
  3. Right-size memory. Measure, do not guess upward.
  4. Add a depth guard if a function can trigger itself.
  5. Cache, so the function does not run at all.

Related: Why is my Vercel bill so high?

Watch it before it bites

MONII tracks Vercel and Netlify usage and alerts at a threshold you choose, with a kill switch to pause a runaway project.

Get MONII for iOS ›