DEV Community

Roberto Luna
Roberto Luna

Posted on

Disabling a Vercel Cron to Stop “Compute Quota Exceeded” on Neon

Disabling a Vercel Cron to Stop “Compute Quota Exceeded” on Neon


TL;DR:

I removed the nightly Vercel cron that hit our Neon DB’s free‑tier compute quota. The change was a one‑line edit to vercel.json, but it prevented costly errors and gave me a chance to rethink our sync strategy.


The Problem

Running tvview on Vercel, I had a cron job scheduled to hit /api/cron/sync every day at 09:05 UTC:

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

The endpoint performs a bulk sync with our Neon PostgreSQL instance. On the free tier, Neon limits compute usage to 1,000,000 ms per day. After a few days of running the cron, the logs started showing:

2026-07-29 09:05:12 UTC - Neon: Compute quota exceeded
Enter fullscreen mode Exit fullscreen mode

The error bubbled up to Vercel, causing the cron job to fail and the deployment to enter a “errored” state. I had to stop the cron to keep the site live, but that also meant losing our nightly data sync.


What I Tried First

  1. Increase the Neon compute quota – Not an option on the free tier.
  2. Throttle the sync – I added a small sleep loop inside /api/cron/sync, but the job still exceeded the quota because the total runtime was still >1 ms per operation.
  3. Move the sync to a separate serverless function – I created a new /api/cron/async-sync that used setImmediate to defer work, but Vercel still billed the entire function runtime, so the quota hit remained.
  4. Adjust the cron schedule – I tried running it at 02:00 UTC instead of 09:05, but the quota was still exceeded because the total runtime didn’t change.

After trying these, I realized the simplest fix was to disable the cron entirely and handle the sync manually or via a different trigger.


The Implementation

Step 1: Edit vercel.json

I removed the crons section entirely, leaving an empty configuration object:

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

Commit hash: ad42e116. Commit message: chore: disable nightly cron sync — Neon free tier compute quota exceeded.

Step 2: Verify Deployment

After pushing the change, Vercel re‑deployed tvview without any scheduled jobs. The deployment logs confirmed that no cron was scheduled:

2026-07-29 10:02:45 UTC - Vercel: No crons configured
Enter fullscreen mode Exit fullscreen mode

Step 3: Update Documentation

I updated the README to reflect the new sync strategy. Instead of relying on a cron, I added a manual trigger endpoint:

// pages/api/cron/manual-sync.ts
import { syncDatabase } from '@/lib/sync';

export default async function handler(req, res) {
  if (req.method !== 'POST') {
    res.setHeader('Allow', 'POST');
    return res.status(405).end('Method Not Allowed');
  }

  try {
    await syncDatabase(); // performs the same logic as cron/sync
    res.status(200).json({ status: 'success' });
  } catch (e) {
    console.error(e);
    res.status(500).json({ status: 'error', message: e.message });
  }
}
Enter fullscreen mode Exit fullscreen mode

Now the sync can be invoked via a secure webhook or a manual HTTP call.


Key Takeaway

When a scheduled job repeatedly hits a provider’s quota, the quickest path to stability is to remove the trigger and replace it with a controlled, on‑demand mechanism.

In this case, a one‑line JSON edit saved the project from continuous failures, but it also highlighted the importance of monitoring compute usage and aligning job frequency with quota limits.


What's Next

  1. Implement a queue‑based sync – Move the heavy sync logic into a background worker (e.g., using BullMQ) that can be rate‑limited and retried safely.
  2. Add metrics – Expose a /metrics endpoint that reports Neon compute usage; hook it into Prometheus for alerting.
  3. Explore paid Neon tier – If the sync becomes essential daily, consider upgrading to a tier with higher compute limits.
  4. Automate cron re‑enable – Use a feature flag to toggle the cron on/off based on a database flag, allowing us to resume nightly syncs once quotas are increased.

By shifting from a hard‑coded cron to a flexible, monitored sync process, we’ll avoid hitting compute limits again and keep our data pipeline robust.


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



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

Repo: zaerohell/tvview · 2026-07-29

#playadev #buildinpublic

Top comments (0)