Monitor Render cron jobs

On this page

Render promises that a cron job never has two runs at once, which means a long run delays the next scheduled one, and a run that never ends is stopped after 12 hours. Both are quiet. A ping from the job's command shows the schedule actually kept.

How can a scheduled job fail silently on Render cron jobs?

  • If a run is still active when the next is scheduled, Render delays the next scheduled run until the active run finishes. A slow job shifts every later run.
  • A manual Trigger Run while another run is active cancels the active run first. A manual test can kill a real run.
  • Render stops an active run after 12 hours. For longer or continuous work you need a different service type.
  • A command that does not exit keeps the run alive, and cron jobs are billed by running time.
  • All day and time ranges use UTC.

What are the limits of Render cron jobs?

LimitWhat the documentation says
ConcurrencyAt most one active run of a given cron job at a time.
Maximum run time12 hours; then Render stops the run.
Time zoneUTC.
BillingProrated by the second of running time, with a minimum monthly charge of $1 per cron job service.
DisksCron jobs cannot provision or access a persistent disk.

How do you add a CronMissed ping to Render cron jobs?

Set the command to a script that pings the start, runs the job and pings the exit status. The script exits with the job's status so Render also records the run as failed.

scripts/cron-digest.sh
#!/bin/sh
PING_URL="https://ping.cronmissed.com/5f0c1b2e-7a3d-4c8e-9b61-2d4f8a7e3c10"
curl -fsS --max-time 10 --retry 3 -o /dev/null "$PING_URL/start"
python manage.py send_digests
status=$?
curl -fsS --max-time 10 --retry 3 -o /dev/null "$PING_URL/$status"
exit $status

Which check settings fit Render cron jobs?

Create a cron check in UTC with the same expression. Because Render delays a run behind a long one, set the grace to the longest normal run time plus a few minutes; the start ping then separates a late start from a long run. If runs can approach 12 hours, set a start timeout on the check so a hung run alerts well before Render stops it.

How do you confirm the check works?

  1. Open the cron job's Runs page and click Trigger Run; confirm both pings.
  2. Make the command fail and confirm the check goes down and Render marks the run failed.
  3. Suspend the cron job in Render and confirm the check goes late and then down.

Sources

Questions and answers

Does the ping count toward the billed running time?
Yes, as part of the run, but a curl that finishes in a fraction of a second adds almost nothing to a bill that is prorated by the second.
What if my job needs more than 12 hours?
Render points to other service types for continuous or very long work. Whatever you choose, keep a heartbeat: ping after each unit of work so the check sees progress.
Know when this job stops

Create a check, add the ping to the job, and CronMissed alerts you the first time a run is late or reports a failure.

Start monitoring