38
Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo Gipponi Fabio Massimo Ottaviani EPV Technologies [email protected] [email protected] www.epvtech.com

Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

  • Upload
    others

  • View
    7

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Evolution of CPU and zIIP usage inside the DB2 system address spaces

Danilo Gipponi

Fabio Massimo Ottaviani

EPV Technologies

[email protected]

[email protected]

www.epvtech.com

Page 2: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Disclaimer, copyright and trademarks

2

Disclaimer:

THE INFORMATION CONTAINED IN THIS PRESENTATION HAS NOT BEEN SUBMITTED TO ANY FORMAL REVIEW AND IS DISTRIBUTED ON AN “AS IS” BASIS WITHOUT ANY WARRANTY EITHER EXPRESS OR IMPLIED. THE USE OF THIS INFORMATION OR THE IMPLEMENTATION OF ANY OF THESE TECHNIQUES IS A USER RESPONSIBILITY AND DEPENDS ON THE USER’S ABILITY TO EVALUATE AND INTEGRATE THEM INTO THE USER’S OPERATIONAL ENVIRONMENT. WHILE EACH ITEM MAY HAVE BEEN REVIEWED FOR ACCURACY IN A SPECIFIC SITUATION, THERE IS NO GUARANTEE THAT THE SAME OR SIMILAR RESULTS WILL BE OBTAINED ELSEWHERE. USERS ATTEMPTING TO ADAPT THESE TECHNIQUES TO THEIR OWN ENVIRONMENTS DO SO AT THEIR OWN RISK.

Copyright Notice:

© EPV Technologies. All rights reserved.

Trademarks:

All the trademarks mentioned here belong to their respective companies.

Page 3: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Agenda

• Introduction

• System AS CPU usage in DB2 V9

• System AS CPU usage in DB2 V10 and V11

• Evolution of MSTR functions

• Conclusions

3

Page 4: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Introduction

4

Page 5: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Introduction

• DB2 is the preferred repository for mission critical data at all

z/OS sites

• Performance of z/OS and non z/OS based applications

accessing DB2 data is critical for every company business

•Managing even simple DB2 environments with continuously

shrinking staff is more and more a challenge

5

Page 6: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Introduction

• DB2 system programmers and DBAs have normally not enough

time to dedicate to performance analysis and tuning of DB2

subsystems and applications

• They also don’t have time to provide data and reports

needed by other performance analysts (CICS, IMS, z/OS,

WebSphere, Capacity Planning)

6

Page 7: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Introduction

• EPV for DB2 is an “out of the box” Performance and Capacity

Management solution for z/OS environments of any size, type

and complexity

• Some of the most important sites in Italy already use it

• EPV for DB2 uses standard input data normally available in

any z/OS environments (mostly SMF records)

7

Page 8: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Introduction

• The main goal of EPV for DB2 is to provide a comprehensive

view of DB2 environments of any level of complexity and to

allow a quick and effective top down analysis of DB2

subsystems and workloads

• This goal is accomplished through a completely automated

process, without any need for human intervention

•More than 500 different report types in HTML pages are

provided

8

Page 9: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Introduction

9

A.S. CPU USAGE

A.S. IIP USAGE

DIST A.S. CPU UTILIZATION

DIST A.S. IIP UTILIZATION

DBM1 A.S. STORAGE

DIST A.S. STORAGE

DBM1 A.S. VIRTUAL STORAGE

DIST A.S. VIRTUAL STORAGE

MSTR LOG WRITES

MSTR LOG READS

Page 10: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Introduction

• All the graphs, tables reported in the following have been

created starting from the EPV for DB2 views highlighted in the

previous slide

• This presentation is based on a white paper published in the

EPV Newsletter (January and February 2016)

• For time reasons we will not discuss the performance impact of

zIIP over utilization on DB2 but we strongly suggest you to

read this chapter in the paper

10

Page 11: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

System AS

CPU usage in V9

11

Page 12: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

System AS – CPU usage in V9

• No zIIP offload is possible with DB2 V9

• The next picture shows the split of DBM1, MSTR and IRLM

functions in TCB and SRB mode (based on DB2 Managing

Performance manual)

• Underlined functions refer to data sharing environments

12

Page 13: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

13

System AS – CPU usage in V9System AS TCB mode SRB mode

DBM1 Opening and closing of dataset Deferred writes

DBM1 full system contraction Prefetch reads

Preformat Parallel child tasks

Extend Castouts

Asynchronous GBP writes

P-lock negotiation

Notify Exit

Page set close or pseudo-close to convert to non-GBP dependent

GBP checkpoints

Archiving Physical log writes

BSDS (bootstrap data set)

processingThread deallocation

Update commit (including unlocking of page P-locks)

Backouts

Checkpoints

Error checking Local IRLM latch contention

Management IRLM and XES global contention

Asynchronous XES contention

P-lock negotiation

Deadlock detection

MSTR

IRLM

Page 14: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

System AS – CPU usage in V9

• DBM1 is by far the major CPU consumer

• Normally most of DBM1 functions run in SRB mode

14

Page 15: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

15

0

500

1.000

1.500

2.000

2.500

3.000

3.500

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

C

P

U

s

e

c

o

n

d

s

DB2 V9

CPU usage of system address spaces

MSTR DBM1 IRLM

System AS – CPU usage in V9

Page 16: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

16

0%

10%

20%

30%

40%

50%

60%

70%

80%

90%

100%

DB2 V9

DBM1 CPU split into SRB and TCB

TCB SRB

System AS – CPU usage in V9

Page 17: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

System AS

CPU usage in V10 & V11

17

Page 18: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

System AS – CPU usage in V10 & V11

• Most of DBM1 functions offloaded to zIIP in DB2 V10 (light

blue) and DB2 V11 (light green)

• With DB2 V11 MSTR logging functions are offloaded to zIIP

(light green)

18

Page 19: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

System AS – CPU Usage in V10 & V11

19

System AS TCB mode SRB mode

DBM1 Opening and closing of dataset Deferred writes

DBM1 full system contraction Prefetch reads

Preformat Parallel child tasks

Extend Castouts

Asynchronous GBP writes

P-lock negotiation

Notify Exit

Page set close or pseudo-close to convert to non-GBP dependent

GBP checkpoints

Archiving Physical log writes

BSDS processing Thread deallocation

Update commit (including unlocking of page P-locks)

Backouts

Checkpoints

Error checking Local IRLM latch contention

Management IRLM and XES global contention

Asynchronous XES contention

P-lock negotiation

Deadlock detection

MSTR

IRLM

Page 20: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

System AS – CPU usage in V10 & V11

• MSTR CPU usage higher in DB2 V10 and V11

• MSTR offload to zIIP in DB2 V11 generally not enough to

balance that increase

• About 20 MIPS offloaded to zIIP per 1.000 write/sec

• See next slides

20

Page 21: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

System AS – CPU Usage in V10 & V11

21

0

500

1.000

1.500

2.000

2.500

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

M

I

P

S

DB2 V11

CPU and zIIP usage by system address spaces

MSTR - CPU DBM1 - CPU IRLM - CPU MSTR - zIIP DBM1 - zIIP

Page 22: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

System AS – CPU Usage in V10 & V11

22

-

5

10

15

20

25

-

200

400

600

800

1.000

1.200

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

z

I

I

P

M

I

P

S

W

r

i

t

e

r

a

t

e

DB2 V11

Log write rate vs zIIP usage

LOG WRITE RATE MSTR - zIIP

Page 23: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Evolution of MSTR

functions

23

Page 24: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Evolution of MSTR functions

•Many functions have been extended and added to the MSTR

AS in the recent DB2 versions

• The first new important function, introduced with DB2 V9, is the

System Monitor task; this task continuously checks the health of

the system at one-minute intervals trying to address the

following major issues:

�CPU stalls in DB2 resulting in latch contention

�critical usage of DBM1 virtual storage below the 2GB bar (IFCID

225 produced by class 1 statistics trace)24

Page 25: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Evolution of MSTR functions

•With DB2 V10 and V11, virtual storage constraints have been

practically eliminated by exploiting 64-bit virtual storage and

allowing DB2 to use much more real storage to improve

application performance

• So IBM introduced other new functions in MSTR to help

customers monitor the real and auxiliary storage used by DB2

subsystems (many IFCID 225 enhancements)

25

Page 26: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Evolution of MSTR functions

•With DB2 V10 the amount of virtual storage that needs to be

monitored is an order of magnitude higher than before

• An increase of MSTR CPU usage can be considered normal

• However by tracking MSTR CPU usage when migrating to DB2

V10 some customers discovered an excessive increase

•Most relevant corrections: DB2 APAR (PM49816) and z/OS

APAR (OA37821)

26

Page 27: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Evolution of MSTR functions

27

0

20

40

60

80

100

120

140

160

180

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

M

I

P

S

MSTR CPU usage

Comparison V9 - V10

DB2A V10 DB2A V9

Page 28: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Evolution of MSTR functions

• However the most important MSTR new function in DB2 V10

and V11 is the interaction with the z/OS RSM (Real Storage

Manager) to control and manage the DB2 real storage

• Two new system configuration parameters are provided:

• REALSTORAGE_MAX; this parameter sets the maximum of real and auxiliary

storage (in GB) a DB2 subsystem can use; DB2 will terminate if this threshold is

reached; new message DSNS003I will be written by MSTR when DB2

approaches the specified threshold

• REALSTORAGE_MANAGEMENT; this parameter will tell DB2 how to manage

thread storage pages that are backed in real storage but not used anymore28

Page 29: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Evolution of MSTR functions

• DB2 thread storage is now allocated in a memory object in

64-bit shared storage

• To give back real storage frames backing virtual pages inside

a memory object the IARV64 DISCARDDATA service has to be

used together with the optional KEEPREAL parameter

29

Page 30: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Evolution of MSTR functions

•When DB2 uses DISCARDDATA with KEEPREAL(YES), the

storage is only "virtually freed"; RSM flags the page as freed

or unused, but the storage is still in real storage with the data

• Real memory statistics not always accurate

•When DB2 uses KEEPREAL(NO), RSM frees and reclaims the

page immediately

30

Page 31: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Evolution of MSTR functions

• Depending on parameters settings and on the system condition

customers experimented high CPU usage in MSTR or a high

amount of memory apparently free but not usable by z/OS

• IBM provided some corrections trying to find the best

compromise between CPU and memory usage

31

Page 32: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Evolution of MSTR functions

• This is the situation after APAR PM99575 :

�if REALSTORAGE_MAX boundary is approaching or z/OS has notified DB2

(through ENF 55 signal) that there is a critical auxiliary shortage; MSTR issues

DISCARDDATA requests with KEEPREAL=NO

�if REALSTORAGE_MANAGEMENT is set to OFF, MSTR will not issue

DISCARDDATA requests; more real storage is used;

32

Page 33: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Evolution of MSTR functions

�if REALSTORAGE_MANAGEMENT is set to AUTO (default) with no paging in

the system, MSTR issues DISCARDDATA requests with KEEPREAL=YES to free

storage at thread deallocation or after 120 commits; more CPU is used and

charged to MSTR

�if REALSTORAGE_MANAGEMENT is set to AUTO (default) with paging or

REALSTORAGE_MANAGEMENT is set to ON, MSTR issues DISCARDDATA

requests with KEEPREAL=YES to free storage at thread deallocation or after

30 commits; stack storage is also discarded; even more CPU is used and

charged to MSTR

33

Page 34: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Evolution of MSTR functions

• Unfortunately even after all these fixes some of our customers

complain about excessive real storage usage when

REALSTORAGE_MANAGEMENT is set to OFF

• Running with the AUTO default should be the best option but

one of our customers, running DB2 V11, had recently a very

bad surprise

34

Page 35: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Evolution of MSTR functions

35

Page 36: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Conclusions

36

Page 37: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Conclusions

• DB2 evolution in the last years allowed more and more DBM1

and now MSTR logging activities to become zIIP eligible with

positive effect on hardware and software costs

•On the other hand the exploitation of 64 bit virtual storage

and the availability of much bigger quantities of real storage

increased the functions to be performed by the MSTR AS

• Appropriate reporting has to be available to control and

solve possible CPU and memory issues

37

Page 38: Evolution of CPU and zIIP usage inside the DB2 system ...dugi.molaro.be/wp-content/uploads/2016/04/... · Evolution of CPU and zIIP usage inside the DB2 system address spaces Danilo

Questions ?

[email protected]

www.epvtech.com

www.tps-data.eu

38