Setting up workload groups

A workload group defines the number of processor cores that can be used concurrently by jobs and threads that are associated with the group. Product entries can be added to a workload group to define the license term and feature of the product in the group. To set up workload groups, use the character-based interface.

  1. Add a workload group using the Add Workload Group (ADDWLCGRP) command. The workload group can be added with any name you choose. The processor limit defines the number of cores that jobs and threads associated with this workload group can run on concurrently.
    ADDWLCGRP WLCGRP(MYGROUP) PRCLMT(2) 
  2. Add product information to the group using the Add WLC Product Entry (ADDWLCPRDE) command. Product entries define the license term and feature of the product that is limited by the number of processor cores defined for the workload group. See Setting up software licensing with workload groups for more information on setting up software licensing with workload groups.
  3. Create a special data area named QWTWLCGRP that defines which subsystems use which workload group using the Create Data Area (CRTDTAARA) command. The data area must be TYPE(*CHAR) and the library name must be QSYS. The data area length must be at least 20 characters long, and contain pairs of subsystem and workload group names. Each name is 10 characters in length, left-justified, and padded with blanks.
    CRTDTAARA DTAARA(QSYS/QWTWLCGRP) TYPE(*CHAR) LEN(2000) 
              VALUE(‘MYSBSNAME MYGROUP   ‘) 
              TEXT(‘Subsystems to use workload groups') AUT(*USE) 

    To configure additional subsystems to use workload groups, either enter the additional names when creating the data area, or use the Change Data Area (CHGDTAARA) command to add them to the data area after it has been created. For example, if you want subsystem QBATCH to use workload group MYGROUP2, enter the following command:

    CHGDTAARA DTAARA(QSYS/QWTWLCGRP) 
              VALUE(‘MYSBSNAME MYGROUP   QBATCH    MYGROUP2  ‘) 
  4. Use the Display Data Area (DSPDTAARA) command to verify that the correct number of spaces have been used. Ensure the names start at positions 1, 11, 21, and so on. If a subsystem name or workload group name is 10 characters long, there can be no space between that name and the beginning of the next name.
    DSPDTAARA DTAARA(QSYS/QWTWLCGRP)
  5. Start the subsystems that are defined in the data area created using the Start Subsystem (STRSBS) command. The data area can be created or changed while the subsystem is active, but has no effect on the jobs in that subsystem until it is ended and restarted.
    STRSBS SBSD(QGPL/MYSBSNAME) 
    Note: Verify that a CPI146C message (Subsystem &1 is using workload group &2) is logged in the subsystem job log when the subsystem was started. Jobs that start in subsystem MYSBSNAME are now limited to two processor cores, as defined by the workload group named “MYGROUP”.
  6. To change the workload group for a job after it has already started, use the Change Job (CHGJOB) command. The job does not need to be running in a subsystem that has a workload group defined.
    CHGJOB JOB(123456/QUSER/MYSERVER) WLCGRP(MYGROUP) 
  7. To change the processing capacity for a group, use the Change Workload Group (CHGWLCGRP) command. The processor limit can be changed while jobs using the workload group are active.
    CHGWLCGRP WLCGRP(MYGROUP) PRCLMT(4) 
Notes:
  • The workload group and QWTWLCGRP data area can be created while the subsystem is active. This has no effect on the jobs in that subsystem until the subsystem is ended and restarted.
  • The Remove Workload Group (RMVWLCGRP) command can be used to change all jobs actively running in a workload group to no longer be assigned to that group.
  • If you remove a workload group (RMVWLCGRP) while a subsystem that is using it is active, new jobs that are started are not limited.
  • System jobs and subsystem jobs do not run in a workload group. They continue to use all processor cores available.
  • The controlling subsystem (as defined by QCTLSBSD system value) cannot use a workload group.
  • Batch immediate jobs are started using the workload group used by the job that starts them (parent job).
  • Up to 255 workload groups can be created for the current system or logical partition.
  • Changes to the number of processor cores for a workload group take effect immediately.