Options Manager -- Discus Task and Scheduling Managers
These options are set from the Other tab of the Options Manager interface.
The following features are intended for advanced board administrators who have a specific reason to use them.
What are the Discus Task Manager and Scheduling Manager?
The Discus Task Manager is an experimental feature that spawns a new background process. This background process has the sole job of monitoring the "task queue" for any tasks that need to be performed. Sample tasks that are performed by the task manager include archiving and pruning, regenerating the board or pages, removing images and attachments from deleted pages, and sending out e-mail notification messages.
The purpose of using the task manager is to speed up the operation of your board from the viewpoint of your users. For example, posting a message that requires e-mail notification messages to be sent to thousands of recipients will result in a delay to the user posting the message while the e-mail notifications are sent. With the task manager enabled, the process of posting the message tells the task manager to send the notification messages (which is very fast when compared to the actual action of sending the messages). This makes the board appear to run faster to your users.
The tradeoff is that the load on your server is slightly higher. Because the task manager starts up the first time one of your Discus CGI scripts is invoked, and continues to run in the background, there is an extra process running. However, the task manager spends most of its time "sleeping" as it waits for instructions from other processes. The amount of extra load on your server is actually very minimal.
A related yet separate utility is the Scheduling Manager, which allows Discus to run certain commands at specified times. (This attempts to duplicate the functionality of the "cron" utility on unix, when web hosts do not make this available to their customers.) Like the Task Manager, the Scheduling Manager runs a background process.
Task Manager and Scheduling Manager Advantages
Using the Task Manager will speed up the performance of any board feature that sends e-mail notification messages to users, or any other function that utilizes code that can be passed to the Task Manager.
The Scheduling Manager allows you to schedule tasks to run at certain times of the day, or on certain days of the week or month, etc. This allows you to set up an automated process to monitor your POP3 mailbox for e-mail replies or to schedule system commands to run.
Task Manager and Scheduling Manager Caveats
Will not work on Windows: To start a new background process, the Task Manager and Scheduling Manager use a 'fork' system call. This is a unix-specific operation for which an equivalent operation is not universally available on Windows platforms.
Must be manually restarted upon upgrade: Because the Task Manager will load and remember any code it executes, any changes to the code applied through version upgrades will not be registered. This may cause unexpected behavior, or the Task Manager and Scheduling Manager may simply not do anything at all. If you are using either the Task Manager or Scheduling Manager, after an upgrade, you must manually restart the processes through Options Manager.
Start only upon CGI access: The Task Manager and Scheduling Manager check to be sure they are running upon each access to a CGI script on your board. If the processes were to die (due to server reboot, being terminated, etc.), they would not start up again until someone accesses a CGI script on your board. This is generally not a concern, but may cause issues if most people participate on your board through reply by e-mail rather than board visits.
Might be killed by web host: Some web hosts run a process monitor that will kill any process that has been running more than X seconds. Since the Task Manager and Scheduling Manager are started by the web server, your web host's process checker may believe that the Task Manager and Scheduling Manager are runaway CGI scripts, and kill them without your knowledge. The Task Manager and Scheduling Manager will generally start up again within 2 minutes, assuming there are CGI accesses to your board.
Might be prohibited by web host: Some web hosts do not allow their customers to run background processes or daemons. If your web host has such a policy, enabling the Discus Task Manager or Scheduling Manager might be a violation of the terms of your service.
Configuring and using the Task Manager
Enable Discus Task Manager: To use the Task Manager, check this box. If this box is checked, upon each CGI access, Discus will attempt to determine if the Task Manager is running. If the Task Manager is not running, it will be started automatically.
Use Task Manager to speed up the following operations: Check any of the following boxes to shift responsibility for operations to the Task Manager. (Note that checking these boxes does nothing if you haven't enabled the Task Manager with the box above.)
Automatic archiving and pruning: In Discus Pro, upon each post, the program checks to see if any automatic archiving or pruning must occur. If so, this automatic archiving and pruning is performed immediately. By checking this box, you shift this archiving/pruning check to the Task Manager, meaning that while posting, the user will not need to wait for this to occur. The downside is that, for a few seconds between the time of the post and the time the Task Manager does any needed maintenance, the page will not behave according to your archiving rules.
It's a good idea to enable this option if you are using Task Manager and you have automatic archiving and pruning settings for your topics, especially if you have a busy board.
Regeneration of board: Regeneration of the board generally occurs explicitly through the Appearance Manager when you choose to regenerate the board (with a new skin or new color scheme, for example). By checking this box, when you submit a regeneration request, the Task Manager will perform the regeneration and you will be able to continue administration without waiting for the gauge.
If you are the impatient type, it's not a good idea to enable this option, because if you go to the board in the middle of regeneration, you might get a file locking error and worry needlessly. Waiting for the gauge to finish before returning to your board is generally a good idea.
Removing images/attachments when deleting pages: When a page or message is removed, Discus removes any images or attachments that would be "orphaned" by the page removal. By checking this box, you pass the scanning for these images and attachments to the Task Manager.
It's a good idea to enable this option. Since pages that are in the process of being deleted won't be posted to, it won't cause any errors, and it will allow you (or your moderators) to get on with other tasks, rather than waiting for a gauge to finish when deleting items.
Sending of e-mail messages: E-mail messages are sent before full control over the browser is returned to the end-user. By checking this box, you can substantially improve the performance of your board by having the Task Manager send out e-mail messages.
It's a good idea to enable this option if you have not set up cron-based e-mail notification. However, if you have "cron" available to you, it's better to leave this box unchecked and use cron to send your e-mail messages instead.
Configuring and using the Scheduling Manager
The Scheduling Manager uses the same technology as the Task Manager to "fork" a background process. You must have the Task Manager enabled in order to use the Scheduling Manager. (If you want to use only the Scheduling Manager, enable the Task Manager but do not check any of the four boxes of tasks for the Task Manager to perform.)
Enable Discus Scheduling Manager: To use the Scheduling Manager, check this box (and also you must have the Task Manager enabled). This allows you to schedule tasks by clicking the Schedule Tasks link.
Your Scheduled Tasks
This section lists any tasks that you have scheduled. For any of those tasks, you have the option to delete (click Del), schedule times (click Times), or edit (click Edit) the existing task. Deleting a task is self-explanatory; when a task is deleted, it will no longer be executed. Changing times or editing an existing task use the same interfaces as are used when a task is added.
Add a Scheduled Task
This section allows you to add a new scheduled task. The initial screen prompts you to choose an action and to enter a task name. Currently available actions are:
Run program/shell script: You will enter the full path to a program or a shell script on your server. The presence of this option in itself allows you access to various scripts and information on a server that would not normally be conveyed by having simply CGI access to the server. (However, you could get similar access in a more convenient way by just writing a CGI script that had a unix command in it, and then accessing that through the browser.)
Check POP3 mailbox for e-mail replies: If you have set up the reply by e-mail feature using a POP3 mailbox, you can schedule checks of that mailbox with the Scheduling Manager. If you haven't set up the reply by e-mail feature using a POP3 mailbox, this option won't appear as a choice in the list.
In addition, you must choose a name of the task. This name will be displayed to you, the board administrator, when you go in later to edit or delete tasks. Thus, simply choose a name that accurately summarizes the function of the task.
Click the "Proceed to task properties" button to fill in details about the task you are scheduling.
Program/shell script: Give the command and arguments, if any, to run the desired task.
Check POP3 mailbox: There are no properties to be set, since POP3 mailbox checking is configured exclusively under the Options Manager - E-mail tab.
Click the "Save Settings" button to proceed to fill in details about the dates and times when this task should run.
Setting Days: In order for a task to run, you must select at least one month, at least one day, and at least one day of the week. Selecting at least one month should be self-explanatory. The following clarification applies to days.
Selecting days: You must select at least 1 day of the month for your task to run. If you select an invalid day for a month (e.g., February 31), the task will not run on that day.
Selecting weekdays: You must select at least 1 weekday for your task to run.
Example: Run a task the 1st of every month: Select all months, check the "1" box for selecting days, and all weekdays. This task will run on the 1st of every month, regardless of whether the 1st of the month falls on a Sunday, Monday, ...
Example: Run a task every Sunday: Select all months, all days, and the "Sunday" box for weekdays. Your task will run on every Sunday, regardless of whether that Sunday falls on the 1st of the month, the 2nd, ...
Example: Run a task every even-numbered Monday: Select all months, all even-numbered days (2, 4, 6, 8, ...), and the "Monday" box for weekdays. This mechanism will, in most cases, schedule a task to run about every other Monday.
Selecting hours/minutes: Check any boxes in the "Hours" and "Minutes" sections that describe when your task will run.
Example: Run a task at midnight each day: Select "12 am (Midnight)" from the Hours box and ":00" from the Minutes box.
Example: Run a task every hour on the hour: Select all hours from the "Hours" box and ":00" from the Minutes box. This task will run at midnight, 1:00 AM, 2:00 AM, ..., 11:00 PM.
Example: Run a task at :15 and :45 past the hour: Select all hours from the "Hours" box and both ":15" and ":45" from the Minutes box. The task will run at 12:15 AM, 12:45 AM, 1:15 AM, ..., 11:45 PM.
When you are finished selecting times, click the "Save Settings" button. You will be returned to the main screen of the Scheduling Manager, and your task will be saved.
Starting, stopping, and restarting Task Manager
In the event of a Discus software upgrade, it is necessary to restart the Task Manager so that new code is read in to the Task Manager.
Starting Task Manager: If Task Manager is not running, there will be a link to start Task Manager here.
Stopping Task Manager: If Task Manager is running, there will be a link to stop (kill) the process.
Restarting Task Manager: If Task Manager is running, there will be a link to restart the process.
Copyright © 2002, DiscusWare, LLC, all rights reserved