Analysis of dnn scheduling management (iii) -- How to Use dnn Scheduling Service

Source: Internet
Author: User
Tags dnn
It's been a long time !! Haha, it was very busy some time ago !! Now it's easy !! Also in the last Article Some new skins are added to the original article. If you are interested, please take a look! After finishing the sorting, I will provide the download to everyone for communication !! Good luck!

Now, let's get down to the truth !!
DnnThe scheduling solution is inDnn2.1.1Introduced at the beginning. It provides a thread pool to manage and schedule tasks to implement the multi-thread scheduling service. This thread pool allows reuse of existing threads in the pool, without killing the threads, that is, the inefficiency of generating new threads.
Undoubtedly, creating a multi-threaded ApplicationProgramIt is cumbersome, and you have to bother to prevent reading and writing the same object at the same time by two threads. To implement a reliable multi-threaded application,DOTNETSomeReadwritelockTo lock and unlock the objects you need to perform read/write operations to achieve the bottleneck of no deadlock.
First, let's take a lookWeb. configFileDnnInformation about the scheduling service:

attribute settings :
debug - if this attribute is set to true, some records are generated for debugging dnn Scheduling Service information entries. When you debug the dnn scheduler, this will give you enough information, although debugging multi-threaded applications is a very tedious process.
maxthreads - set the maximum number of threads in the thread pool of the scheduling service, the default value is -1 , this means that this is determined by the scheduling service program (in the scheduling service, the default value is 10 ). If you set this item to a value greater than zero, this is the maximum number in the thread pool.
enabled- scheduling Service enable attributes, if it is set to fasle, , all scheduling services are prohibited.

Next let's take a look.DnnOn the top tab menu, you can find the following:

 ClickSchedule,EnterSchedulePage, for example, on this page, you can see which scheduling task has been enabled and disabled, the frequency of running the task, the interval of retry failures, and the next time you start the scheduling service. In the following table, each task has two links:A)Edit page LinkB)View historical links (as mentioned below)

You can click the edit icon in front of each task to edit the scheduling service settings page,

The parameter settings are as follows:

1) Available tasks The drop-down list includes all InBinDirectory assembly Inherited from Dotnetnuke. Services. Scheduling. schedulerclient Class,DnnIt is implemented through the launch mechanism.

2) Schedule EnabledWhether to enable or disable the scheduling service

3) Time Lapse That is, the frequency at which you want to schedule the task to run, in minutes / Hours / Days

4) Retry frequencyThe Retry Interval.

5) Retain schedule history During each task execution, the database stores records and summaries that reflect the task situation (if you read the above article, you will find that the scheduling task will call Addlognode () Method), and the setting of this field is the number of records record in the database.

6) Run on Event You can set the scheduling service to start when the program is running. Currently, only Application_start This option.

7) Catch up Enabled When this is set True If your task is scheduled every ten minutes, for example, it is suddenly terminated for some reason during Scheduling (for example When the server restarts, all previous failed tasks will be run again. For example, if your scheduling service is interrupted for an hour, it will be executed six times before it is restarted. This setting is False It will only execute the current one.

8) Object Dependencies Since the scheduling service is multi-threaded, it is necessary to avoid deadlock issues. Therefore, setting a dependency object will prevent execution conflicts between other tasks and other tasks. For example, you have a task A, Its Operation Association User Table, and simultaneously B In the update User Table. In this case, you must set them to have the same dependent objects. ( Of course, you can also set multiple dependent objects. For example, you can set tasks. B The dependent object of is "Users, usersonline, Portals" . ) In this way, when the task A Runtime , Task B They do not run because they have dependency conflicts. Only when the task A Task B starts to start!

in schedule on the page, you can move the cursor to the upper left corner, then you will see the following menu:


There are some links in the menu column. Click"View schedule status"You can go to the view scheduling service status page, as shown in. On this page, you will see the current scheduling service status, such as the number of threads or activated threads.,You can also enable or stop a scheduling service, and view the currently executed and scheduled tasks waiting in the queue.

If you click"View schedule history"You can see the history of the scheduling service, including START, end, duration, success, next execution time, and execution summary.

The Analysis of dnn scheduling management has come to an end !! Next time, I am going to add my experience on dnn's log management mechanism! Dnnner, good luck !!

Finally, the data related to the Scheduling Service mentioned above is stored in the three associated tables of the database, while the specific implementation provider isWeb. configEmbodiment .
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.