Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Scheduler running multiple instances?Scheduler running multiple instances?
Previous
 
Next
New Post
8/12/2010 11:55 AM
 

Hi,

I've developed a number (4) of my own custom tasks that are scheduled via the Host->Schedule menu. After monitoring the schedule history I noticed something weird and I dont know why its happening. It losks like the scheduler is running multiple instances. There is multiple entries in the schedule history for each of my tasks. For example even though each of my tasks is set to run every 5 minutes I get something like this in the history (see below) - note how closely the events are occuring. After the expected (5 minute) interval has elapsed there will be another batch of entries in the log. (There could be as many as 9 entries per batch - I've truncated them for brevity).

Description Duration Succeeded Start/End/Next
CompanyName.ModuleName.MyTask1Class,CompanyName.ModuleName 
My task completed successfully message
0 True S: 12/08/2010 16:12:19
E: 12/08/2010 16:12:19
N: 12/08/2010 16:17:19
CompanyName.ModuleName.MyTask1Class,CompanyName.ModuleName 
My task completed successfully message
0 True S: 12/08/2010 16:12:18
E: 12/08/2010 16:12:18
N: 12/08/2010 16:17:18
CompanyName.ModuleName.MyTask1Class,CompanyName.ModuleName 
My task completed successfully message
0 True S: 12/08/2010 16:12:18
E: 12/08/2010 16:12:18
N: 12/08/2010 16:17:18
CompanyName.ModuleName.MyTask1Class,CompanyName.ModuleName 
My task completed successfully message
0 True S: 12/08/2010 16:12:16
E: 12/08/2010 16:12:16
N: 12/08/2010 16:17:16
CompanyName.ModuleName.MyTask1Class,CompanyName.ModuleName 
My task completed successfully message
0.147 True S: 12/08/2010 16:12:15
E: 12/08/2010 16:12:15
N: 12/08/2010 16:17:15

Perhaps someone has an idea as to what's up? First some background on how I've configured things.

All my task classes are part of a single assembly (e.g. CompanyName.ModuleName.dll). In the scheduler my tasks are configured like this:

The Full Class Name and Assembly setting for each of the tasks is similar (differing in the class name only). For example:

CompanyName.ModuleName.MyTask1Class,CompanyName.ModuleName
CompanyName.ModuleName.MyTask2Class,CompanyName.ModuleName
CompanyName.ModuleName.MyTask3Class,CompanyName.ModuleName
CompanyName.ModuleName.MyTask4Class,CompanyName.ModuleName

Each has a Time Lapse setting of 5 Minutes and a Retry Frequency of 2 minutes.

In the Object Dependencies field I entered the name of a custom table that the events are all dependent on. Essentially each of the my events (tasks) is reponsible for querying a defined subset of records from the table and updating some values if some condition is met. A single row will only be ever be updated by one task (i.e. no 2 tasks will ever try to update the same row).

I have configured it such that the DotNetNuke Scheduler is running on Timer mode (Host->Host Settings->Other Settings->Scheduler Mode).

I developed the tasks by following the documentation (e.g. Inheriting from DotNetNuke.Services.Scheduling.SchedulerClient, making sure ScheduleHistoryItem.Succeeded is set etc.). I've stepped through my code as well (on my dev PC by attaching to the asp.net process) and no errors are occuring.

Thanks
 

 
New Post
8/12/2010 12:54 PM
 
what version of DotNetNuke are you using - an error with multiple scheduled tasks running (if the original one took longer than the retry) was fixed a little while back (during the 5.3.x series as far as I remember)

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
8/13/2010 7:47 AM
 
Hi Cathal,

Thanks for the reply.

Version 4.8.x (I've been planning to upgrade but its not an immediate priority for me).
 
The task doesn't take very long to execute at all as you might see by the duration.

I since found another article http://www.datasprings.com/News/Blog/... which suggests something else as the problem (e.g. multiple web applications/app pools within IIS for the same DNN site/directory). I checked my configuration and the server on which my site is hosted has 2 web sites (CompanyName and Microsoft Sharepoint Administration) and 2 application pools (DefaultAppPool and MSSharePointAppPool). I have a number of virtual directories all under my CompanyName web site - one for each of the DNN portals that I host. All of the virtual directories run under the DefaultAppPool. Both application pools are configured to have a maximum number of 1 thread (see application pool properties, performance, web garden, maximum number of worker processes).

 
New Post
2/1/2012 9:01 AM
 
Hi Norman, did you ever get this figured out? I am having the exact same issue in DNN 6.1....
 
New Post
4/4/2012 12:10 PM
 
We have this problem using DNN version 05.06.03. The installation is NOT set up as a web farm. (I checked both the Host Settings page and the web.config file). It is also NOT set up as a web garden (max worker processes = 1 for the app pool).

Original problem:
I noticed that there were 8 to 11 instances of EVERY scheduled task. The overload was causing Schedule Exceptions in the event logs.

First approach:
I tried editing the scheduled tasks and unchecking all but one of the Run on Servers checkboxes. It made no difference. Plus, when I edited the tasks a few days later, some of them came up with all of the boxes checked again.

Second approach:
Following the advice of the DataSprings blog (referenced by Norman above), I deleted unnecessary aliases in DNN and unnecessary applications belonging to the website in IIS. I deleted about 25 of each. The website still has 7 applications in IIS because we use them to access portals that are not live yet. The number of instances of scheduled tasks was reduced, and the Schedule Exceptions stopped. I had to re-add some tasks to the schedule because they stopped running entirely, even when I clicked Run Now.

Current problem:
There are still up to 4 instances of every scheduled task.

How can I get each scheduled task to run once and only once? (If the WebServers database table is related to this issue, I can add details which I leave out now for brevity. I think the contents look suspicious, but I do not know if it is relevant.)
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Scheduler running multiple instances?Scheduler running multiple instances?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out