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'

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