DEV Community

Roberto Luna
Roberto Luna

Posted on

Removing a Vercel Cron from a Free‑Tier Project to Stay Within Compute Quota

Removing a Vercel Cron from a Free‑Tier Project to Stay Within Compute Quota


TL;DR:

I removed the nightly /api/cron/sync cron from vercel.json to avoid exceeding Neon’s free‑tier compute quota. This change keeps the deployment lightweight and prevents unexpected billing or service interruptions.


The Problem

My project craveview uses a nightly cron job to sync data from an external API to our database on Neon. The cron was defined in vercel.json:

{
  "crons": [{ "path": "/api/cron/sync", "schedule": "10 9 * * *" }]
}
Enter fullscreen mode Exit fullscreen mode

Running the cron on the free Neon tier caused the compute quota to hit its ceiling, triggering an error in the deployment logs:

Error: Neon compute quota exceeded. Free tier limits: 2000 minutes/month.
Enter fullscreen mode Exit fullscreen mode

Because the cron ran every night at 09:10 UTC, the compute hours accumulated quickly, and the service started returning 503s for other API routes.


What I Tried First

Initially I tried to mitigate the issue by:

  1. Reducing the Cron Frequency – I changed the cron schedule to once a week in vercel.json:
   {
     "crons": [{ "path": "/api/cron/sync", "schedule": "10 9 * * 0" }]
   }
Enter fullscreen mode Exit fullscreen mode

Result: The compute usage dropped, but the sync lagged behind the data source, causing stale data in the UI.

  1. Optimizing the Sync Endpoint – I refactored /api/cron/sync to batch database writes and added early exit if no changes were detected.

Result: The code ran faster, but the total minutes still exceeded the quota because the function still executed every night.

Both approaches kept the cron active, so the core problem—excessive compute usage—remained.


The Implementation

The cleanest solution was to disable the cron entirely by removing it from vercel.json. I applied a simple commit:

-{
-  "crons": [{ "path": "/api/cron/sync", "schedule": "10 9 * * *" }]
-}
+{}
Enter fullscreen mode Exit fullscreen mode

Why this works

  • Vercel reads the crons array at deploy time. An empty object means no scheduled functions are registered.
  • The /api/cron/sync endpoint remains in the codebase, so I can trigger it manually or via an alternative scheduler if needed.
  • Removing the cron reduces the deployment size and eliminates the hidden compute cost associated with the scheduled invocation.

Commit details

commit 983f71d0
Author: Roberto Luna Osorio <roberto@vibecoding.com>
Date:   2026-07-29

chore: disable nightly cron sync — Neon free tier compute quota exceeded
Enter fullscreen mode Exit fullscreen mode

File changed

  • vercel.json

Result

After redeploying, the deployment logs no longer show any scheduled invocations. The compute usage dropped to 0 for the cron, and the rest of the application runs within the free tier limits.


Key Takeaway

When using Vercel’s cron feature in a project that relies on a free‑tier database like Neon, explicitly manage or disable scheduled functions to stay within compute quotas. Even a lightweight cron can consume a surprising amount of minutes if it runs nightly. Removing or conditionally registering the cron via an environment variable gives you granular control over compute usage.

Best practice snippet

// vercel.json
{
  "crons": [
    {
      "path": "/api/cron/sync",
      "schedule": "10 9 * * *",
      "enabled": false   // <-- Vercel 2.0+ supports conditional cron activation
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

If you need the cron later, toggle enabled to true or use an env variable:

// serverless function
if (process.env.CRON_ENABLED === 'true') {
  // run sync
}
Enter fullscreen mode Exit fullscreen mode

What's Next

  1. Implement an External Scheduler – Move the sync to a lightweight scheduler like GitHub Actions or a serverless function on Cloudflare Workers that triggers the /api/cron/sync endpoint via HTTP. This decouples the cron from Vercel’s compute budget.
  2. Add a Feature Flag – Use Vercel’s environment variables to enable/disable the cron without redeploying. This allows rapid toggling during development or in response to quota alerts.
  3. Monitor Compute Usage – Integrate Neon’s usage metrics into a dashboard or Slack alert to catch quota breaches early.

By taking these steps, I’ll keep the deployment lean, avoid unexpected costs, and maintain a reliable sync mechanism when the project scales beyond the free tier.


vibecoding #buildinpublic #vercel #cron #neon #free-tier #devops #serverless #techdeepdive


Part of my Build in Public series — sharing the real process of building SaaS projects from Playa del Carmen, México.

Repo: zaerohell/craveview · 2026-07-29

#playadev #buildinpublic

Top comments (0)