29
5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS Offering Management [email protected] Central Canada DB2 Users Group (CCDUG), June 5, 2017

Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

  • Upload
    ledieu

  • View
    245

  • Download
    5

Embed Size (px)

Citation preview

Page 1: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

5.4

Getting to know your IMS Scheduler

(How do those pesky IMS transactions get scheduled?)

Deepak Kohli

IMS Offering Management

[email protected]

Central Canada DB2 Users Group (CCDUG), June 5, 2017

Page 2: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

• IMS Architecture

• IMS Queuing

– Class, Priority

– Limit Priority, Limit Count

– PROCLIM, Quick Reschedule

• Scheduling

– MPR classes

• Other scheduling related parameters

– WFI

– PWFI

– Serial vs Parallel scheduling, PARLIM

Agenda

© Copyright IBM Corporation 2017 2

Page 3: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

3© Copyright IBM Corporation 2017

MSG

QUEUE

ONLINE

LOG

DATA

SET

RECON

z/OS

MPRMessage

Processing

Region

BMPBatch

Message

Processing

Region

IFPFast Path

Region

IMSCTLControl

Region

DBRCRecovery

Control

DLISASDL/I

Separate

Address Space

IMS TM makes data available to the end user

IMS Architecture Overview

JMP

Java

Message

Processing

Region

JBP

Java

Batch

Processing

Region

Dependent Regions

CORPORATE

DATABASE

Telecommunications

Message

Scheduling

Logging

Restart

LOG CTL DL/I ACTION

MODULESApplication

Program

Application

Program

Application

Program

Application

Program

Application

Program

Message

Queue

Pool

Page 4: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

4© Copyright IBM Corporation 2017

MSG

QUEUE

z/OS

IMSCTLControl

Region

IMS

CONNECT

IMS Architecture Overview – TCP/IP input

OTMA

Message

Scheduling

Logging

Restart

Message

Queue

Pool

TCP / IP

Page 5: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

• Picking the Transaction to process

– Scheduling path length (can involve serialization)

– Make sure the resources it needs are available

• Once the transaction is picked

– Load the application program into the dependent region

– And give control to the program

Scheduling Overview

© Copyright IBM Corporation 2017 5

Page 6: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

• IMSGEN or DRD (Dynamic Resource Definition)

• IMSGEN Macros:

DATABASE DBD1

DATABASE DBD9

APPLCTN PSB=PROGRAM1, …

TRANSACT CODE=TRANX, …

TRANSACT CODE=TRANY, …

APPLCTN PSB=PROGRAM2, …

TRANSACT CODE=TRANW, …

• APPLCTN & TRANSACT macros contain scheduling parms

Defining Application resources

© Copyright IBM Corporation 2017 6

Page 7: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

Transaction Class & Priority

Page 8: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

• Every transaction belongs to a class & has a priority within that

class

• Class can be specified on the APPLCTN or TRANSACT

macro:

APPLCTN PSB=PROG1, …, PGMTYPE=(TP,,class)

TRANSACT CODE=XYZ, …, MSGTYPE=(,,class)

• Class can be dynamically changed via /ASSIGN command

Transaction Classes & Priorities

© Copyright IBM Corporation 2017 8

Page 9: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

CLASSES TRANSACTIONS (PRIORITY)

004SKILLUPD (8)

SKILLINQ (5)

PAYROLL (4)

002 INVENT (10)

STOKSTAT (8)

003 ORDER (6)

RECEIVE (4)

Transaction Class & Priority

© Copyright IBM Corporation 2017 9

• Transactions are queued by Class and

• Within class by priority

• Classes: 1 – 999

• Priority: 0 (Low) – 14 (High)

Page 10: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

Transaction Queuing

© Copyright IBM Corporation 2017 10

1 2 3 … Classes

… … … …

0 0 0

1 1 1

2 2 2

14 14 14

TCTs

Tran X Tran YTransactions

Queued in the

message

Q Pool

Tran X

Tran X

Tran Y

Page 11: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

• Specified on the TRANSACT macro via PRTY parm:

– PRTY (normal, Limit, Limit Count)

• Example:

APPLCTN PSB=PROG1, …, PGMTYPE=(TP,,1)

TRANSACT CODE=SKILLINQ, …, PRTY=(5,10,30)

• Defaults:

• Normal priority: 1

• Limit priority: 1

• Limit count: 65535

Transaction Priorities

© Copyright IBM Corporation 2017 11

Page 12: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

NORMAL PRIORITY

LIMIT PRIORITY

LIMIT COUNT

QUEUE COUNT

NORMAL PRIORITY

LIMIT PRIORITY

LIMIT COUNT

QUEUE COUNT

TIME TIME TIME

1 2 3

5

10 10

30 30 30

8 31 0

TIME TIME TIME

1 2 3

12 12 12

4 4 4

2 1 3

5 5

10

8 8 8

CLASS 001

SKILLINQ

TRANSACTION

MESSAGE 1

MESSAGE N

CLASS 001

~

~

MESSAGE 1

SKILLUPD

TRANSACTION

MESSAGE N

~

~

Transaction Priorities

© Copyright IBM Corporation 2017 12

Page 13: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

Application programs are automatically scheduled

into Message Processing Regions (MPRs)

MESSAGE 1

SKILLUPD

CLASS=1,PRTY=8

MESSAGE N

SKILLINQ

CLASS=2,PRTY=5

MESSAGE 1

MESSAGE N

~

~

~

~

S

c

h T

e a

d s

u k

l

e

r

IMS/

MPR1

Classes

2,3,4,1

IMS/

MPR2

Classes

4,5,6,7

IMS/

MPR3

Classes

3,4,5,6

CLASS 001

CLASS 001

Transaction Scheduling

© Copyright IBM Corporation 2016 13

Page 14: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

MESSAGE REGION

REGION CONTROLLER (DFSRRC00)

APPLICATION PROGRAM

GET TRAN MESSAGE

PROCESS

ACCESS DBs

SEND REPLY MESSAGE

RETURN IF NO MORE

LANGUAGE INTERFACE

(DFSLI000)

MPP Program flow

14© Copyright IBM Corporation 2017

Page 15: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

• Specified on the TRANSACT macro:

TRANSACT CODE=SKILLINQ, …, PRTY=(5,10,30),

PROCLIM=(count, time)

• Count: number of messages program can process in one

scheduling.

• Default: 65535 – no limit

• Time: CPU seconds to process one transaction

PROCLIM – Processing Limit Count

© Copyright IBM Corporation 2017 15

Page 16: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

• Avoids unnecessary terminations & schedules.

• Invoked when PROCLIM>0

• When PROCLIM count reached

– If same transaction would be rescheduled

• Does not return ‘QC’ status code

• Returns the next message

– If same transaction would not be rescheduled

• Returns ‘QC’ status code

• Program terminates

• If PROCLIM count=0

– Quick Reschedule is disabled

– Only one transaction processed per schedule

PROCLIM – Quick Reschedule

© Copyright IBM Corporation 2017 16

Page 17: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

Application programs are automatically scheduled

into Message Processing Regions (MPRs)

MESSAGE 1

SKILLUPD

CLASS=1,PRTY=8

MESSAGE N

SKILLINQ

CLASS=1,PRTY=5

MESSAGE 1

MESSAGE N

~

~

~

~

S

c

h T

e a

d s

u k

l

e

r

MPR1

5,2,9,1

CLASS 001

CLASS 001

WFI (Wait for Input)

© Copyright IBM Corporation 2017 17

MPP

Page 18: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

• Specified on the TRANSACT macro:

TRANSACT CODE=SKILLINQ, …,WFI, …

• Lack of message does not cause IMS to terminate program in

region

• GU to the IOPCB will NOT return ‘QC’ status code

• Program is waiting for the next message to arrive

• Basically, provides a dedicated region for high priority

transaction where response time is critical.

• Avoids the scheduling overhead of those high priority transactions

WFI (Wait for Input) Transactions

© Copyright IBM Corporation 2017 18

Page 19: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

• WFI transactions do not give up their regions

• Programs terminated only by:

– Reaching PROCLIM

– /STOP TRANSACTION for MPP

– /PSTOP Region reg# TRANSACTION tran for BMP

– Shutdown checkpoint of IMS system

– UPDATE PGM START(REFRESH) – IMS V14

WFI (Wait for Input) Transactions (cont.)

© Copyright IBM Corporation 2017 19

Page 20: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

Application programs are automatically scheduled

into Message Processing Regions (MPRs)

MESSAGE 1

SKILLUPD

CLASS=1,PRTY=8

MESSAGE N

SKILLINQ

CLASS=1,PRTY=5

MESSAGE 1

MESSAGE N

~

~

~

~

S

c

h T

e a

d s

u k

l

e

r

MPR1 PWFI=Y

5,2,9,1

CLASS 001

CLASS 001

PWFI (Pseudo Wait for Input)

© Copyright IBM Corporation 2017 20

MPP

Page 21: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

• Specified on the MPP region JCL:

// EXEC PGM=DFSRRC00,PARM='MSG,...,PWFI=Y,...‘

• Specifies what IMS will do when there are no more transaction

messages to process:

– GU to IOPCB will not result in ‘QC’ status code

– Instead, waits for next message to arrive for the region

– If next message is the same transaction code, great!! Avoids

termination and scheduling of transaction.

– If next message is different transaction code, returns ‘QC’, terminates

program and schedules new program.

PWFI (Pseudo Wait for Input) Transactions

© Copyright IBM Corporation 2017 21

Page 22: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

• Introduced in IMS V14

• Via Type 2 command:

UPDATE PGM START(REFRESH)

• Regions do not need to be restarted.

• Programs get ‘QC’ status code if waiting for work or if

processing a transaction, then after the current message is

processed.

Dynamic Refresh for PWFI & WFI regions

© Copyright IBM Corporation 2017 22

Page 23: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

Application programs are automatically scheduled

into Message Processing Regions (MPRs)

MESSAGE 1

SKILLUPD

CLASS=1,PRTY=8

MESSAGE N

SKILLINQ

CLASS=4,PRTY=5

MESSAGE 1

MESSAGE N

~

~

~

~

S

c

h T

e a

d s

u k

l

e

r

IMS/

MPR1

Classes

2,3,4,1

IMS/

MPR2

Classes

4,5,6,7

IMS/

MPR3

Classes

3,4,5,6

CLASS 004

CLASS 001

Serial vs Parallel Scheduling

© Copyright IBM Corporation 2017 23

Page 24: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

• Specified on the TRANSACT Macro;

TRANSACT CODE=SKILLINQ, …,PARLIM=2, …

• Requires SCHDTYP=PARALLEL on APPLCTN macro

• Says transaction will be scheduled in another region if:

Tran Q Cnt > PARLIM x number of regions tran is currently

scheduled

PARLIM – Parallel Limit

© Copyright IBM Corporation 2017 24

Page 25: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

• Example:

TRANSACT CODE=SKILL, …,PARLIM=2, …

SKILL Transaction current queue count=6

SKILL transaction currently scheduled in 2 MPRs.

3rd MPR becomes available

Can we schedule SKILL in the 3rd MPR?

PARLIM – Parallel Limit (cont.)

© Copyright IBM Corporation 2017 25

Page 26: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

• A way to Load Balance the parallel scheduling of transactions

• PARLIM=0 always causes new transactions to be eligible for

another available region

PARLIM – Parallel Limit (cont.)

© Copyright IBM Corporation 2017 26

Page 27: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

• Specified on the TRANSACT Macro;

TRANSACT CODE=SKILLINQ, …,MAXRGN=7, …

• Limits the number of MPP regions that may have the

transaction concurrently scheduled

• Used to keep a “dog” transaction from occupying too many

regions

MAXRGN

© Copyright IBM Corporation 2017 27

Page 28: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

© Copyright IBM Corporation 2017

Unit Summary

• Queuing

• Scheduling

• Scheduling related parameters:

– Class

– MPR Class specification

– Priority, Limit Priority & Limit Count

– PROCLIM, Quick Reschedule

– WFI, PWFI

– Serial vs Parallel scheduling, PARLIM

28

Page 29: Getting to know your IMS Scheduler (How do those pesky IMS ... · PDF file5.4 Getting to know your IMS Scheduler (How do those pesky IMS transactions get scheduled?) Deepak Kohli IMS

Thank You!

29