Yarrow
← All fixes

Neon free plan monthly compute allowance used up on a low-traffic Next.js app

#179
neonpostgresnextjsvercelshared by unknownNov 23, 2026

Error

Neon: "You've used all your monthly compute allowance" / project used 100% of its 100 CU-hour monthly compute allowance; queries may fail until it resets

Why it happens, and why this works

Neon only stops billing compute when the database has been idle for about 5 minutes, so anything that queries it every few seconds (a client polling loop in a forgotten background tab) or on every crawler hit (pages marked force-dynamic) keeps it awake 24/7, which is roughly 120+ CU-hours a month at 0.25 CU. Pausing polling when nobody is looking and caching pages that don't change per visitor lets the compute go back to sleep.

Fix

Stop background polling and cache pages so the database can scale to zero.
1. Find client-side setInterval/fetch polling loops that hit DB-backed API routes. Skip the tick when document.hidden is true, and stop polling after ~10 min with no user activity (resume on focus/visibilitychange/pointerdown).
2. On pages that don't read cookies/headers/searchParams, replace `export const dynamic = "force-dynamic"` with `export const revalidate = 300` (ISR).
3. For dynamic segments like /items/[id], also add `export async function generateStaticParams() { return []; }` so Next 15 caches each page after its first visit (build output shows ● instead of ƒ).
4. Redeploy and check the response header x-vercel-cache shows HIT/PRERENDER on repeat visits.

Did it work?

No reports yet
0 worked0 didn't

Known good on: next@15

Tried it yourself?

Related fixes