4.2.3 Jobnet generation management
This subsection describes the number of logs to keep and saved-generation management for a jobnet.
- Organization of this subsection
(1) What is the number of logs to keep?
The number of logs to keep is a setting that specifies how many generations are to be saved as the execution results of a jobnet.
A jobnet generation is created each time the jobnet is registered for execution, and can be saved as a log when the jobnet is executed. How many executed generations (including the one being executed) can be saved is determined by the number-of-logs-to-keep setting.
The setting applies only to a root jobnet. After you have set the number of logs to keep, you can view the execution results for the set number of generations (executions) in the Daily Schedule or Monthly Schedule window of JP1/AJS3 - View. You can also view the execution results in the Monthly Schedule window of the Web GUI, or by running the API function to obtain unit information, or by the ajsshow command. For details on the ajsshow command, see ajsshow in 3. Commands Used for Normal Operations in the manual JP1/Automatic Job Management System 3 Command Reference.
The values you can set as the number of logs to keep are 1 to 99.# Because the amount of data saved in the database is proportional to number of saved generations x number of registered units, the more generations saved, the greater the load of database access operations is, such as canceling the registration of a jobnet. Before you increase the number of logs to keep, carefully consider the impact on system performance. For a jobnet consisting of many units, we recommend that you set a value less than 10 as the number of logs to keep. If unnecessary generations have been saved, cancel the registration of those generations and delete them manually by specifying dates. For details about canceling the registration of a jobnet, see 4.5.1 Canceling registration of a jobnet.
- #
-
Although you can increase the upper limit on the number of logs to keep by using the MAXSAVEGEN environment setting parameter of the scheduler service, use of this parameter requires caution. For details about the MAXSAVEGEN environment setting parameter, see 20.4 Setting up the scheduler service environment in the JP1/Automatic Job Management System 3 Configuration Guide.
(2) Overview of saved-generation management
The generations of a jobnet are saved as logs after execution of the jobnet, and the number of saved generations is controlled so that it does not exceed the preset number of logs to keep. Controlling the number of saved generations so that it does not exceed the number of logs to keep is called saved-generation management.
Saved-generation management is performed when the number of generations to be managed increases (for example, when the next scheduled jobnet execution starts). If the number of managed generations exceeds the preset number of logs to keep, JP1/AJS3 automatically deletes saved generations starting with the oldest one.
The following figure shows how managed jobnet generations are managed.
|
In this example, because the number of logs to keep is set to 3, JP1/AJS3 controls the number of saved generations so that the total number of generations ending normally and the currently running generation does not exceed 3. Therefore, when a new jobnet generation starts on the fourth day, the generation executed on the first day is deleted to maintain the number of saved generations at 3.
Note, however, that because saved-generation management does not delete generations that have not ended (for example, generations in the Now running status), more generations than the number of logs to keep might be saved. If this happens, the excess generations are deleted collectively the next time saved generations are managed.
The following figure shows an example of how excess saved generations are deleted.
|
In this example, although the number of logs to keep is set to 2, generations whose status is in the Now running status are not deleted even when the number of logs to keep has been exceeded. Saved generations are managed when the next generation scheduled for execution starts, and the oldest generations are deleted so that two generations, including the one that has just started execution, remain.
(3) Examples of managing saved generations for a jobnet with a start condition
For a jobnet with a start condition set, the following two methods can be used to manage saved generations:
-
Total management method
The setting of the number of logs to keep is applied to the total number of saved monitoring generations and saved execution generations.
This is the same method that is used for jobnets with no start condition set.
-
Individual management method
The number-of-logs-to-keep setting is applied separately to the number of saved monitoring generations and to the number of saved execution generations.
In JP1 Version 8 and earlier, the individual management method is used to manage the number of saved generations.
The figure below shows the difference between the total management method and the individual management method.
In both methods, saved generations are managed when a new managed generation appears (when monitoring of start conditions starts or when the next execution generation is created because the start conditions have been satisfied).
|
For the total management method, monitoring generations and execution generations are saved in such a way that the total number of these generations does not exceed the preset number of logs to keep. Therefore, as shown in the above example, if a jobnet whose start condition is satisfied 50 times a day is executed for 50 days, the number of saved generations is 50. This number is the same for the first day and the 50th day.
For the individual management method, the preset number of logs to keep is applied individually to monitoring generations and to execution generations. Therefore, the number of generations that will actually be saved becomes larger than the preset number of logs to keep. If a jobnet whose start condition is satisfied 50 times a day is executed for 50 days, 2,550 generations are saved.
- Supplementary note
-
In JP1 Version 8 and earlier versions, the individual management method was used for saved-generation management. However, in JP1 Version 9 and later versions, the total management method has been added and is selected by default.
If you want to set the number of logs to keep to 10 or more, we recommend that you use the total management method.
The following describes the processing performed for each method when the number of saved generations exceeds the number of logs to keep.
(a) Saved-generation management by using the total management method
With the total management method, if the number of saved generations exceeds the preset number of logs to keep, saved generations are deleted starting with the oldest generation. For monitoring generations, when the last execution generation in a monitoring generation is deleted, the monitoring generation is also deleted.
Note that if you use the total management method, you must make sure that you set the number of logs to keep to at least 2. For example, if you want at least one monitoring generation to be saved and at least two execution generations to be saved, you need to set the number of logs to keep to at least 3.
The following figure shows an example of total-management-method processing when Number of logs to keep is 2 and Valid range of start condition is 4 (number of times satisfied).
|
(b) Saved-generation management by using the individual management method
With the individual management method, the number-of-logs-to-keep setting is applied separately to monitoring generations and to execution generations. More execution generations than the number of logs to keep are saved so you must consider how many execution generations will be created by the specified start condition. If JP1/AJS3 has been upgraded from JP1 Version 8 or an earlier version of JP1/AJS2, the individual management method is still used for the management of saved generations. If you use a jobnet with a start condition, take into consideration that you will be switching to the total management method.
Note that cautionary notes apply when you increase the number of generations that will be saved for a jobnet with a start condition. These notes can be found in (4) Notes applying when JP1/AJS3 has been upgraded from JP1 Version 8 or an earlier version of JP1/AJS2.
The following shows examples of the individual management method. These examples assume that Number of logs to keep is 2, and Valid range of start condition is 4 (number of times satisfied).
-
If the number of saved generations exceeds the number of logs to keep on the first day
The following figure shows an example of processing when the number of saved execution generations exceeds the value of Number of logs to keep on the first day.
Figure 4‒17: Example of the individual management method when the number of logs to keep is exceeded on the first day -
If the number of saved generations exceeds the number of logs to keep on the second day or later
The following figure shows an example of processing when the number of saved execution generations exceeds the value of Number of logs to keep on the second day or later.
Figure 4‒18: Example of the individual management method when the number of logs to keep is exceeded on the second day or later
(4) Notes applying when JP1/AJS3 has been upgraded from JP1 Version 8 or an earlier version of JP1/AJS2
If JP1/AJS3 has been upgraded from JP1 Version 8 or an earlier version of JP1/AJS2, the individual management method is selected as the method for managing saved generations. If you use a jobnet with a start condition, take into consideration that you will be switching to the total management method.
(a) Switching from the individual management method to the total management method
The method for managing saved generations for a jobnet with a start condition is determined by the value of the SAVEGENTYPE environment setting parameter. You can use the jajs_config command to change the value of this parameter. For details about this environment setting parameter, see 20.4 Setting up the scheduler service environment in the JP1/Automatic Job Management System 3 Configuration Guide.
If you switch from the individual management method to the total management method, generations other than those retained by the total management method are deleted when the scheduler service starts. The time (in seconds) required for this deletion processing is proportional to the sum of number-of-logs-to-keep x number-of-logs-to-keep calculated for all registered root jobnets, but can be affected by hardware and other conditions. If the time required for the deletion processing is likely to affect operation, manually delete unnecessary generations before changing the management method. This step should reduce the time required for the scheduler service to start.
Note that generations are also deleted when a generation's registration for execution is canceled. If generations are canceled by using registration cancellation or saved-generation management in synchronous mode, the time required for deletion can be reduced by switching to asynchronous mode. Asynchronous mode is the default setting when JP1/AJS3 09-00 or a later version or JP1/AJS2 08-00 or a later version is installed as a new installation. For an upgrade installation, however, synchronous mode might be set. You can determine which deletion mode has been set by checking the value of the BACKGROUNDLEAVE environment setting parameter. If the value is no (synchronous mode) or the parameter is not specified, we recommend that you explicitly specify the value yes for the parameter to set asynchronous mode.
For details about changing the mode in Windows, see 6.1.7 Changing the mode in which unregistration or generation management deletes the generations of a jobnet in the JP1/Automatic Job Management System 3 Configuration Guide. For details about changing the mode in UNIX, see 15.1.7 Changing the mode in which unregistration or generation management deletes the generations of a jobnet in the JP1/Automatic Job Management System 3 Configuration Guide.
(b) Continuing operation with the individual management method
If you continue operation with the individual management method rather than switching to the total management system, the following notes, which apply for JP1 Version 8 or an earlier version of JP1/AJS2, apply.
For the individual management method, the setting of the number of logs to keep is applied separately to monitoring generations and to execution generations, as described in (3)(b) Saved-generation management by using the individual management method. The number of generations that are saved by this method is equal to number-of-logs-to-keep x (number-of-logs-to-keep + 1). The load on any database access operation, such as canceling execution registration, increases proportionately with the number of logs to keep that is set. Determine the value to be specified as the number of logs to keep after careful consideration of the possible impact on system performance. For the relationship between the number of logs to keep that is set and system performance, see 7.2 Relationship between number of logs to keep and performance in the JP1/Automatic Job Management System 3 System Design (Work Tasks) Guide.
If you choose to use the individual management method for operation of a jobnet with a start condition, we recommend that you set the number of logs to keep to a value less than 10, and use the ajsshow command to save execution results as needed. For details about the ajsshow command, see ajsshow in 3. Commands Used for Normal Operations in the manual JP1/Automatic Job Management System 3 Command Reference.
You must also be careful when decreasing the number of logs to keep for a jobnet that is already registered for execution. Decreasing the number of logs to keep will render some saved generations no longer necessary, and will cause them to be deleted all at once. Their deletion occurs when the status of the next scheduled monitoring generation changes to Now monitoring, creating generations that exceed the number of logs to keep that has been set. The number of generations that will be eliminated is the value of (old-number-of-logs-to-keep - new-number-of-logs-to-keep) x (old-number-of-logs-to-keep + 1). Accordingly, if the value of Number of logs to keep is large, and monitoring generations and execution generations each equal to this value have been saved, a drastic decrease in Number of logs to keep will eliminate many generations at one time, adversely affecting operation.
The following figure explains how generations are eliminated when the number of logs to keep is decreased.
|
As shown in the above example, when the value of Number of logs to keep is 10 and 110 generations are saved, if the value is changed to 2, 88 generations are deleted all at once.
If you continue to use the individual management method, keep the above notes in mind.