Render Cron Jobs

I was exploring Render Cron jobs and deployed a node env to test the transition. The behaviour I noticed was, very irregular job triggers. As far as I can guess, it’s because Render is building a new instance for each job trigger and that makes it literally impossible to run anything on time.

This is my log right now. The cron is scheduled to run at every minute but it’s running at random intervals.

Feb 18 12:49:04 AM  ==> Starting service with 'node app.js'
Feb 18 12:56:17 AM  ==> Starting service with 'node app.js'
Feb 18 12:59:54 AM  ==> Starting service with 'node app.js'
Feb 18 01:04:36 AM  ==> Starting service with 'node app.js'
Feb 18 01:11:10 AM  ==> Starting service with 'node app.js'
Feb 18 01:18:58 AM  ==> Starting service with 'node app.js'
Feb 18 01:28:59 AM  ==> Starting service with 'node app.js'
Feb 18 01:36:10 AM  ==> Starting service with 'node app.js'
Feb 18 01:41:21 AM  ==> Starting service with 'node app.js'
Feb 18 01:48:44 AM  ==> Starting service with 'node app.js'
Feb 18 01:52:30 AM  ==> Starting service with 'node app.js'
Feb 18 01:56:15 AM  ==> Starting service with 'node app.js'
1 Like

Hi @ultra ,

We do launch a new container for every cron run, but that’s generally a quick process. It can be slowed down by a few different variables, like very large Docker images. We also will only run one instance of any cron job at a time, so if your cronjob is taking longer than a minute to run, that will delay the start of the next job. It may be helpful to output logs to see when each job starts and finishes to see what the timing is.

I can look at our internal logs to get more insight if you can share the link to your cronjob on the Render dashboard (it will look like https://dashboard.render.com/cron/crn-randomcharacters).

Thanks for the cronjob link in a private message. I’ve inspected your cronjob, and can confirm that the lag in scheduling your job is due to something happening at our end, but I don’t yet have information about why. Our team is looking into this, and will provide an update when we have more information.

In the mean time, a possible workaround is to create a new identical cronjob and to delete your current one. From what I can see right now, the new cron job is less likely to be affected by the same root cause of lag.

I tried recreating the same cronjob again but no luck. I really wanted to bring over all my jobs and APIs (in fact I already have) but running randomly, just defeats the purpose of a cronjob. I hope you guys will follow up after monitoring it for the cause.

Also if this isn’t isolated to my account, https://status.render.com should reflect the incident?

It looks like this is a pretty rare lag, which is why we’re not opening an incident, but it’s certainly something we’re working on fixing even for the rare cases and I agree that it’s not very useful to have your every-minute cronjob not run every minute. We’ll follow up here when we have more information.

@dan I also have this issue (irregular triggers every few minutes) with a once-a-minute scheduled cronjob that takes between two and eight seconds to execute.

Tried deleting and recreating the cronjon, but to no avail. Then tried deleting both the cronjob and its database, and recreating both in a different geography (Frankfurt), but unfortunately this only seems to have made the delays worse.

Any idea when this might be fixed, or are there any other workarounds worth trying?

Thanks.

We noticed this issue and created an internal ticket to trace it. However, we can’t provide an ETA for the solution since it involves more architecture improvement. We will update here once we release the solution.

1 Like

I am having this issue? Does it still not work. Please let me know so I can switch cron to something more reliable bc it is running randomly for something I need to run every X minutes reliably.

Yes, still unfixed as far as I can tell.

Experiencing same issue. Have cron set for every minute but its currently randomly triggering every 10 / 15 minutes

1 Like

My node environment is also experiencing intermittent execution of cron jobs. Mine is scheduled to execute every 5 minutes and it appears to have stopped last night at 23:55:00.

I also seem to be experiencing this issue.

+1 I’m experiencing this as well. This even happens with manual jobs. When I’ve triggered manually, my cron events show “Cron job run triggered by you”

But several minutes later and my logs for the job do not show the execution command nor any of the logs the job outputs.

I’m experiencing this issue as well. The logs show the cron job sometimes taking as much as 10 minutes from the trigger to the time my container actually executes and sometimes as little as a few seconds. This is upsetting my users who depend on this scheduled job. I’d also imagine that I’m being billed for these 10 minute jobs that should run in under 1 minute.

1 Like

We are also experiencing this (or something similar). In a system that I’ve been experimenting with porting from AWS (having first-class cron jobs here is wonderful), we have ~12 cron jobs that mostly need to run on a frequent schedule (usually every 5 or every 10 minutes). We need to keep up the frequency, so it doesn’t matter if there’s a small delay between the scheduled time and the actual start time as long as it’s relatively constant.

When our crons first started the delay between start time in the events tab on the dashboard and the first log line that the script is running + the runtime of the script was always well short of the next scheduled start time. However, the delay between the time shown on the events tab and the first log line increased over time until the script didn’t actually start until just before the next scheduled run (and therefore ending after the next run was scheduled to start, delaying the next run). They eventually increased so much that sometimes we see runs that “take” > 20 minutes (looking at the logs, the actual run time of the script hasn’t changed, just the delay between scheduling and running), and even sometimes pushing out so far that the script never starts and Render’s cron system is canceling the job before it ever runs. This seems like a major problem!

I’m having the same issue. My cron job needs to run at the exact time because users are waiting on it. I’ve had to revert to running manually. Is there any way I could get the cron job to run exactly at the time specified? Sometimes it can run even up to 5 minutes late.

Thank you,
Evan