WLM Batch Management
WLM Batch Management
Steve
Grabarits
S/390 Performance, Poughkeepsie, New York
[email protected]
2
OS/390 R4 WLM Batch Management
WLM batch management is not trying to replace your scheduling package. It is trying
to get your staff out of the business of messing around with initiator definitions, job
class selection lists, etc on an on-going basis. Those things will still need to change
based on all sorts of business requirements (or politics). But why should any human
need to monitor the job backlog to make sure enough initiators are started to service
the load on a given service class?
It uses current system conditions and some recent historical data to decide whether or
not your business goals (service policy) are being met, and if not which alterations in
current resource allocations will get closer to that ideal. It does not keep a history on
every jobname, as OPC/ESA or its like do. It does not attempt to project the impact of
a particular job starting; it projects the impact of an additional job in a service class -
the "average" job, whatever that is. It does not know when a job "must" be initiated in
order to complete on time (since it has no job-based history), nor does it know about
inter-job dependencies or networks.
WLM resource affinity support likewise does not implement resources with all of the
bells and whistles of other packages: binary states are all for now. What it does do is
give you a simple way, integrated into your performance goal specifications, to get
jobs running on the right image(s). And it does so in a positive "run it there" sense, not
via convoluted setup to ensure that a job "doesn't go anywhere else." Maybe you can 6
delete some job classes if all they do now is enforce affinities
OS/390 R4 WLM Batch Management
Placement of initiators
Awareness of system affinities
Work is displaced only if necessary
If work must be displaced, goals are used to minimize impact
As your workload changes (merged any good datacenters lately?), how do you decide
how many inits in each class? Decide what the job selection list for each should be?
How fast can you react when some kind user dumps 500 uniquely-named jobs into the
queue everyone uses for ad-hoc work? Does it take phone calls from dissatisfied
users?
Does your initiation setup match your business goals for performance?
How do you know?
WLM can change the setup many times per day, if your business goals and system
conditions warrant the change.
8
OS/390 R4 WLM Batch Management
In order to support batch management and resource affinity scheduling, the job queue
elements (JQEs) in the JES2 checkpoint have been extended. The JQE extension
lets JES2 keep track of new data like the scheduling environment requested for a job,
the service class for a job, and some times that improve reporting about what happens
to a job before execution begins. Details will follow.
In addition, JES2 R4 includes many changes unrelated to WLM batch support. New
control blocks, new services, new queues, etc. At the very least all of these internal
changes will require rework of code modifications done locally or by other vendor
products. And of course most packages dealing with batch problems have their mitts
in the JQEs too.
For these reasons, JES2 R4 itself has two "modes". If the JES2 R4 system initiates a
cold start or if the new $ACTIVATE command is used, the checkpoint will be formatted
with new control blocks. In all other cases the existing checkpoint format will be used.
Once the new checkpoint format is used, only JES2 R4 systems may participate
in the MAS. Returning to the old checkpoint format requires an all member hot start
with JES2 APAR OW32920 applied. Without OW32920, a cold start is required.
10
OS/390 R4 WLM Batch Management
JOBCLASS(A) MODE=JES
JOBCLASS(B) MODE=WLM
JOBCLASS(C) MODE=WLM
:
INIT1 ABC
INIT2 BC
JES-managed initiators is just a new name for the way initiators have behaved in the
past. Each initiator is always either running a job or waiting for JES to feed it a job to
run. If told to terminate, it will do so. There is no interaction with "MVS" to see
whether running the job it is given is a "good idea" or if the job will in fact run at all. If
no CPU is available for the type of job it is given, oh well MVS will have to figure that
out. Any change to the selection criteria must be done by humans or automation.
JES exit 14 is called only for JES-managed initiators. JES exit 49, a new exit, is called
for both JES-managed and WLM-managed initiators. Exit 14 requires the user to
provide an alternate selection if JES's selection is rejected, while exit 49 only allows
the user to veto JES's selection. If exit 49 vetoes a selection, JES -- not the exit code
-- will select another job to run.
See the JES2 Conversion Notebook Chapter 9 for JES2 R4 migration actions. 14
OS/390 R4 WLM Batch Management
READER
CONVERSION
Classify
Queue for JES-managed job classes
execution WLM-managed job classes
Sampling
INITIATION JES initiators
WLM initiators Algorithms
EXECUTION
Every job is classified by JES2 during conversion (after exit 6) so that it can be queued
by service class. JES2 actually maintains two different queues through the JQEs, one
for JES-managed mode (oldest within priority) and the other for WLM-managed mode
(oldest within service class). This classification call replaces the classification
normally done by SRM during job selection; if the level of JES does not supply
classification information to SRM, SRM will classify the job as before.
While on the execution queue, a job can be eligible to run (waiting only for an initiator)
or it can be ineligible. For reporting purposes JES2 keeps track of 3 times while a job
is on the execution queue. Details on the 3 buckets follow shortly. In order to manage
batch queue delay, WLM uses the eligible time as queue time.
The other thing that happens while a job in a WLM-managed job class is on the
execution queue is that its state is sampled and reported to SRM. A job waiting only
for an initiator generates a Queue Delay state sample, a job in any other state
generates an Other state sample. When a job is running in a WLM-managed job class
with a velocity goal, its queue delay samples are used in the velocity calculation.
JES2 samples the job queue while it holds the checkpoint lock and SRM uses that set
of samples until JES2 gives it a new one. The shorter the checkpoint cycle, the more
accurate batch queue delay samples will be. One cycle is defined here as the time for
the checkpoint to be owned by each system in the MAS; anything less than the SRM
sampling interval (0.25 seconds wall clock time) will not improve sampling accuracy. 16
OS/390 R4 WLM Batch Management
Classification
JES2 assigns a WLM service class to each batch job at the
end of conversion
Applies to jobs on both JES-managed and WLM-managed
queues
Service class can be changed by JES $tjob command prior to
and during execution
Whenever a service class is changed, SRM and JES2 stay in
synch with each other
18
OS/390 R4 WLM Batch Management
INITIATION
EXECUTION
OUTPUT
If JES2 R4 functions are not activated, the times will be reported as before. Queued
time will contain all 3 times, and the other two categories will be 0.
20
OS/390 R4 WLM Batch Management
SMF 90
Subtype 30 contains some new flags for existing functions
New subtype 32 describes scheduling environment definition after a change
SMF 99
Subtype 2 contains sysplex view of initiator work queues 22
OS/390 R4 WLM Batch Management
RMF
Job delay data is available on the WLMGL and WKLD reports
in RMF monitor 1
Job delay data is also available on the GROUP, SYSRTD, and
SYSSUM reports in RMF monitor 3
W O R K L O A D A C T I V I T Y
----------------------------------------------------------------
REPORT BY: POLICY=POLICY1 WORKLOAD=BATCH SERVICE CLASS=HOTBATCH
WLM Samples: 399 Systems: 2 Date: 08/04/97 Time: 17.36.40 Range: 100 Sec
>>>>>>>>XXXXXXXXXXXXXXXXXX<<<<<<<<
The additional initiators must improve the receiver's performance relative to the
service policy in effect or the delay will not be addressed. If starting more initiators will
replace queue delay with paging delay, WLM will learn that, project no improvement,
and try to help using other resources. If existing initiators are not busy most of the
time (90%ish), the presumption is that most jobs have affinities to other systems.
And of course, enough capacity must exist to run another average job...average for
period 1 of the service class, based on recent history.
Resources may be obtained to add initiators by stealing from other work that is
over-achieving its goals or is of lower importance.
SRM algorithms tell WLM to remove the initiator from the pool
for the service class
Once the current job completes, WLM can
Re-assign the initiator to another service class immediately
Keep it around for a while and re-assign it later
Terminate it
(c) Copyright IBM Corporation 1999 27
Housekeeping and a change into compatibility mode are the only way WLM-managed
initiators are removed from a service class. Policy adjustment can take MPL to
reclaim storage, which then triggers housekeeping to reassign initiators.
Assumptions
There is a direct measurable relationship between queue delay
and the number of initiators serving the queue
Does this hold true for your batch submission pattern(s)?
Some installations essentially throw all their production jobs in at once, over-initiate,
and let MVS manage whatever happens. Since only a small percentage of the jobs
can actually be initiated at once, the incremental effect of additional initiators on the
queue delay becomes negligible and SRM's algorithms would conclude that there is
no value in adding more. This can happen with both response time and velocity goals.
The reverse can also happen with velocity and response time goals: since most of the
delay stems from queuing, adjustments to any other resource (CPU, storage) show
little value toward achieving the goal and are abandoned. If you submit many jobs at
once and you intend to use WLM initiator management, we recommend that you use
discretionary goals for the batch work submitted en masse. Resource group
minimums can optionally be used to give preferential treatment to different subsets of
the batch workload.
Assumptions
The goal for period 1 of the service class is the most stringent
goal in the service class
Using both WLM-managed and JES-managed initiators to service work in the same
service class is simply an attack on the data. Doing so weakens the relationship
between the number of WLM-managed initiators and the queue delay observed.
There are no known cases where this would cause dire consequences, but managing
based on suspect data is never a good idea. The recommendation is not to mix the
different types of initiation control within a single service class.
34
OS/390 R4 WLM Batch Management
Migration Considerations
Satisfy the prerequisites mentioned earlier
Secondary JESes
Compatibility mode
Priority Aging
"Boss" JES has nothing to do with objects, attitude, or surfer-dude coolness. It does
have to do with which JES is allowed to create WLM-managed initiator queues when
more than one JES2 instance in the same MAS is running on a single MVS image.
JES2 has some rules for selecting the Boss JES2, which their publications document.
The short version is: if the primary JES is running, primary is the Boss; if the primary is
not running, the first secondary encountered in IEFSSNxx that is running is the Boss.
WLM compatibility mode is not where you want to be using WLM-managed initiators.
They will drain and terminate if the system is changed from goal to compatibility mode
while they are running, and will not be started at all if running in compatibility mode.
Since JES2 effectively partitions JES-managed jobs/initiators from WLM-managed
jobs/initiators, jobs submitted to WLM-managed job classes while running in
compatibility mode will sit on the queue looking forlorn. If the system is switched into
goal mode afterward or the job class is changed to JES-managed they will get their
chance to be initiated, but not before.
JES2 priority aging will reclassify all jobs whose priority is changed to see if the
service class changed. Only JES-managed job classes are priority-aged since job
priority does not affect queueing order for WLM-managed job classes. 36
OS/390 R4 WLM Batch Management
Operational Changes
Starting and stopping initiators
Running a job immediately
Limiting concurrent jobs
$S XEQ command
Starts job initiation on the system where it's entered
Use for system startup
$P XEQ command
Stops job initiation on the system where it is entered
Use for system shutdown
Active jobs are allowed to finish
WLM initiators drain and terminate
JES initiators drain
A WLM initiator is started solely to run the specific job, runs it,
and terminates
It is not in any way, shape, or form intended or designed for frequent use.
40
OS/390 R4 WLM Batch Management
JOBCLASS(E) XEQCOUNT=(MAXIMUM=5)
SDSF Changes
Job information line command
Job Information
Definitions
Resource Elements
16 character names
Maximum 999
SYS_ prefix is reserved - Prime_Shift
32 character description - Vector_Facility
- DB2_Prod
Exist in one of three states:
- C_Compiler
"ON"
"OFF"
"RESET"
Known throughout the sysplex
Scheduling states are:
"ON" or "OFF"
State on each system independent of state on other systems
Building blocks for scheduling environments
(c) Copyright IBM Corporation 1999 47
OS/390 R4 WLM Batch Management
Definitions...
Scheduling Environments
"External" used to request an
installation defined environment. Cheap_Cycles
16 character names
- Prime_Shift(OFF)
Maximum 999
32 character description Cheap_Fortran
Composed of 0 - 999 resources - Prime_Shift(OFF)
Each resource has a specified - Vector_Facility(ON)
state: "ON" or "OFF"
All resources must be in specified state for an environment
to be available.
A scheduling environment may be available on none, one or
more systems in the sysplex.
None, one or more scheduling environments may be
available on each system of the sysplex.
(c) Copyright IBM Corporation 1999 48
OS/390 R4 WLM Batch Management
Visibility
Scheduling environments and resources are defined
through WLM ISPF dialog
External
Example
ROUT SY1,F WLM,RESOURCE=PRIME_SHIFT,OFF
ROUT SY2,F WLM,RESOURCE=PRIME_SHIFT,OFF
12
11 1
10 2
9 3
8 4
SY1 SY2
7 5
6
System Eligibility
MYJOBF
- SY1
MYJOBC
- SY1
- SY2
Resource
Vector_Facility ON OFF
Elements
Scheduling
Cheap_Cycles Available Available
Environments
Cheap_Fortran Available Unavailable
Summary
Dynamic, goal-oriented management of the time jobs spend
waiting for an initiator
Multisystem workload balancing
Reduced operational demands
Improved reporting of job response time and pre-execution job
delays
Support for all users/exploiters of resource affinity scheduling
Recent Service
See info APAR II10760 for required JES2 service
For OS/390 V2R6 and up, WLM APAR OW37405
Sources of Information
http://www.ibm.com/s390/wlm - 2 papers on batch
redbook: "Batch Processing in a Parallel Sysplex", SG24-5329
JES2 Migration Notebook, chapter 9
JES2 Init & Tuning Guide, chapter 2 Job Selection and
Execution topic
MVS Planning: Workload Management
classification by job priority
velocity migration
scheduling environments
(c) Copyright IBM Corporation 1999 54
WLM Education References:
55
WLM Technical References:
IBMLink/TalkLink
MVSWLM forum - customers, consultants, and development participate
56