Guru: Maximum Number Of Jobs And Job Table Warning Customization
March 23, 2020 Dawn May
The QMAXJOB system value specifies the maximum number of jobs that can exist on your IBM i partition. The default value is 163,520, with the valid range being 32,000 through 970,000. If you reach the maximum number of jobs as defined by this system value, very bad things can happen to your system. You can always sign on to the console as the system reserves one job table entry for the console, but if you hit the limit on the maximum number of jobs, you will not be able to start any new jobs. In the worst case, it will require an IPL to recover.
The total number of jobs on the system includes active jobs, jobs on job queues, and jobs that have ended with spooled output (that is not detached from the job).
When the system is nearing the maximum number of jobs, message CPI1468, System job tables nearing capacity, is sent to the QSYSOPR message queue. By default, this message is first sent when the system job tables are at 90% of their capacity based upon the QMAXJOB setting. The message is sent again every time the job tables are extended to add more job structures.
Depending upon the setting of QMAXJOB, the amount of activity on your system, and whatever issue that is causing a large number of jobs to be generated, a warning at 90 percent capacity may not give you sufficient time to take action to correct the issue. To provide more flexibility when you are notified about the job tables nearing capacity, IBM has provided the ability to customize the threshold at which the CPI1468 message is sent.
To configure a different threshold, you must create a data area named QMAXJOBPCT in QSYS that specifies the percentage at which the CPI1468 message will initially be sent. For example, to set a threshold at 70%, you would create the data area as follows:
CRTDTAARA DTAARA(QSYS/QMAXJOBPCT) TYPE(*DEC) LEN(2 0) VALUE(70)
In order for the specified threshold to take effect, you must change the setting of the QMAXJOB system value or IPL (although an IPL is probably not the choice for most shops).
In my experience in working with clients, it is generally not active jobs, but rather, jobs that have ended with spooled output, that result in a large number of jobs on the system. You need to manage your spooled files to ensure that you do not get too close to the QMAXJOB limit. Job logs often account for a very large number of ended jobs with spooled output.
Here are a few tips to help you reduce the number of job logs:
- When you end subsystems, a job log is created for every job that is ended. This is because the job is ended while active and will have an end severity of over 30 (the general default severity level at which a job log will be created, even if the message logging text is *NOLIST). You can eliminate the creation of job logs when you end subsystems by using the ENDSBSOPT parameter with the value of *NOJOBLOG. This parameter is also on the PWRDWNSYS and ENDSYS commands.
- If you are using QShell, be sure the job that starts QShell, whether interactive or batch, has the message text as *NOLIST. When QShell commands are run, they run in a separate job, generally a QP0ZSPWP job; these jobs are usually batch immediate jobs that inherit the properties of the requesting job. Thus, if the requesting job is logging *SECLVL text, the QP0ZSPWP jobs inherit that setting. These jobs usually have no messages logged to their job log, but would generate a job log with CPF2533, No job log information. Be sure to have the requesting job set up with *NOLIST to avoid these useless job logs. I have submitted an RFE requesting IBM to change the above behavior; you can find it here: https://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=140291
- Carefully plan the logging level for your jobs with the LOG and LOGCLPGM parameters on job descriptions and the CHGJOB command. Job logs have very useful diagnostic information but creating a job log for every job has impacts on the system. You need to understand the ramifications if you create job logs for all jobs on your system.
- For the job logs that are created, have a plan to clean up the old job logs. GO CLEANUP will remove both spooled job logs and pending job logs. Select a timeframe for removing job logs that is a good balance between keeping job logs for diagnostic data and removing job logs that are no longer needed.
- Use IBM i Services to review your spooled output. The QSYS2.OUTPUT_QUEUE_ENTRIES_BASIC IBM i Service can be used to find the largest spooled files, oldest spooled files, etc. The QSYS2.SYSLIMITS IBM i Services can be used to determine if you are nearing the maximum number of jobs or spooled files on your system.
I’ll write more about these services in a future Guru tech tip.