Académique Documents
Professionnel Documents
Culture Documents
Ashraf Kamel
akamel@us.ibm.com
Mike Mardis
mardis@us.ibm.com
© 2016 IBM Corporation
1
IBM z Systems for SAP
Prerequisite
ADM530
“SAP NetWeaver on DB2 for z/OS”
- Chapter 9: Performance Monitoring and Tuning
Agenda
Prerequisite material
Background Summary
o Origin of SAP Performance Data
Performance Roadmap
Case Studies
© 2016 IBM Corporation
3
IBM z Systems for SAP
Agenda
Prerequisite material
Background Summary
o Origin of SAP Performance Data
Performance Roadmap
Case Studies
© 2016 IBM Corporation
4
IBM z Systems for SAP
What is High?
HIGH: 400 ms for dialog
HIGH: 40% of overall average response time for dialog
I/O suspensions
Locking issues
DB2 latching or IRLM latching
Low buffer pool hit ratios
Critical thresholds reached
Improper configuration settings
Data sharing: Global contention or false contention
WLM settings
Resource allocation to DB2
Outdated RUNSTATS and REORGs
Monitoring Roadmap
ST03 Which processes are
currently running?
Workload Analysis
Are the buffers (Today on all servers)
optimally adjusted? Database Operations
Average Times
Serious problems on
the database server? SM66
SM51 SAP Servers
Work Process Overview
Server Work Process
On an Application Server,
ST02 SM50 Process Overview For Example SAP01
ST04
Database Activity
DB2 System
Threads NAME ST A REQ ID AUTHID
Stmt Cache SERVER RA * 1552 D8HDIA000 R3USER
Times V437-WORKSTATION=ihls04, USERID=r3user
Inst. Parameters
z/OS SysLog
© 2016 SAP ADM530 Chapter 9
12
IBM z Systems for SAP
CPU Time
Response Time
Presentation
Server Application Server Database Server
CPU Time
Response Time
Monitoring Roadmap
ST03 Which processes are
currently running?
Workload Analysis
Are the buffers (Today on all servers)
optimally adjusted? Database Operations
Average Times
Serious problems on
the database server? SM66
SM51 SAP Servers
Work Process Overview
Server Work Process
On an Application Server,
ST02 SM50 Process Overview For Example SAP01
ST04
Database Activity
DB2 System
Threads NAME ST A REQ ID AUTHID
Stmt Cache SERVER RA * 1552 D8HDIA000 R3USER
V437-WORKSTATION=ihls04, USERID=r3user
Times
Inst. Parameters
z/OS SysLog
© 2016 SAP ADM530 Chapter 9
15
IBM z Systems for SAP
SAP AS
Work Process
Database
SAP Tables
Table X Table X
Table Buffers
First Access
Key
TAB: Table name
K1: Key field name
F1: Field name
Monitoring Roadmap
ST03 Which processes are
currently running?
Workload Analysis
Are the buffers (Today on all servers)
optimally adjusted? Database Operations
Average Times
Serious problems on
the database server? SM66
SM51 SAP Servers
Work Process Overview
Server Work Process
On an Application Server,
ST02 SM50 Process Overview For Example SAP01
ST04
Database Activity
DB2 System
Threads NAME ST A REQ ID AUTHID
Stmt Cache SERVER RA * 1552 D8HDIA000 R3USER
Times V437-WORKSTATION=ihls04, USERID=r3user
Inst. Parameters
z/OS SysLog
© 2016 SAP ADM530 Chapter 9
19
IBM z Systems for SAP
Locking: Basics
Row Level Locking
Reads mostly with UR, but some important CS
Late escalation
NUMLKTS = 2097152
LOCKMAX = SYSTEM (or 1000000)
High limits
NUMLKUS = 2097152
SAP prefers large timeout values
IRLMRWT = 600
UTIMOUT = 3
Deadlocks
DEADLOK = 5.1
2 X-Lock
With
Enqueue 4
1 X-Enqueue
R1, R2 waits
1 T1: Enqueue Time for 2
3 T1: Update 4 T1: Commit
Row R1,R2 Row R1,R2
T2: Enqueue T1 T2
2 5 T2: Update 6 T2: Commit
Row R1,R2 Row R2
Key
T1, T2 Transaction 1, Transaction 2
R1, R2 Row 1, Row 2
Read Operations
Prefetch disabled - no buffers
Prefetch disabled - no read engine
Write Operations
Write engine not available
Deferred write threshold reached
Vertical deferred write threshold reached
Data manager critical threshold reached
C
B A
B C
B A A B
B C
B 128
A B B A
VDWQT A B C
B B A A A
A B C
A B B B
A B C
A B C
Sequential
VPSEQT C C C C C C
DWQT
... ...
C C
C C C C ... C ... C
A B C
Key
Header Item Requirements
Pages read
SUM SUM
total pages read Random requested getpages
Random synchronous reads
Pages read per prefetch = total pages read / all type prefetch reads
Write operations
Buffer updates
Pages written
Synchronous writes
Asynchronous writes
SUM Write I/Os
Pages written
Pages written per write I/O = Write I/Os
Write I/Os
Write rate =
Interval of measurement
Activity Time
In DB2 Time
ABAP Program
...
SELECT * FROM sflight INTO wa_sflight
D DB2
FOR ALL ENTRIES IN ftab
WHERE connid = ftab-connid
B Native
and carrid = ftab-carrid. S SQL
...
L
© 2016 SAP ADM530 Chapter 9
36
IBM z Systems for SAP
plan_table
Optimizer
DB2
© 2016 SAP ADM530 Chapter 9
37
IBM z Systems for SAP
DSC Statistics
Monitoring Roadmap
ST03 Which processes are
currently running?
Workload Analysis
Are the buffers (Today on all servers)
optimally adjusted? Database Operations
Average Times
Serious problems on
the database server? SM66
SM51 SAP Servers
Work Process Overview
Server Work Process
On an Application Server,
ST02 SM50 Process Overview For Example SAP01
ST04
Database Activity
DB2 System
Threads NAME ST A REQ ID AUTHID
Stmt Cache SERVER RA * 1552 D8HDIA000 R3USER
Times V437-WORKSTATION=ihls04, USERID=r3user
Inst. Parameters
z/OS SysLog
© 2016 SAP ADM530 Chapter 9
41
IBM z Systems for SAP
HH:MM:SS.MS Duration Program Obj. name Op. Curs Array Recs. RC Conn Statement
11:38:59.066 119 ZZXGD_M MARA DECLARE 95 0 R/3 SELECT WHERE "MANDT" = ? AND "MATNR" IN ( ? , ? , ? , ?
11:38:59.066 42.991 ZZXGD_M MARA PREPARE 95 0 R/3 SELECT WHERE "MANDT" = ? AND "MATNR" IN ( ? , ? , ? , ?
11:38:59.109 12 ZZXGD_M MARA OPEN 95 0 R/3 SELECT WHERE "MANDT" = '000' AND "MATNR" IN (
‘0000000000
11:38:59.109 112.139 ZZXGD_M MARA FETCH 95 23 5 100 R/3
Advanced Techniques
Relevant data
- the hit set -
SELECT
Clause
Data to be searched
WHERE Clause - limited only by
the use of indexes -
Search Area
rsdb/stattime parameter
rsdb/stattime parameter
stat/tabrec parameter
stat/tabrec parameter
stat/tabrec parameter
stat/tabrec parameter
stat/tabrec parameter
stat/tabrec parameter
Agenda
Prerequisite materials
Background Summary
o Origin of SAP Performance Data
Performance Roadmap
Case Studies
© 2016 IBM Corporation
57
IBM z Systems for SAP
Table Buffers
Application Server A Application Server B Number Range Buffer
PXA Programm Buffer
original original Presentation Buffer
Work Work
Processes R/3 Buffers Processes R/3 Buffers
CUA Buffer
Nametab Buffer
Communication System
Database
DBMS Database
Management Processes Cache
System
Database
A
AEFGH
AEF
AEFG
AE
DB-1
X 1000
AEFGH
A
AE
AEF
AEFG
DASD
DB-1
X 1000
ABE
AB
ABEFGH
A
DASD
AA’
A
DASD
Buffer Synchronization
• Changes on “bufferable” tables
– Each change on a “bufferable” table is noted in the DDLOG table for
multiple application server systems (rdisp/bufrefmode =
sendon,exeauto)
– Each application server reads the DDLOG contents in a certain period
determined by rdisp/bufreftime (default 120 for 4.7+)
– Tool available in ST02 -> Detailed analysis menu -> Buffer synchron.
rsdb/stattime parameter
Memory Management - EM
Extended Memory
• Dominant residence for ABAP program requirements. Mapped to
shared memory
• Shared memory allows transparent access from all work processes
• While problems most often manifest themselves with extended memory
being referenced in the dump and problem analysis, em is almost
always the ‘messenger’ for poor programming overusing memory
• Analysis available in ST02 -> double click “ext memory” -> Mode List
• Dialog user analysis in SM04 -> Goto -> Memory -> Sort on Mem(Total)
• STAT records historical in Task/Memory button
• Memory Inspector – Transaction: S_MEMORY_INSPECTOR
– Create/View & Compare Memory Snapshots
Memory Management - EM
Agenda
Prerequisite materials
Background Summary
o Origin of SAP Performance Data
Performance Roadmap
Case Studies
© 2016 IBM Corporation
84
IBM z Systems for SAP
Programing Programing!
ABAP Programming
Before software can be
reusable it first has to be
usable. ~Ralph Johnson
http://www.eskimo.com/~hottub/software/programming_quotes.html
sum = 0.
SELECT amount INTO amt
FROM tab WHERE year = '1996'.
sum = sum + amt.
ENDSELECT.
SELECT *
FROM QALS
WHERE stat35 <> ‘X’
AND werks = lv_plant
AND herkunkt = ’01’.
SELECT *
FROM QALS
WHERE stat35 = space
AND werks = lv_plant
AND herkunkt = ’01’.
OR
• ORDER BY
– ... does not force the DB to use a certain index!
submit rsbdcsub
with mappe = p_group
and return
exporting list to memory.
do.
select single * from apqi where qid = v_qid and
groupid = p_group and
datatyp = 'BDC' and
credate = sy-datum.
if sy-subrc = 0 and ( apqi-qstate = 'F' or apqi-qstate = 'E' ).
exit.
endif.
enddo.
This code is part of a custom routine that submits a BDC (Batch Data Communications) and waits
for it’s completion before continuing. At the initial go-live the data in the system resulted in an
almost instantaneous response. However as time has progressed, on a lot of occasions the BDC
takes from 5sec and up to 1 minute to return. The query on APQI is efficient (0.25 milliseconds)
but this means it executes ~4,000 per second while this is do loop running, and consumes a CPU
on the application server or DB server at any point in time.
This solution is extremely simple and elegant, simply putting the ABAP ‘to sleep’ for 2 seconds
each time an unsuccessful call is made to table APQI. Statistically this will add one second to the
batch job’s average runtime as on average the BDC will finish half way through the last 2 second
wait period.
0
19/02/2007
20/02/2007
21/02/2007
22/02/2007
23/02/2007
24/02/2007
IBM z Systems for SAP
25/02/2007
26/02/2007
27/02/2007
28/02/2007
1/03/2007
2/03/2007
3/03/2007
4/03/2007
5/03/2007
6/03/2007
7/03/2007
9/03/2007
10/03/2007
Polling Removal - Improvement
11/03/2007
12/03/2007
13/03/2007
14/03/2007
15/03/2007
16/03/2007
17/03/2007
18/03/2007
19/03/2007
20/03/2007
Series1
98
IBM z Systems for SAP
* WA_KEY_NUM = 0. "case7525
LOOP AT ITAB_TCODE.
LOOP AT TLOG_USER.
ALERT_FOR_USER = SPACE.
CLEAR ALERTS_TAB.
* check mitigating control
*-Start of Modify----Ravi.S----09/09/2005-----------------------------*
IF PA_MIT = 'X'.
CLEAR: MIT_FLAG.
LOOP AT MIT_TAB.
IF ITAB_TCODE-ZVIRSODID CP MIT_TAB-ZVIRSODID AND
TLOG_USER-UNAME CP MIT_TAB-BNAME.
MIT_FLAG = 'X'.
EXIT.
ENDIF.
* READ TABLE MIT_TAB WITH KEY ZVIRSODID = ITAB_TCODE-ZVIRSODID
* BNAME = TLOG_USER-UNAME.
ENDLOOP.
* IF SY-SUBRC = 0.
IF MIT_FLAG = 'X'.
*-End of Modify----Ravi.S----09/09/2005-----------------------------*
CONTINUE.
ENDIF.
ENDIF.
Agenda
Prerequisite materials
Background Summary
o Origin of SAP Performance Data
Performance Roadmap
Case Studies
© 2016 IBM Corporation
101
IBM z Systems for SAP
• Query Processing
– Start Joins and Dynamic Indexing
Basic Cubes
PSA Tables
9000 Data Manager Event This event measures the time in the data manager if
the data manager is called from the OLAP. You can
find more detailed data in the data manager statistics
(table RSDDSTAT_DM). The times measured there do
not normally cumulate to the data manager time.
9011 Total Number of Read This event measures the number of read records,
Records (DBSEL) aggregated from all the read accesses (counter
event).
http://help.sap.com/saphelp_nw70/helpdata/en/45/f0488a1aa03115
e10000000a1553f7/content.htm
o Check that all FROM clause tables are accounted for in join graph
–Thus each table has at least one join predicate
D5
F
D5
F
AND "D3"."SID_Z_PRODCD" = "X1"."SID"
D3 X1
DP
D5
Z1 X2 D1 F
D3 X1
D6
F
Z1 X2 D1
AND "X2"."OBJVERS" = 'A'
D3 X1
DP
D5
Z1 X2 D1 F
So where
should my
access path
D3 X
start? D6 1
o Break apart the original query and count the number of rows
retrieved
Z1 X2
SELECT COUNT(*)
FROM "/BIC/DZIC_SFC1" "D1" ,"/BIC/XZ_SHIPTO" "X2" ,"/BI0/0600000005" "Z1"
WHERE "D1"."SID_Z_SHIPTO" = "X2"."SID"
AND "X2"."S__Z_BTGRPNO" = "Z1"."SID"
AND "X2"."OBJVERS" = 'A' Z1 X2 D1
AND "Z1"."SID" <> 2000008999
SELECT COUNT(*)
FROM "/BIC/FZIC_SFC" "F" ,"/BIC/DZIC_SFC1" "D1" ,"/BIC/XZ_SHIPTO" "X2" ,"/BI0/0600000005" "Z1"
WHERE "F"."KEY_ZIC_SFC1" = "D1"."DIMID"
AND "D1"."SID_Z_SHIPTO" = "X2"."SID" F
AND "X2"."S__Z_BTGRPNO" = "Z1"."SID" Z1 X2 D1
AND "X2"."OBJVERS" = 'A'
AND "Z1"."SID" <> 2000008999
SELECT COUNT(*)
FROM "/BIC/DZIC_SFC5" "D5"
WHERE "D5"."SID_Z_DOCTYP" <> 2000008999
AND NOT "D5"."SID_Z_DOCTYP" = 6
D5
SELECT COUNT(*)
FROM "/BIC/FZIC_SFC" "F" ,"/BIC/DZIC_SFC5" "D5" D5
WHERE "F"."KEY_ZIC_SFC5" = "D5"."DIMID"
AND "D5"."SID_Z_DOCTYP" <> 2000008999
F
AND NOT "D5"."SID_Z_DOCTYP" = 6
SELECT COUNT(*)
FROM "/BIC/DZIC_SFCP" "DP"
WHERE "DP"."SID_0RECORDTP" = 0 DP
AND "DP"."SID_0REQUID" <=76419
DP
SELECT COUNT(*)
FROM "/BIC/FZIC_SFC" "F" ,"/BIC/DZIC_SFCP" "DP" F
WHERE "F"."KEY_ZIC_SFCP" = "DP"."DIMID"
AND "DP"."SID_0RECORDTP" = 0
AND "DP"."SID_0REQUID" <=76419
SELECT COUNT(*)
FROM "/BIC/XZ_PRODCD" "X1"
WHERE "X1"."S__Z_MAJCAT" IN (103, 119, 150, 98 ) X1
AND "X1"."S__Z_PROTIND" <> 2000008999
AND NOT "X1"."S__Z_PROTIND" = 1
AND "X1"."OBJVERS" = 'A'
SELECT COUNT(*)
FROM "/BIC/DZIC_SFC3" "D3" ,"/BIC/XZ_PRODCD" "X1"
WHERE "D3"."SID_Z_PRODCD" = "X1"."SID"
AND "X1"."S__Z_MAJCAT" IN (103, 119, 150, 98 )
AND "X1"."S__Z_PROTIND" <> 2000008999
AND NOT "X1"."S__Z_PROTIND" = 1 D3 X1
AND "X1"."OBJVERS" = 'A'
SELECT COUNT(*)
FROM "/BIC/FZIC_SFC" "F" ,"/BIC/DZIC_SFC3" "D3" ,"/BIC/XZ_PRODCD" "X1"
WHERE "F"."KEY_ZIC_SFC3" ="D3"."DIMID"
AND "D3"."SID_Z_PRODCD" = "X1"."SID"
AND "X1"."S__Z_MAJCAT" IN (103, 119, 150, 98 )
F
AND "X1"."S__Z_PROTIND" <> 2000008999
AND NOT "X1"."S__Z_PROTIND" = 1
AND "X1"."OBJVERS" = 'A'
D3 X1
© 2016 IBM Corporation
130
IBM z Systems for SAP
X1-D3
X1-D3-F
DP
281
511,179
432
30,932
10,743,216
432
0.26%
4.76%
100%
} #1
100% 100%
DP
15.84%
D5
Z1 X2 D1 F 4.76%
D3 X
D6 1
So where should my
12.26% access path start?
Offline Analysis
Performance
Pre-Calculation
OLAP Cache
InfoCubes
© SAP 2013 / Page 134
DB2 Accelerator
o DB2 component based on Netezza technology
o Appliance solution, including servers, discs, software and hardware
o Data is replicated to the DB2 Accelerator to accelerate SQL queries by factors
o Application tables
Questions?