Scheduled Jobs not running at reliable frequency

Vote:
 

We have a client for whom we piggyback some SignalR based travel information screens on the back of EPiServer 7.19. These travel info screens download information from third-party APIs via scheduled jobs, process the data, then send this to the webclients via SignalR for display.

It's important this data is fresh, so the jobs are set to run once per minute. However, we're seeing that this frequency is frequently missed, despite the jobs only taking seconds to run, resulting in complaints from the client about stale data. Here's an example of run times from earlier today, with intervals ranging from 1 minute to 3:

 

05/11/2017 14:10
05/11/2017 14:09
05/11/2017 14:06
05/11/2017 14:05
05/11/2017 14:03
05/11/2017 14:01
05/11/2017 13:59
05/11/2017 13:56
05/11/2017 13:55
05/11/2017 13:54

 

This is a mature site with quite a few scheduled jobs, and we're only running the scheduler on a single server in the farm, so I'm not sure if that's a factor. Does anyone know the answers to the following:

  1. How frequently does the EPiServer Scheduler check to see if any jobs need running?
  2. Is there a limit on the maximum number of concurrent jobs that the scheduler will run?
  3. Regardless of the answer to 2, would enabling the scheduler on further servers be likely to improve this situation? This would require some code changes to a few jobs which use static variables.

Cheers,

Alex

#178486
Edited, May 11, 2017 16:52
Vote:
 

Job runs according to schedule defined in table tblScheduledItem but if one cycle have been missed and job was still running then it will be picked in next cycle (isRunning = 1 means job is running). Some how Job is still running. Is there any awaitable task in your signalR broadcasting? Adding some logging for processing time may help.

/K

#178490
May 11, 2017 17:32
Vote:
 

Picking this one back up after a bit of a gap. We've now enabled scheduled jobs on multiple nodes, but this doesn't seem to have improved the frequency of the scheduled jobs.

Job runs according to schedule defined in table tblScheduledItem but if one cycle have been missed and job was still running then it will be picked in next cycle (isRunning = 1 means job is running).

Yup, that's all familiar stuff - the question is how often do those cycles run? The UI lets me set scheduled job frequency down into the seconds, but I can't see the job in question reliably running any more frequently than once every two minutes. I haven't put timers on, but I have watched a run at 14:10, take around 5 seconds to complete, then not run again until 14:13, despite the next run being set for 14:11.

Interestingly, if I disable all other scheduled jobs in staging apart from the one I'm monitoring, it reliably runs once a minute, so I think there must be some undocumented built-in limiting on the number of jobs which are run concurrently, regardless of how many nodes the scheduler is running on.

Can anyone from EPiServer shed light on this situation? I don't suppose (hope of hopes) there's an undocumented config setting I could use to raise this threshold?

#181088
Edited, Aug 08, 2017 15:34
Vote:
 

Not the exact solution you are looking for, but if you are willing to add some customised code, you can reliabliy setup the timer you want. The following blog post will be helpful.

http://marisks.net/2015/05/04/episerver-working-with-scheduled-jobs-programmatically/

#181089
Aug 08, 2017 15:48
Vote:
 

I don't think that solves the problem - that just appears to just set the Next Execution time programmatically. The stated Next Execution time here is fine, but EPiServer isn't managing to achieve it.

#181090
Aug 08, 2017 15:52
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.