Sunday, December 20, 2020

DB2 Sequential Detection and Index Lookaside

Sequential Detection and Index Lookaside

From https://docs.broadcom.com/doc/the-db2-for-zos-performance-handbook

The significance of these two performance enhancers cannot be overstated. Sequential detection is DB2’s ability to detect a sequential access pattern, at a thread level and across one or multiple units of work, for table spaces and indexes. When a sequential access pattern is detected DB2 will launch one or more sequential prefetch engines that are independent of the thread requesting the data, in an effort to stage the data in advance of the thread request. This can result in amazingly efficient read I/O response times or zero read I/O response times in some situations. DB2 will continue to monitor the access to confirm whether or not pages of data are being requested in a sequentially available fashion and can engage or disengage the sequential prefetch on the fly. Index lookaside is a method in which DB2 keeps track of the index value ranges and checks whether or not an index entry requested is on the same leaf page as the previous request. If DB2 determines that the key being requested is indeed on the same leaf page as the previous request, then the entry can be returned without a traverse of the index b-tree or even a getpage request for the leaf page. This can result in a tremendous amount of CPU saved for index intensive operations.

It is important to note that the mechanisms for sequential detection and index lookaside are stored in the thread storage of the thread making the SQL requests. Each thread thus has its own storage for these mechanisms independent of other threads, and whether or not this storage is maintained across the boundaries of a unit of work is dictated by the RELEASE setting of the package the thread is using for the process. If the setting is RELEASE(COMMIT) then you are in essence telling DB2 that, “when I commit, I am not coming back”. So, the storage is released on every commit and the potential for index lookaside and sequential detection is reduced. If the setting is RELEASE(DEALLOCATE) then the memory for these mechanisms is retained across a unit of work, and the potential for sequential detection and index lookaside greatly increases. For this reason the setting of RELEASE(DEALLOCATE) is highly recommended for batch processing, as well as for high speed transaction processing. For transaction processing under CICS, you’ll have to use protected threads as well as RELEASE(DEALLOCATE), and for remote threads, you will need to employ high performance DBATs (described in Section 3). RELEASE(DEALLOCATE) is further described in the BIND options section of Section 3.

Effective use of these performance enhancers depends greatly upon the design of your database and application processes. A common cluster amongst joined tables, or even tables accessed individually in a repeating pattern, can affect sequential detection and index lookaside. In addition, for large batch processes the input to the process can be sorted to match the clustering sequence of the search in order to take advantage of these features. Even with a massive skip sequential process, I have witnessed a benefit to sequential detection (you probably won’t get index lookaside for a skip sequential process); whereas, even with a terrible buffer hit ratio of -241%, sequential prefetch was still a better performer than random access. With an input to the process organized in the same sequence as the data stored in the indexes and tables, RELEASE(DEALLOCATE), protected threads, and high performance DBATs, you can achieve extreme transaction rates by taking advantage of these performance enhancers. 

Friday, August 21, 2020

Understanding CICS performance on z/OS

 Check out https://www.youtube.com/playlist?list=PLezLS0Tuqb-5vZaePphy1MMyOTBUINqpn

Vides with following title can be found in the above link

CICS Performance 101: Introduction

CICS Performance 101: Session 1 - Making Sense of MIPS

CICS Performance 101: Session 2 - Making Sense of MSUs and SUs

CICS Performance 101: Session 3 - Making Sense of ITR



IBM Z Software Pricing

 Checkout https://www.youtube.com/playlist?list=PLezLS0Tuqb-4GIwmKe7pOUU8AT4h7v-ul

Below topics are covered

zSoftware Licensing Terms and Conditions
IPLA Software Terms and Conditions
Multi-Version Measurement (MVM)
Parallel Sysplex Aggregation
On/Off Capacity On Demand (OOCoD)
Backup, Disaster Recovery, and Capacity Backup Upgrade
zNALC and MzNALC
VUE Program Licensing Calculations
Cross Systems Waivers
Per Payments Pricing on z/OS
Container Pricing for IBM Z
Mobile Workload Pricing
Country Multiplex Pricing
z/VM and Distributed Linux Middleware on Z
Defined Capacity and Group Capacity Limits
Sub-Capacity and Rolling 4 Hour Average
Reading the SCRT Report
Workload Pricer Support for S&S Anniversary Dates
Advanced Entry Workload Pricing

How Tivoli Decision Support for Z/OS reports 4HRA

 Tivoli Decision Support for Z/OS leverages the SMF data to provide a variety of reports for various components of System Z. TDS maintains a database for different SMF record types which can be queried using QMF to provide reports on the fly. One such report is the monthly 4 hour rolling average report for each LPAR in the CEC. TDS provides ‘MVSPM_SYSTEM_H’ and ‘MVSPM_LPAR_H’ tables which contains the ‘MSU_4HRA’ (SMF70LAC) for each LPAR in the CEC. The below section establishes a reporting technique which will align with the SCRT report.

USING MVSPM_LPAR_H 

‘MVSPM_LPAR_H’ provides hourly statistics on logical partitions and processor activity in a PR/SM environment. It contains data from SMF type 70. The ‘MSU_4HRA’ column contains the 4-hour rolling average for each logical partition. This value ‘MSU_4HRA’ in table ‘MVSPM_LPAR_H’ is the last effective 4 hour rolling average for the hourly interval (. MSU_4HRA = LAST (V_MSU_4HRA). For example, if your recording interval is 15 minutes then the ‘MSU_4HRA’ value reported for 20th hour in TDS will be the value which occurred at 20:45(the last effective 4HRA value for that hour). This is the reason your ‘MSU_4HRA’ value would not match with your SCRT value.

LPAR NameSMF interval15 min interval MSU 4HRA1 Hour interval data in MVSPM_LPAR_H at 01:00:00
A01:00:0035
A01:15:0035
A01:30:0036
A01:45:0035TDS Value : 35(Last Effective 4HRA)
LPAR NameSMF interval15 min interval MSU 4HRA1 Hour interval data in MVSPM_LPAR_H at 03:00:00
A03:00:0033
A03:15:0033
A03:30:0034
A03:45:0034TDS Value : 34(Last Effective 4HRA)
LPAR NameSMF interval15 min interval MSU 4HRA1 Hour interval data in MVSPM_LPAR_H at 20:00:00
A20:00:0053
A20:15:0053
A20:30:0052
A20:45:0050TDS Value : 50(Last Effective 4HRA)

USING MVSPM_SYSTEM_H

MVSPM_SYSTEM_H also contains the ‘MSU_4HRA’ (SMF70LAC) for each LPAR However, the value of MSU_4HRA reported in this table is the average (MSU_4RHA = Avg (SMF70LAC, INPUT_RECORDS) of SMF70LAC SMF interval records. The MSU_4HRA values reported in this table always matches your SCRT report because SCRT uses the mean of SMF interval records to aggregate an hourly record. For example, if your SMF recording interval is 15 minutes then the MSU_4HRA value reported for 20th hour will be the average of SMF interval records (In this case AVG (20:00,20:15,20:30,20:45).

LPAR NameSMF interval15 min interval MSU 4HRA1 Hour interval data in MVSPM_LPAR_H at 01:00:00
A01:00:0035
A01:15:0035
A01:30:0036
A01:45:0035TDS Value : 35.25(Average 4HRA)
LPAR NameSMF interval15 min interval MSU 4HRA1 Hour interval data in MVSPM_LPAR_H at 03:00:00
A03:00:0033
A03:15:0033
A03:30:0034
A03:45:0034TDS Value : 33.5(Average4HRA)
LPAR NameSMF interval15 min interval MSU 4HRA1 Hour interval data in MVSPM_LPAR_H at 20:00:00
A20:00:0053
A20:15:0053
A20:30:0052
A20:45:0050TDS Value : 52(Average 4HRA)

Tivoli Decision Support for Z/OS provides the functionality to track the last effective 4 Hour Rolling Average and Mean 4 Hour Rolling Average. It is very important to understand the context of each of these values while reporting. The ‘MVSPM_SYSTEM_H’ should be used as a baseline while comparing your results with SCRT. However, to keep track of the last effective 4 HRA in an hour ‘MVSPM_LPAR_H’ becomes an ideal choice.

How SCRT Reports the 4 Hour Rolling Average?

The Detail LPAR Data (N5) section of the SCRT report shows the interval (date and hour) during the month for each LPAR on a CPC when the LPAR reached a maximum rolling 4-hour average utilization value (in MSUs). It also shows the interval in which the sum of all the LPARs reached a maximum rolling 4-hour average value. The SMF Recording interval varies from site to site based on the installation needs. The SCRT algorithm calculates 4HRA values at the hourly interval by taking an hourly average of 4HRA values at each of the LPAR SMF intervals. In the below example the SMF recording interval for LPAR A is 15 minutes and the peak reported in SCRT occurred at 20:00, so SCRT here has taken the mean of all the 4 intervals of 20th hour. 

LPAR NameSMF interval15 min interval SMF70LAC valuesSCRT value reported in N5 section at 20th hour
A20:00:0053
A20:15:0053
A20:30:0052
A20:45:0050Calculated value: AVG(20:00,20:15,20:30,20:45) 52 MSUs


Wednesday, June 24, 2020

RMF Workload Activity and CPC activity report

====================================================================
      RMF WORKLOAD REPORT:                                            
====================================================================

      REPORT BY: POLICY=OWL        WORKLOAD=CSSDDF                    
      TRANSACTIONS    ---SERVICE----  SERVICE TIMES  ---APPL %---     
      AVG      0.23   IOC         0   CPU    392.9   CP      4.98     
      MPL      0.23   CPU      3931K  SRB      0.0   AAPCP   0.00     
      ENDED      51   MSO         0   RCT      0.0   IIPCP   0.07     
      END/S    0.01   SRB         0   IIT      0.0                    
      #SWAPS      0   TOT      3931K  HST      0.0   AAP      N/A     
      EXCTD       0   /SEC      1092  AAP      N/A   IIP     2.67     
      AVG ENC  0.23                   IIP     96.1                    
====================================================================

Under "SERVICE TIMES", the RMF "CPU" value of 392.9 seconds is the total of the real CPU time on CP engines, plus the NORMALIZED CPU time on the zIIP and zAAP engines; it is NOT the CPU "TCB" time.  
But also under "SERVICE TIMES", the RMF "IIP" (zIIP) value of 96.1 seconds is the UN-NORMALIZED, raw, seconds on the zIIP engine. And the RMF "AAP" value for zAAPs is also the UN-NORMALIZED value.
And under "SERVICE", the RMF "CPU" value of 3931K is the TOTAL SERVICE units from CPs, zIIPs, and zAAPs.                         

In the RMF WLMGL Report, the field APPL% CP is the sum of the cpu times (tcb, srb, rct, iit, hst) divided by the reporting interval. An engine can theoretically be dispatched for the entire interval, so this is like saying the percentage of an engine.  For example, if APPL% CP is 324.9,  that's like saying 3 and a quarter of engine's
worth of cpu resource.



                 C P U  A C T I V I T Y 
                                                                              
            z/OS V2R1                SYSTEM ID TRX1             DATE 09/28/2013            INTERVAL 15.00.037
                                     RPT VERSION V2R1 RMF       TIME 16.45.00              CYCLE 1.000 SECONDS
  
CPU        2827   CPC CAPACITY   869        SEQUENCE CODE 0000000000089F25               
MODEL      609    CHANGE REASON=NONE        HIPERDISPATCH=YES                               
H/W MODEL  H66                                                                            

---CPU---    ---------------- TIME % ----------------   --- MT % ----   LOG PROC      --I/O INTERRUPTS--
NUM  TYPE    ONLINE    LPAR BUSY    MVS BUSY   PARKED   PROD   UTIL     SHARE %       RATE     % VIA TPI 
 0    CP     100.00     4.46         4.41        0.00   ------ ------    13.6  MED    30.65     0.20
 1    CP     100.00     0.00        -----      100.00   ------ ------     0.0  LOW     0.00     0.00
 2    CP     100.00     0.19         0.19        0.00   ------ ------     0.0  LOW     0.00     0.00
 3    CP      30.27     0.00        -----      100.00   ------ ------     0.0  LOW     0.08     0.00


MVS BUSY is a totally different view of cpu utilization from LPAR BUSY (and it can be a little confusing at first), so LPAR BUSY and MVS BUSY values won't necessarily match. The MVS BUSY is the percentage of time this z/OS did not go into a wait state.  So MVS BUSY represents how busy the LPAR was, but it doesn't show how much the LPAR has consumed its online logical engines.  You would look at the LPAR BUSY to determine this. The LPAR BUSY is the percentage of this LPAR's online logical CPs that the LPAR actually consumed.  If the number of logical CPs for an LPAR is equal to the number of physical CPs for the box,  
then LPAR BUSY is like saying what percentage of the box the LPAR
is using.                                                        
                                                                      
LPAR BUSY being less than MVS BUSY means that MVS dispatched work onto one of its logical CPs, but PR/SM took away that physical engine away from the logical engine to give to another LPAR.  Therefore MVS still thinks it has a logical engine (MVS BUSY clock keeps ticking) but PR/SM knows that LPAR is no longer
running on a physical engine (LPAR BUSY clock is no longer ticking).