© 2014 IBM Corporation Information Management Key Metrics for DB2 for z/OS Subsystem and Application Performance Monitoring (Part 1) Omaha DB2 Users Group.

Slides:



Advertisements
Similar presentations
Yukon – What is New Rajesh Gala. Yukon – What is new.NET Framework Programming Data Types Exception Handling Batches Databases Database Engine Administration.
Advertisements

Lecture 10 Sharing Resources. Basics of File Sharing The core component of any server is its ability to share files. In fact, the Server service in all.
Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.
Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
Cache –Warming Strategies for Analysis Services 2008 Chris Webb Crossjoin Consulting Limited
EXECUTION PLANS By Nimesh Shah, Amit Bhawnani. Outline  What is execution plan  How are execution plans created  How to get an execution plan  Graphical.
Acknowledgments Byron Bush, Scott S. Hilpert and Lee, JeongKyu
The Components There are three main components of inDepth Lite, inDepth and inDepth+ Real Time Component Reporting Package Configuration Tools.
1 DB2 Access Recording Services Auditing DB2 on z/OS with “DBARS” A product developed by Software Product Research.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 19 Scheduling IV.
© 2014 IBM Corporation Information Management At Your Service: Optimizing DB2 for z/OS for Client-Server Applications Delaware Valley DB2 Users Group September.
1 - Oracle Server Architecture Overview
Chapter 11 Operating Systems
1 I/O Management in Representative Operating Systems.
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
Module 8: Monitoring SQL Server for Performance. Overview Why to Monitor SQL Server Performance Monitoring and Tuning Tools for Monitoring SQL Server.
Advance Computer Programming Java Database Connectivity (JDBC) – In order to connect a Java application to a database, you need to use a JDBC driver. –
Introduction and simple using of Oracle Logistics Information System Yaxian Yao
Introduction Optimizing Application Performance with Pinpoint Accuracy What every IT Executive, Administrator & Developer Needs to Know.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Database Performance Tuning and Query Optimization.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
By Lecturer / Aisha Dawood 1.  You can control the number of dispatcher processes in the instance. Unlike the number of shared servers, the number of.
1 Robert Wijnbelt Health Check your Database A Performance Tuning Methodology.
Physical Database Design & Performance. Optimizing for Query Performance For DBs with high retrieval traffic as compared to maintenance traffic, optimizing.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Extents, segments and blocks in detail. Database structure Database Table spaces Segment Extent Oracle block O/S block Data file logical physical.
TEMPDB Capacity Planning. Indexing Advantages – Increases performance – SQL server do not have to search all the rows. – Performance, Concurrency, Required.
© Dennis Shasha, Philippe Bonnet – 2013 Communicating with the Outside.
Improving Efficiency of I/O Bound Systems More Memory, Better Caching Newer and Faster Disk Drives Set Object Access (SETOBJACC) Reorganize (RGZPFM) w/
BW Know-How Call : Performance Tuning dial-in phone numbers! U.S. Toll-free: (877) International: (612) Passcode: “BW”
Introduction to the new mainframe © Copyright IBM Corp., All rights reserved. Chapter 12 Understanding database managers on z/OS.
DB2. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/DB01/003 Version No:2.0a Session Plan Introduction to Concurrency Control Different types.
© 2008 Quest Software, Inc. ALL RIGHTS RESERVED. Perfmon and Profiler 101.
Chapter 7 Operating Systems. Define the purpose and functions of an operating system. Understand the components of an operating system. Understand the.
Week #3 Objectives Partition Disks in Windows® 7 Manage Disk Volumes Maintain Disks in Windows 7 Install and Configure Device Drivers.
Views Lesson 7.
M1G Introduction to Database Development 5. Doing more with queries.
Data Sharing. Data Sharing in a Sysplex Connecting a large number of systems together brings with it special considerations, such as how the large number.
DBT544. DB2/400 Advanced Features Level Check Considerations Database Constraints File Overrides Object and Record Locks Trigger Programs.
Operating Systems Lecture 14 Segments Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of Software Engineering.
Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.
1 Chapter 13 Parallel SQL. 2 Understanding Parallel SQL Enables a SQL statement to be: – Split into multiple threads – Each thread processed simultaneously.
IMS 4212: Database Implementation 1 Dr. Lawrence West, Management Dept., University of Central Florida Physical Database Implementation—Topics.
1 Chapter 9 Tuning Table Access. 2 Overview Improve performance of access to single table Explain access methods – Full Table Scan – Index – Partition-level.
Oracle Architecture - Structure. Oracle Architecture - Structure The Oracle Server architecture 1. Structures are well-defined objects that store the.
for all Hyperion video tutorial/Training/Certification/Material Essbase Optimization Techniques by Amit.
Chapter 7 Memory Management Eighth Edition William Stallings Operating Systems: Internals and Design Principles.
Database Systems, 8 th Edition SQL Performance Tuning Evaluated from client perspective –Most current relational DBMSs perform automatic query optimization.
Active-HDL Server Farm Course 11. All materials updated on: September 30, 2004 Outline 1.Introduction 2.Advantages 3.Requirements 4.Installation 5.Architecture.
This was written with the assumption that workbooks would be added. Even if these are not introduced until later, the same basic ideas apply Hopefully.
Diving into Query Execution Plans ED POLLACK AUTOTASK CORPORATION DATABASE OPTIMIZATION ENGINEER.
© 2009 IBM Corporation IWS z/OS SPEs Auditing enhancements.
SQL Database Management
1 DB2 Access Recording Services Auditing DB2 on z/OS with “DBARS” A product developed by Software Product Research.
Table General Guidelines for Better System Performance
Memory Management.
Chapter 2 Memory and process management
SQL Server Monitoring Overview
Database Performance Tuning and Query Optimization
JULIE McLAIN-HARPER LINKEDIN: JM HARPER
Table General Guidelines for Better System Performance
Presentation & Demo August 7, 2018 Bill Shelden.
Chapter 2: Operating-System Structures
Introduction to Operating Systems
Transactions and Concurrency
Chapter 11 Database Performance Tuning and Query Optimization
Chapter 2: Operating-System Structures
CS222/CS122C: Principles of Data Management UCI, Fall 2018 Notes #03 Row/Column Stores, Heap Files, Buffer Manager, Catalogs Instructor: Chen Li.
Presentation transcript:

© 2014 IBM Corporation Information Management Key Metrics for DB2 for z/OS Subsystem and Application Performance Monitoring (Part 1) Omaha DB2 Users Group September 9, 2014 Robert Catterall, IBM

© 2013 IBM Corporation Information Management © 2014 IBM Corporation2 The genesis of this presentation  Mainframe DB2 people have an abundance of data fields they can look at for performance monitoring purposes –In DB2 monitor displays and reports –In z/OS monitor displays and reports –In various DB2 -DISPLAY commands –In CICS (DSNC) DISPLAY STATISTICS command output  With all of these numbers staring back at you, you could: –Freeze up (sometimes referred to as “analysis paralysis”) –Try to analyze everything, all the time (maybe OK if you have a LOT of free time on your hands) –Focus too much on “FYI” and “level 2” numbers (the latter being fields that you should check if a “level 1” number is not what it should be), and overlook what’s really important

© 2013 IBM Corporation Information Management © 2014 IBM Corporation3 My goal  Through this presentation, I want to help you to be more effective and efficient in monitoring DB2 subsystem and application performance  How? –By spotlighting the relatively small set of metrics that are your most important indicators of good (or not) performance

© 2013 IBM Corporation Information Management © 2014 IBM Corporation4 Agenda  Part 1 –DB2 monitor-generated reports versus online displays –Application performance: DB2 monitor accounting reports (and displays)  Part 2 –Subsystem performance: DB2 monitor statistics reports (and displays) –The best bits in DB2 and CICS DISPLAY command output –Important DB2-related stuff in z/OS monitor reports and displays

© 2013 IBM Corporation Information Management © 2014 IBM Corporation5 DB2 monitor-generated reports versus online displays

© 2013 IBM Corporation Information Management © 2014 IBM Corporation6 Ongoing tuning versus putting out fires  Many sites use their DB2 for z/OS monitor exclusively in online mode –Online monitoring is valuable, especially when you need to see what’s happening right now in order to diagnose a performance problem –For in-depth, ongoing analysis of the performance “health” of a DB2 for z/OS subsystem and associated applications, I prefer to use DB2 monitor-generated reports If you’ve only used your DB2 monitor in online mode, look into the product’s batch reporting capabilities In this presentation, I’ll show a lot of information excerpted from DB2 monitor-generated reports – you should be able to find most of this information in online displays, as well

© 2013 IBM Corporation Information Management © 2014 IBM Corporation7 Generating reports with your DB2 monitor  Usually involves executing a batch job that includes a DD statement pointing to a data set containing DB2 trace records (these records are usually written to SMF) –Batch job has a control statement in SYSIN, in which you specify things such as: “From” and “to” dates/times Report type (e.g., ACCOUNTING LONG) Filtering criteria (e.g., include or exclude a DB2 plan name) Report data organization options (e.g., order by connection type)

© 2013 IBM Corporation Information Management © 2014 IBM Corporation8 The two most useful DB2 monitor reports  Accounting long (aka “accounting detail”), with: –“From” and “to” times encompassing either a busy 1- or 2-hour time period, or a 24-hour time period –Data ordered by (or “grouped by”) connection type Gives you a detailed report for each DB2 connection type: CICS, IMS, DRDA, TSO, call attach, utility, etc. If you need more granularity, can get data at correlation-name level (e.g., CICS transaction ID or batch job name), primary auth ID level, etc.  Statistics long (aka “statistics detail”), with: –Same “from” and “to” times as accounting reports (see above)  In addition to providing very useful information, these two reports are pretty inexpensive (records on which the reports are based are generated by low-overhead DB2 traces)

© 2013 IBM Corporation Information Management © 2014 IBM Corporation9 Application performance: DB2 monitor accounting reports (and displays)

© 2013 IBM Corporation Information Management © 2014 IBM Corporation10 Understanding your DB2 application workload  What’s the biggest component of your DB2 workload? –Seems simple enough, but I’ve found that plenty of DB2 people cannot readily answer this question as it pertains to their site  “Biggest” – biggest in terms of aggregate class 2 CPU time –Information comes from DB2 accounting trace class 2 –Also known as “in-DB2” CPU time –Indicates the CPU cost of SQL statement execution  “Component” – connection type (e.g., CICS, batch, DRDA, etc.)

© 2013 IBM Corporation Information Management © 2014 IBM Corporation11 Answering the “biggest component” question  Accounting long report, with data ordered by connection type  For each connection type, perform a simple calculation (referring to sample report output on following slide): –(average class 2 CPU time) X (number of occurrences) –“Number of occurrences” = number of trace records Usually one per transaction for online, one per job for batch DB2 can “roll up” accounting records for DRDA transactions (ACCUMACC – default is 10 – and ACCUMUID parameters in ZPARM) –Reports generated by different monitors can look a little different Samples in this presentation are from reports generated by IBM’s Tivoli OMEGAMON XE for DB2 Performance Expert on z/OS Fields in reports can usually be found in online monitor displays –Note: I’m leaving out some report lines and columns because putting all on a slide would require a too-small font size

© 2013 IBM Corporation Information Management © 2014 IBM Corporation12 Sample report output (2-hour time period) CONNTYPE: DRDA AVERAGE DB2 (CL.2) HIGHLIGHTS CP CPU TIME #OCCURRENCES : SE CPU TIME (avg CL 2 CPU) X (# of occurrences) = X 3,087,344 = 21,494 seconds In a DB2 data sharing environment, do this for each member of the group to get TOTAL DRDA SQL cost, TOTAL CICS-DB2 SQL cost, etc. Don’t forget this! (SE = “specialty engine,” which usually means zIIP)

© 2013 IBM Corporation Information Management © 2014 IBM Corporation13 The DRDA part of the overall DB2 workload  Often, DRDA-related activity is the fastest-growing component of an organization’s DB2 for z/OS workload  At some sites, DRDA-related activity is the largest component of the DB2 for z/OS workload – bigger than CICS-DB2, bigger than batch-DB2 –Again, “largest” refers to total class 2 CPU time  I have found that people – even mainframe DB2 people – are often unaware of this –Not uncommon for senior IT managers to think of the mainframe as just the server where the “legacy” applications run –In fact, the mainframe DB2 platform is evolving to become a “super- sized” (and super-available, super-secure) data server for multi-tier apps

© 2013 IBM Corporation Information Management © 2014 IBM Corporation14 Another important workload characteristic  Is the DB2 workload CPU-constrained?  A good place to check: “not accounted for” time in the DB2 monitor Accounting Long report –What it is: in-DB2 (i.e., class 2) elapsed time that is not CPU time, not suspension time (the latter being class 3, or “waiting for” time) –Basically DB2 saying, “this was time, related to SQL statement execution, that I can’t account for” –In my experience, usually associated with DB2 wait-for-dispatch time In other words, DB2 (vs. application) tasks are not being readily dispatched –DB2 address spaces usually have a high priority in the system, so if not-accounted-for time is relatively high for a transactional workload, it could be that you’ve hit a processing capacity wall

© 2013 IBM Corporation Information Management © 2014 IBM Corporation15 DB2 not-accounted-for time (1)  I get concerned if not-accounted-for time is greater than 10% for a high-priority transactional workload such as CICS-DB2 (or, often, DRDA) –Not so concerned if this time exceeds 10% for batch DB2 workload – that’s not uncommon CONNTYPE: CICS CLASS 2 TIME DISTRIBUTION CPU |===============> 30% SECPU | NOTACC |==> 5% SUSP |================================> 65%

© 2013 IBM Corporation Information Management © 2014 IBM Corporation16 DB2 not-accounted-for time (2)  If your monitor report does not have the “bar chart” elapsed time breakdown shown on the preceding slide, it will likely have a “not accounted for” field in the “class 2” time column (in red at left)  If “not accounted for” time is not provided, calculate it yourself:  A – (B + C + D) CONNTYPE: CICS AVERAGE DB2 (CL.2) ELAPSED TIME A CP CPU TIME B SE CPU TIME C SUSPEND TIME D NOT ACCOUNT

© 2013 IBM Corporation Information Management © 2014 IBM Corporation17 What if not-accounted-for time is high?  Add capacity (could just be an LPAR configuration change)  If that’s not feasible… –May see what you can do to reduce CPU consumption of the DB2 workload (more on that to come in this presentation) –Ensure that dispatching priorities are optimized for throughput in a CPU-constrained environment IRLM should be in the SYSSTC service class (very high priority) DB2 MSTR, DBM1, DIST, and stored procedure address spaces should be assigned to a high-importance service class (my opinion: somewhat higher priority than CICS AORs)  If system is really busy, you may need to go with PRIORITY(LOW) for CICS-DB2 transaction TCBs (relative to priority of CICS AOR main task – default is HIGH) Classify DRDA transactions (in WLM policy) so they won’t run as “discretionary” work

© 2013 IBM Corporation Information Management © 2014 IBM Corporation Related: are you zIIP-constrained?  Referring to the report snippet above, you want the percentage of zIIP-eligible CPU time consumed on a general-purpose engine to be low – calculation is A / (A + B) –In this case, the figure is less than 1% – that’s good –If the figure is > 5%, I’d be concerned about contention for zIIP MIPs That kind of “zIIP-eligible, but not zIIP-executed” figure might be seen on a system on which zIIP engine utilization is around 60% – or even less if a system has only one zIIP engine 18 AVERAGE APPL(CL.1) CP CPU TIME SECP CPU SE CPU TIME A B This field shows you how much zIIP-eligible work actually ran on a general-purpose engine That can happen when a zIIP engine is not available at the time zIIP-eligible work is ready for dispatch

© 2013 IBM Corporation Information Management © 2014 IBM Corporation19 How is your DB2 I/O performance?  Average service time for synchronous I/Os = A / B  Times are getting to be really low (in this case, 1.06 ms) –Has much to do with advances in I/O hardware and software: faster channels, parallel access volumes (reduces UCB-level queuing), lots of disk controller cache (and sophisticated management of same)  A time > 5 ms represents opportunity for improvement  A time > 10 ms could indicate a performance problem CONNTYPE: DB2CALL A B CLASS 3 SUSPENSIONS AVERAGE TIME AV.EVENT SYNCHRON. I/O Sample report output

© 2013 IBM Corporation Information Management © 2014 IBM Corporation20 How CPU-efficient are your DB2 applications?  Usually, you’re aiming to reduce A (referring to sample report below), which is in-DB2 CPU time (CPU cost of SQL statement execution) – Note that, sometimes, reducing A can be accomplished by increasing B (recall that “SE” is short for “specialty engine,” which usually is a zIIP engine – more on this to come) AVERAGE DB2 (CL.2) CP CPU TIME A SE CPU TIME B Sample accounting report output

© 2013 IBM Corporation Information Management © 2014 IBM Corporation21 Average CPU time – per what and for what?  Depends on scope of information in accounting report (specified by you)  Could be average: –Per transaction/job for connection type (e.g., all DRDA, all call attach) –Per transaction for a CICS AOR (an example of a connection ID) –For a given batch job or CICS tran (examples of correlation names) –Per transaction or job for a given DB2 authorization ID  Larger scope can be appropriate when planning change of the “rising tide lifts all boats” variety (e.g., page-fixed buffer pool) –Largest scope: DB2 subsystem ID AVERAGE DB2 (CL.2) CP CPU TIME SE CPU TIME If DRDA accounting records rolled up, number of commits is good indicator of number of transactions

© 2013 IBM Corporation Information Management 22 Information at the program (package) level  May be LOTS of packages in the report – where do you start? –Your monitor may show in the Accounting Long report the top programs by elapsed time (class 7) –High elapsed time often points to high CPU time  Very useful if a batch job or transaction involves execution of multiple programs  Requires data from DB2 accounting trace classes 7 and 8 M123456B TIMES CP CPU TIME 13: SE CPU TIME Sample report output PROGRAM NAME CLASS 7 CONSUMERS D789123Y |=> 3% M123092G |=======> 15% I273459Z |> 1% Package name

© 2013 IBM Corporation Information Management © 2014 IBM Corporation23 Application efficiency: thread reuse  Sample above shows a thread reuse rate of 99% -- very good  Boost CICS-DB2 thread reuse via protected entry threads for high-use trans (PROTECTNUM in DB2ENTRY RDO resource) –Non-protected thread usually deallocated after transaction completes –Protected thread will stick around for 45 seconds (default) after transaction completes – can be reused by another transaction associated with same DB2ENTRY if plan name doesn’t change NORMAL TERM. AVERAGE NEW USER 0.79 DEALLOCATION 0.01 RESIGNON 0.20 (data in this report sample happens to be for a CICS-DB2 workload) Thread reused, auth ID changed Thread not reused Thread reused, no auth ID change

© 2013 IBM Corporation Information Management © 2014 IBM Corporation24 Maximizing performance benefit of thread reuse  Bind packages executed via reused threads with RELEASE(DEALLOCATE) –What that means: table space locks, package sections allocated to thread will be retained until thread deallocation, vs. being released at commit –If package is executed repeatedly via the same thread, these resources won’t have to be repeatedly reacquired – that improves CPU efficiency  Can reduce CPU consumption by several percentage points  Considerations: –Not good bind option for programs that get exclusive table space locks –Can impact scheduling of DDL, utilities, bind/rebind operations DB2 11 (NFM) relief: use of a RELEASE(DEALLOCATE) package executed via a persistent thread will be drained, and RELEASE will be temporarily changed to COMMIT, so as not to block utility or DDL or bind/rebind operation

© 2013 IBM Corporation Information Management © 2014 IBM Corporation25 DB2 10: a new thread reuse option  High performance DBATs (database access threads – used for client-server work that comes through DB2 DDF) –High performance DBAT is instantiated when a DBAT used to execute a package bound with RELEASE(DEALLOCATE) Prior releases of DB2 treated RELEASE(DEALLOCATE) packages as though bound with RELEASE(COMMIT) when executed via DBAT –Once instantiated, high performance DBAT will remain dedicated to instantiating connection and can be reused for 200 units of work If instantiating application disconnects from DB2 before high-performance DBAT has been reused 200 times, DBAT will be pooled (APAR PI20352) –Best used for simple, high-volume DRDA transactions May want to bind IBM Data Server Driver or DB2 Connect packages with RELEASE(DEALLOCATE) – perhaps in a separate collection (e.g., NULLID2), to allow for selective use of high-performance DBATs –Monitoring: DB2 monitor Statistics Long report (to be covered)

© 2013 IBM Corporation Information Management © 2014 IBM Corporation26 Application efficiency: GETPAGES  #1 determinant of CPU time for DB2-accessing job/transaction  Ways to reduce GETPAGE activity: –Change query access paths Often involves adding indexes or modifying existing indexes Might involve rewriting the query to get a better-performing access path –Re-cluster data ALTER INDEX CLUSTER / NOT CLUSTER Table-controlled partitioning: can have different clustering, partitioning keys –Archive/purge “cold” data, so “warm” data not so spread out in table DB2 11 provides automatic data archiving capability TOTAL BPOOL ACTIVITY AVERAGE GETPAGES

© 2013 IBM Corporation Information Management © 2014 IBM Corporation27 Application efficiency: dynamic SQL cache  Tends to be particularly important for client-server transactions (DRDA workload) – often involve execution of dynamic SQL –Recall that when programs issue JDBC or ODBC calls, these are executed as dynamic SQL statements on the DB2 for z/OS server –CPU cost of full PREPARE of a statement can be several times the cost of statement execution  One way to boost statement cache hits: enlarge the dynamic statement cache (it’s been above 2 GB “bar” since DB2 V8)  Also: use parameter markers (vs. literal values) in dynamic SQL statements (cache “hit” requires byte-for-byte match) DYNAMIC SQL STMT AVERAGE NOT FOUND IN CACHE A 0.26 FOUND IN CACHE B 1.05 You want to maximize B / (A + B)

© 2013 IBM Corporation Information Management © 2014 IBM Corporation28 DB2 10 and dynamic statement caching  CONCENTRATE STATEMENTS WITH LITERALS attribute of PREPARE statement (can also be enabled on DB2 client side by specifying keyword in data source or connection property) –If match for dynamic statement with literals not found in cache, literals replaced with & and cache is searched to find match for new statement If not found, new statement is prepared and placed in the cache  Not quite as CPU-efficient as traditional dynamic statement caching and parameterized SQL, but less costly than full prepares of dynamic statements containing literals –Note: may WANT optimization using literals for range predicates DYNAMIC SQL STMT AVERAGE CSWL – MATCHES FOUND 0.24

© 2013 IBM Corporation Information Management © 2014 IBM Corporation29 Application efficiency: shifting work to zIIPs  zIIP offload reduces cost of computing  Options for increasing zIIP utilization: –For DRDA workload, if using traditional DB2 stored procedures, switch to native SQL procedures –If it’s a batch workload, consider binding some packages with DEGREE(ANY) to enable query parallelization May want to limit degree of parallelization via PARAMDEG in ZPARM (or through the DB2 10-introduced SYSQUERYOPTS catalog table) AVERAGE DB2 (CL.2) CP CPU TIME A SE CPU TIME B  Aim: reduce A by increasing B

© 2013 IBM Corporation Information Management © 2014 IBM Corporation30 Robert Catterall