Sei sulla pagina 1di 37

R/3 Workload Analysis

Deming Cha
SAP Technology Inc.

SAP America, Inc. prf3.ppt December, 1996

Workload Analysis
R/3 Architecture Review
Dialog and update processing

R/3 Performance Monitoring Tools


The roadmap to approach performance problems

Expensive SQL statements


As a diagnosis example

Memory Management for R/3 3.x


Small vs. big configurations

ABAP/4 trace tools

SAP America, Inc. prf3.ppt December, 1996

Page 1

Workload Analysis

R/3 Architecture Review

SAP America, Inc. prf3.ppt December, 1996

R/3 System Review - Dialog Processing


1

Network
Wait Queue (Memory)

TCP/IP sockets

Presentation Layer

2 3 4

Dispatcher
13

14

Application Layer

Roll buffer Page buffer Page file Roll file Network

Work Process
Roll mem Page mem

...
DB Interface

5 12 11

SAP Shared Pool Buffers

6 10

Database process Database Buffers


9 7 8

Database Layer

SAP America, Inc. prf3.ppt December, 1996

Page 2

R/3 System Review - Update Processing


Order form Order form

Presentation Layer

Sold to

Mr. Jack Knife

Sold to

Mr. Jack Knife

Check availability

Confirm sale

Check availability

Confirm sale

Item #
00086

Desc.
BandAids

Quantity
10

Item #
00086

Desc.
BandAids

Quantity
10

Network
6 Send DB COMMIT Dialog work is finished 5
Dialog Process
Order Entry ABAP Code

Dispatcher
Enqueue Process
Lock Material #00086

7
Update Process
Update Code

Application Layer
Send DB COMMIT Update work is finished 10 9

11

Network
Database
vblog vbak,vbap,vbuk,vbup,vbpa,vbep,vbkd,vakpa,vepvg,koclu
SAP America, Inc. prf3.ppt December, 1996

The R/3 Performance Timing Statistics


CPU Time

Roll in DB Time Network

Roll out

Load Time

Process Time

Wait Time

Dispatch Time Response Time

Database Server

Application Server

Presentation Server

SAP America, Inc. prf3.ppt December, 1996

Page 3

Workload Analysis

R/3 Performance Monitoring Tools

SAP America, Inc. prf3.ppt December, 1996

Main Monitors for Analysis

Workload Monitors

Database Monitor
st04

SAP Buffers Monitor


st02

Process and OS Monitors


sm50, st06

Transaction Monitor
st03

SAP America, Inc. prf3.ppt December, 1996

Page 4

The Workload Monitor (st03)


Performance: Workload AnalysisWorkload for Server hs1036
Other period ... Top time Time profile Transaction profile Memory profile Accounting profile

SAP application server


SAP-System Server Date 4795 E11 hs1036 27.07.1994

Workload Summary of an Instance


First record Last record Elapsed time 07:33:35 14:20:30 06:41:55

Response times for all task types


CPU time Elapsed time Dialog steps Av. Response time Av. CPU time Av. Wait time Av. Load time Av. DB requests Av. bytes request Roll-ins Roll-outs 731,2 24115,0 s s Data base calls Database requests Dir. reads Seq. reads Changes Time per DB requests Dir. reads Seq. reads Changes Av. time / Roll-in Av. time / Roll-outs 33.422 87.255 22.198 64.313 744 20,3 6,9 21,2 334,8 ms ms ms ms

4.950 885,1 ms 147,7 ms 5,3 ms 6,4 ms 357,0 ms 35,6 kB 6.284 4.784

3,1 ms 10,0 ms

Task types
Current Total Other Dialog Background

SAP America, Inc. prf3.ppt December, 1996

The Workload Monitor (st03)


Workload: Transaction Profile Report
Monitoring
Choose >> Sort

System
Text

Help

Transaction Profile Information


DB time total(s) avg(ms)

Program or Dialog Time Steps

Response time CPU time Wait time total(s) avg(ms) total(s) avg(ms) total(s) avg (ms)

*TOTAL* VA01 MainMenu SE37 VTAA VA41 ME21 CU04 VA02 VOV4 System VOV7

488 234 80 39 36 33 20 13 5 4 4 4

520 266 10 55 45 56 59 10 4 4 1 1

1.065 1.138 124 1.418 1.237 1.705 2.938 765 876 898 303 341

261 145 7 15 28 38 14 2 2 2 1 1

534 620 91 395 765 1.144 703 169 358 483 248 188

4 1 0 0 0 0 1 0 0 0 0 0

8 6 5 6 5 5 71 5 5 5 4 5

258 121 2 40 16 19 45 8 3 2 0 1

530 518 26 1.037 450 562 2.242 627 530 413 11 158

SAP America, Inc. prf3.ppt December, 1996

Page 5

The Workload Monitor (st03)


Workload: Top 40 with Respect to Time Consumption
System 47 K11 Server hs1036 Analyzed day We 27.07.1994 until 14:20 Sorted by Time of day

Top 40 dialog steps by response time ( out of 4950 ) End time Tcode Program 11:07:03 12:54:24 09:11:10 13:43:58 13:51:01 11:29:50 13:49:47 11:14:30 14:12:46 13:53:03 11:22:44 12:55:17 11:36:12 13:40:08 12:48:43 13:53:02 11:12:56 DI03 C001 C0R2 AM02 SQ01 0PJK SE01 C0R2 ST03 AM02 C0R2 C001 ST03 C0R2 C002 SQ01 C0R2 T D D D D D D D D D D D D D D D D D Scr. 0120 0010 5101 0120 1000 0120 0120 0300 0010 0100 0120 0100 0010 0900 0100 0120 5101 Wp User 0 0 2 1 2 0 0 2 0 1 0 0 0 0 0 2 2 -?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-

Top Time Profile


Response Dispatch Wait CPU DB req. Load/Gen time (ms) time (ms) time (ms) time (ms) time (ms) time (ms) 165.401 97.317 95.718 86.984 86.520 67.728 63.650 58.828 55.822 53.393 52.924 45.741 44.824 41.059 39.715 39.380 37.420 165.400 97.316 95.717 86.983 86.519 67.725 63.646 58.467 55.821 53.392 52.923 45.740 44.823 41.058 39.713 39.379 37.427 1 1 1 1 1 3 4 361 1 1 1 1 1 1 2 1 1 610 18.730 6.930 1.440 1.600 6.170 90 10.820 1.040 3.180 1.780 2.030 1.120 15.650 3.470 2.300 8.050 163.016 20.763 10.840 86.437 5.677 5.546 63.404 9.015 51.521 786 49.673 10.171 41.748 275 26.739 4.089 3.213 1.269 33.836 73.388 77 21.558 38.613 21 19.274 3.230 52.190 1.057 19.539 1.821 40.278 6.184 1 18.985

RDN03S01 SAPLC0K0 SAPLC0K0 SAPMA01M !Q0100BA SAPMSVMA RDDIT070 SAPLC0K0 SAPMSS03 SAPMA01M SAPLC0K0 SAPLC0K0 SAPMSS03 SAPLC0K0 SAPLC0K0 !Q0I00BA SAPLC0K0

SAP America, Inc. prf3.ppt December, 1996

Process Overview Monitor (sm50)


Table Statistics Workload: Tables for Application Server hs1036
.Ty. PID DIA 191 DIA 221 DIA 210 DIA 205 DIA 150 DIA 178 DIA 203 Status Running Waiting Waiting Waiting Waiting Waiting Waiting ReasonStart Yes Yes Yes Yes Yes Yes Yes Err Sem CPU Time Program Cl. User RSMON000 002 GOETHALS Action Tabl

WP WP WP Application Instance

Maria: Close these boxes off with a line

Resources

Operating System
SAP America, Inc. prf3.ppt December, 1996

Page 6

The OS Monitor (st06)


OS Monitor HP-UX
Refresh display Detail analysis menu Collector info

CPU Utilization user % system % idle % System calls/sec Interrupts/sec Memory Physical mem avail kb Pages in/sec Pages out/sec Swap Primary-swap Size swap-space kb kb

41 42 17 3.890 1.562

Count Load average

1 min 5 min 15 min Context switches/sec

1 1,78 1,40 1,31 2.927 700 0 0 3.063.532

524.288 Physical mem free kb 0 Kb paged i/sec 0 Kb paged out/sec 2.052.096 Free swap-space 3.064.904 kb

Disk with highest response time c28d0s0 Response time Name 6 Queue Utilization 0 Avg service time Avg wait time ms 35 Kb transferred/sec
SAP America, Inc. prf3.ppt December, 1996

ms ms

680 0 680
OVR 04:50PM

K11(0) hs0013

The Database Monitor (st04)


Data Base Performance Analysis: Oracle Data Base Overview
Refresh display Detail analysis menu

Database K11 Day, Time 28.09.1994 D0:07:05 Database summary DB Server hs0013 Since start up 20.09.1994 D6:33:56 Data buffer Size Quality kb 240.000 % 97 Reads 1.654.230.588 Physical reads 44.627.488 writes 6.080.448 Busy waits 374992 Busy wait time ms 141424070 Log buffer Size kb Entries Allocation retries Alloc fault rate % Recursive calls Parses
K11(0) hs0013

Shared Pool Size kb DD-Cache quality % SQL Area getratio % SQL Area pinratio % Calls User calls commits rollbacks
SAP America, Inc. prf3.ppt December, 1996

162.024 95 98 100 60.589.413 586.102 4.153

20.480 42.457.752 2.771 0 23.091.509 2.375.072


OVR 04:47PM

Page 7

The Database Monitor (st04)


Exclusive Waits in the ORACLE Data Base

04.08.1994

16:01:56

Exclusive session-lock situations (no shadow process)

Lock-Holder (Host, Pid) Lock-Waiters (Host, Pid) hs5101 hs5101 16032 16033

Object-Name

T100

...

Host with Lock,PID

Resource Waiting

SAP America, Inc. prf3.ppt December, 1996

Database analysis Cho. 02.05.1996


Total Execution 6.746.205 4.971.100 3.413.492 3.002.588

Edit

Data Base Performance: Shared SQL Goto Monitor System Help


?

Reset 16:59:00

Since Reset

s.DBst.

Select table

Sort

More Information

Shared Cursor Cache


Users Open 5 209 230 226 Disk Reads 186.702 874.636 1278.997 562.411

( last reset at 02.05.1996 09:23:30 )


Reads/ Buffer Execution Gets 0,0 26.500.852 0,2 19.939.081 0,4 13.670.450 0,2 8.978.357 Parse Calls 232 6.992 20.096 17.036

Current Execut. 0 0 229 0

Double click on statement Data Base Performance: Shared SQL Double click on statment Database analysis Edit Goto Monitor System Help
? Choose
Total 02.05.1996 Total Execution Execution 4.971.100 3.413.492 3.002.588

Explain
Current 16:59:00

DIC Info

More Inform.

Users Disk Reads/ Buffer Parse Shared Cursor Cache ( last reset at 02.05.1996 09:23:30 ) Current Disk Reads/ Buffer Parse Execute. Users Open Reads Execution Gets Calls Execut. Open Reads Execution Gets Calls 0 209 874.636 0,2 19.939.081 6.992 229 230 1278.997 0,4 13.670.450 20.096 0 226 562.411 0,2 8.978.357 17.036

SELECT TABNAME, BLOCKNR, FIELDSLG, FIELDS FROM "DDNTF" WHERE TABNAME = :A0000 ORDER BY TABNAME, BLOCKNR #

BIN(1)
SAP America, Inc. prf3.ppt December, 1996

hs0011

OVR

11:38AM

Page 8

The Setup/Buffers Monitor (st02)


Storage Usage and Requirements
System : ds0201_Q30_86 17:55:29 Tune summary Startup: 28.02.1996 12:59:10 Free space [%] Dir.size Entries Free directory Entries [%] Swaps a D Date & time of snapshot : 28.02.1996 Buffer Hitratio [%] Nametab (NTAB) Table definition Field description Short NTAB Initial records Program CUA Screen Calendar Tables Generic key Single record Roll & Page

Allocated [kB] [%]

94,37 90,38 96,23 89,60 89,55 89,15 94,17 99,32 98,05 76,47 Current use [%] [kB]

1.164 5.621 1.612 2.112 131.097 5.000 2.441 488 15.625 10.000 Max.use [kB] 36.304 672 31.744

154 325 612 51 25.052 4.392 1.867 414 3.662 9.132 [%]

16.45 6.50 61.20 3.40 19.27 90.35 82.39 85.89 24,32 91,69 [kB]

12.288 24.577 24.577 24.577 16.250 2.500 5.000 200 6.000 500

11.952 24.577 24.577 24.577 14.896 736 4.370 144 4.401 375

11.952 24.237 24.405 24.308 13.74 29,44 87,48 72,00 73,35 15,00 Hitratio [%]

0 8.882 0 0 10.062 1.910 2.321 0 0 0 Fr Entries 0 0

In Memory

On disk

SAP cursor cache

Roll area Paging area Extended Memory

14,34 18.792 0,43 560 100,00 31.744

32.000 8.000 31.744

99.072 123.072

IDs Statements

97,40 78,00

SAP America, Inc. prf3.ppt December, 1996

Table statistics workload: Tables for application server hs0011 Table statistics Edit Goto Environment Monitor System Help ? Sort Analyze table Since startup Reset Previous day Next day Overview <-> Detail

Table access summary sorted by

DB requests ABAP/4 PROCESSORS REQUESTS

Table *Total* NTAB DDNTF NTAB DDNTT ATAB TCP01 SNAPT MONI ATAB TCP02 TRPUT ATAB TFO04 VBHDR ATAB TCP07 ATAB TSE02

Type

Buffer

Total 468.861

Seq. 166.026 922 0 39.630 20.913 7.110 8.509 8.018 6.902 5.952 5.948 5.774 BIN(1)

Dir. 295.538 198.436 59.436 0 0 0 0 0 0 23 0 0 hs0011

Changes 7.297 1 3 0 34 1.821 0 0 0 154 0 0 11:38AM

System System Pool Table Table Pool Table Pool Table Pool Pool full

199.368 59.439 39.630 20.947 8.931 8.509 8.018 6.902 6.129 5.948 5.774

OVR

SAP America, Inc. prf3.ppt December, 1996

Page 9

SQL Trace (st05)


SAP work process

ABAP Job
DB interface Local buffers

Local Trace file SQL

DB
SAP America, Inc. prf3.ppt December, 1996

ABAP Trace - Runtime Analysis (se30)

PROGRAM XYZ000. DATA: A DATA: RESULT(20) A = 123. PERFORM CALL USING A. WRITE: / RESULT. FORM CALL. ... ENDFORM. TYPE P. TYPE C.

Time Duration Stamp ... ... ... ...

Statement Type ... ... ...

Runtime Summary

... ...

Trace file

SAP America, Inc. prf3.ppt December, 1996

Page 10

Analyze the problem


(Average) Performance problem ? Yes All Users Affected ? No Which is bad ? CPU time

Check Workload on all Servers

CPU time << Process time (Continued) Wait time

ABAP or SQL Trace

Load time DB request time

SAP America, Inc. prf3.ppt December, 1996

Analyze the problem (Continued)


(Average) CPU time

Amount of time occupying the work process

CPU time << Process time

I/O Bottleneck Network problems, CPU bottlenecks

Wait time

Configuration problem - Not enough work processes Long running transactions - All work processes busy Configuration problem - R/3 Buffers too Small Installation problem - Missing indices DB Server CPU has heavy workload More memory in DB server needed Too many disk sorts - Missing Indices Too many extents exist on a table

Load time DB request time

SAP America, Inc. prf3.ppt December, 1996

Page 11

Performance Problem Roadmap (1)


If Top Time MAIN_MENU stat shows response times reasonable SQL Trace on TOP TIME Transactions ABAP Trace on TOP TIME Transactions
Specific Problem

Inspect overall Workload statistics for problem areas


General Problem

Check if R/3 buffers need adjustments Are DB buffer qualities< 97% Check missing indexes Use individual transaction workload stats, identifying intensive transactions.

Check if objects can be buffered Allocate more data Buffers

If Av DB time > 40% Response Time

Consider tuning DB in order of highest gains: App. SQL Tuning 70% Memory 15% Disk I/O 10% Memory Contention 5% Build new index(s) when necessary Split instance into 2 smaller instances, separating roll mechanisms

Use SQL trace on transaction

If Av Roll > 2x Rated disk access time

Increase in memory roll area

Offload roll file to faster or more dedicated disk

SAP America, Inc. prf3.ppt December, 1996

Performance Problem Roadmap (2)


If Av Wait Time > 1% Response Time Problem Occurring Now Use CPU button of Process Monitor Identify long running Jobs Problem occurred in Past Use Top Times/Tcode WL Monitors, Reference problematic transactions Tune long running Jobs Increase number of needed Workprocesses If Semaphore 6 is continually present, investigate resource conflict situation

If Av CPU Time > 40% Response Time

Use ABAP Trace on time consuming transactions Check R/3 buffers and indexes Analyze disk/network thruputs using OS monitor and/or Network Monitor If Page-Outs exist analyze Extended Memory allocations first If the Extended Memory Allocations: CURRENT USE=IN MEMORY

Analyze efficiency of coding logic and reprogram

If Av Load Time > 10% Response Time

If Av Process Time << Av Response Time

Consider buying more memory or reduce allocations on the OS Jump to Extended Memory Solution Roadmap Faster CPU needed or introduce additional R/3 app server

If Load stats > 3 Check for processes using CPU and remove SAP America, Inc. prf3.ppt December, 1996

If load persists tune all CPU intensive R/3 apps

Page 12

Extended Memory Solution Roadmap


Preliminaries Let W = number of workprocesses X = size of additional available memory Y = min(ztty/roll_area * 10% , X/W)

Jump to Extended Memory Solution Roadmap

No Allocate All available memory X to em/initial_size More than 10% of users use heap memory

Yes Allocate an additional Y MB to ztty/roll_area and the remainder of X-(Y*W) to em/initial_size

Recheck heap statistics and reallocate memory from ztty/roll_area to em/initial_size to conform to the 10% rule if necessary

SAP America, Inc. prf3.ppt December, 1996

Workload Analysis

Expensive Select Statement

SAP America, Inc. prf3.ppt December, 1996

Page 13

Goals
What is an expensive SELECT statement? Which consequences has an expensive SELECT statement? How to detect an expensive SELECT statement?
Using the Statistical Records Using the SQL Trace Using the Shared Cursor Cache Using the Process Overview Using the Where used list

How to tune an expensive SELECT statement?


Creating an Index Understanding the DB optimizer Rewriting inefficient coding

SAP America, Inc. prf3.ppt December, 1996

What is an expensive SELECT Statement?


Long response time Many data blocks are scanned to find the selected records Long DB request time caused by too many buffer gets

SAP America, Inc. prf3.ppt December, 1996

Page 14

Buffer gets
Application Server A
ABAP/4 Program

SELECT * FROM T001 WHERE ...

R/3 Database Interface records

Table Buffer

DBMS

DBMS Processes

Database Buffer buffer gets

Database
SAP America, Inc. prf3.ppt December, 1996

Which consequences has an inefficient SELECT statement?


Database is busy reading many data blocks High CPU load on database server Workprocess is blocked by report
high wait times for other processes

Many blocks are displaced from database buffer


Cache hit rate for other SQL statements suffers

System wide performance can be harmed by expensive statements

SAP America, Inc. prf3.ppt December, 1996

Page 15

How to detect an expensive SELECT statement?


Find out
reports/transactions where the database request time is a large fraction of response time SELECT (SQL) statements with a high number of buffer gets

For these SELECT statements find out


the name of the table the where clause The indices that are used

Sometimes you have to look at the coding. In this case you need:
The name of the report or transaction containing the expensive statement
SAP America, Inc. prf3.ppt December, 1996

Which of the information is provided by the different screens?


Statistical Records
ST03

SQL Trace

Oracle Process Shared Cursor Overview Cache


ST04Detail analysis Menu SQL Request table name index used SM50

Where used list


SE12:Utilities Where used list report / transaction name table name required sometimes a table is used in many different places

ST05

report / transaction

table name index used

table name report / transaction name Critical transaction must run at the same time

report / transaction name or user name required

Oracle specific

SAP America, Inc. prf3.ppt December, 1996

Page 16

Statistical Records: Sample Screen


?

Program or Tcode

Response time CPU time avg (ms) avg (ms)

Wait time avg (ms)

DB time Requested avg (ms) kBytes

VF01 VF01 VF01

52.345 57.278 54.987

2.987 2.988 2.956

1 2 1

49.345 48.536 47.359

1.523 1.523 1.523

SAP America, Inc. prf3.ppt December, 1996

Statistical Records: How to interpret


Performance problem ? Load time

Wait time
All Users Affected ?

Yes

R/3 on all Servers CPU time << Process time

A set of expensive statement can block wps and exploit resources

Depending on the times of executions all users could be affected. Involved reports have a high DB request time.

DB request Expensive SQL Statements time many buffer gets

SAP America, Inc. prf3.ppt December, 1996

Page 17

SQL Trace: How it works


Application Server A
ABAP/4 Program

SELECT * FROM T001 WHERE ...

R/3 Database Interface SQL trace SQL records

Table Buffer

DBMS

DBMS Processes

Database Buffer

Database
SAP America, Inc. prf3.ppt December, 1996

SQL Trace: Sample Screen


? Detail DDIC info Explain SQL
PID= 0000017643 Client= 900 User= WRKL0 T Table Database-Request REOPEN 149 SELECT WHERE "MANDT" = 900 AND "POSNR" = 0010 FETCH 149 Records: 1 Returncode: +0

Transaction/Report= VA01 hh:mm:ss.ms Duration 16:35:52.511

104 D ZXYZ D ZXYZ

16:35:52.512 2.626.051

SAP America, Inc. prf3.ppt December, 1996

Page 18

Oracle Shared Cursor Cache: Sample Screen


? Sort Reset Since Reset Since DB Start
Shared Cursor Cache

detail stats .
(last reset at 25.03.1996 15:17:55 )

25.03.1996 16:54:36

Total Execution

... Disk Reads

Reads/ Execution

Buffer Gets

Gets/ Execution

... SQL Text

Statements generated from ABAP/4 have double quotes

57 27 2 149 22

554 0 425 317 13

9,7 0,0 212,5 2,1 0,6

5.200.089 2.200.022 57.901 47.691 29.286

91.229,6 81.482,3 28.950,5 320,1 1.331,2

SELECT "MANDT" , "VBELN" , "POSNR" SELECT "MANDT" , "VBELN" , "POSNR" SELECT TABNAME, TABFORM, REFNAME FR SELECT "TABNAME" , "VARKEY" , "DAT SELECT "TABNAME" , "VARKEY" , "DAT

SAP America, Inc. prf3.ppt December, 1996

Process Overview: Sample Screen


? CPU No. 0 1 2 3 4 5 6 7 8 9 10 11 12 Ty. DIA DIA DIA DIA DIA DIA UPD UPD ENQ BTC BTC SPO UP2 Refresh PID 17639 17640 17641 17642 17643 17659 17665 17670 17671 17675 17678 17679 17683 Status running running running waiting running waiting waiting waiting waiting waiting waiting waiting waiting ReasonStart Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Time Program 38 ZZXXYY00 35 ZZXXYY01 32 ZZXXYY01 Cl. 900 900 900 User SAP_PERF SAP_PERF SAP_PERF Action Sequential read Sequential read Sequential read Table ZXYZ ZXYZ ZXYZ

RSMON00 900 WRKL0

SAP America, Inc. prf3.ppt December, 1996

Page 19

Where Used List: Sample Screen


?

Program ZFILLIPS

Found locations/short description Fills table ZXYZ with dummy data ZZXXYY00 33 24 tables: zxyz. include structure zxyz. and lgort = int_lips-lgort and matnr in sl_matnr. ZZXXYY01

26 ranges: sl_matnr for zxyz-matnr. 49 select * from zxyz where werks = int_lips-werks

SAP America, Inc. prf3.ppt December, 1996

How to tune an expensive SELECT statement?


Expensive statement
DDIC Info Inefficient coding? No Yes

SQL Explain good optimizer decision?

Where used list

a suitable index exists? No

Yes

Yes

Check application re-code

No No "Missing Index"? Yes

create secondary index in DDIC further rules!


SAP America, Inc. prf3.ppt December, 1996

create index on DB

re-code or change index

Page 20

Summary
An 'Expensive SQL statement' needs many buffer gets It can cause system wide performance problem Analyzing an expensive SQL statement
Statistical Records: high database request time SQL Trace: statements with long response time Cursor Cache: high number of buffer gets Process Overview: report & table name, no CPU usage while DB access Where used list: table report

Tuning an expensive SQL statement


Creating an index Understanding the DB optimizer Rewriting expensive coding

SAP America, Inc. prf3.ppt December, 1996

Workload Analysis

Memory Management for R/3 3.x

SAP America, Inc. prf3.ppt December, 1996

Page 21

R/3 old memory management concept (version 2.x)


Work Process Roll Area Paging Area

Access Privileges Entry Data ABAP/4 and Dynpro Management Information Program variables and stacks OCCURS
SAP America, Inc. prf3.ppt December, 1996

R/3 old memory management concept (version 2.x)


Work Process Roll Area Paging Area

Extensive Collection of data e.g., report lists


Paging Space

SAP America, Inc. prf3.ppt December, 1996

Page 22

R/3 old memory management concept (version 2.x)


Work Process 1 Roll Area Paging Area

Shared Memory Paging Buffer Roll Buffer

Page File

Roll File
Paging Area
SAP America, Inc. prf3.ppt December, 1996

Roll Area

Work Process 2

Small configuration

R/3 User

R/3 User

R/3 User

R/3 User

Work Process

Roll Area Page Area

Work Process

Roll Area Page Area

Page File
SAP America, Inc. prf3.ppt December, 1996

Roll File

Page 23

Small configuration
Process Program Overview of Processes User session Edit Goto System
? CPU Refresh Delete session Debugging Detail info

Help

No.Ty. 0 1 2 3 4 5 6 7 8 9 10 11 DIA DIA DIA DIA DIA DIA UPD UPD ENQ BTC SPO UP2

PID 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442

Status running running running running running running waiting waiting waiting waiting waiting waiting

Start Err Sem CPU Time Program Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes 1 6 1 1 2 2 SAPDF05X RSMON000 SAPLKAIP SAPMF05A SAPMF05L SAPMF05A

Cl. 900 001 900 900 900 900

User SAP_PERF SAP* SAP_PERF SAP_PERF SAP_PERF SAP_PERF

Action

SAP America, Inc. prf3.ppt December, 1996

Small configuration
Workload Edit
Choose >>

Workload: Transaction Profile Report Goto Environment Monitor System Help


? Aggregation... Text

Graphics Sort

Program or Tcode *TOTAL* FB01 FBZ1 FB03 FBL5 SM50 : :

Dialog steps 914 386 244 119 118 21 : :

Response time total(s) avg(ms) 830 492 142 56 118 7 : : 908 1.274 581 468 1.003 334 : :

CPU time total(s) avg(ms) 136 67 32 11 22 1 : : 149 174 130 94 187 62 : :

SAP America, Inc. prf3.ppt December, 1996

Page 24

Small configuration
Workload Edit
>> Previous detail

Workload: Task Type Profile Report Goto Environment Monitor System Help
? Next detail Download CPU time total (s) avg (ms) 0 136 0 2 149 34

Task type BUF.SYN DIALOG SPOOL

Dialog steps 8 914 10

Response time total (s) avg (ms) 2 830 0 209 908 49

Summary for tasktype DIALOG Used work processes Dialog steps with DB calls waiting > 50 ms with roll in Avg elapsed time Avg not in workp. Avg response time CPU time wait time load time DB request time Roll time in out
SAP America, Inc. prf3.ppt December, 1996

4 914 499 229 908 2.380,8 1.472,4 908,4 149,2 192,6 95,3 46,1 115,3 225,9 ms ms ms ms ms ms ms s s

First record time Last record time Elapsed time Response time CPU time wait time oad time DB request time Roll in out

10:53:36 11:02:40 544,0 830,3 136,3 176,0 87,1 42,1 978 976 s s s s s s

New Memory Management Concept (version 3.x)


Dialog Work Process 1
Roll Seg Process Memory (exclusive per wp) Roll Seg Local Seg

Shared Seg

Shared Shared Seg Seg

Shared Seg

Extended Memory (sharable by all wp's Roll Seg Local Seg

Roll Seg

Process Memory (exclusive per wp)

DialogWork Process 2

SAP America, Inc. prf3.ppt December, 1996

Page 25

New Memory Management Concept (version 3.x)


Using traditional Rel 2.2 Paging
Roll Seg Process Memory (exclusive per wp) Paging Area

Extended Memory (sharable by all wp's

Shared Seg

Shared Seg

will stay small because neither Lists nor Internal Tables are contained

Paging space

Parameter abap/use_paging = 1

Internal Tables Lists, etc.

SAP America, Inc. prf3.ppt December, 1996

Large configuration

R/3 User
Roll Area Page Area

R/3 User

R/3 User
Roll Area Page Area

R/3 User

Work Process

Work Process

Roll File

Extended Memory

Page File

Local Area

Local Area

SAP America, Inc. prf3.ppt December, 1996

Page 26

Large configuration
Process Program Overview of Processes User session Edit Goto System Help
? CPU Refresh Delete session Debugging Detail info

No.Ty. 0 1 2 3 4 5 6 7 8 9 10 11 DIA DIA DIA DIA DIA DIA UPD UPD ENQ BTC SPO UP2

PID 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442

Status running running running running running waiting running waiting waiting waiting waiting waiting

Start Err Sem CPU Time Program Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes 1 1 2 1 1 SAPDF05X RSMON000 SAPLAINT SAPLGLIN SAPDF05X RSM13000

Cl. 900 001 900 900 900 900

User SAP_PERF SAP* SAP_PERF SAP_PERF SAP_PERF SAP_PERF

Action

SAP America, Inc. prf3.ppt December, 1996

Large configuration
Workload Edit
Choose >>

Workload: Transaction Profile Report Goto Environment Monitor System Help


? Aggregation... Text

Graphics Sort

Program or Tcode *TOTAL* FB01 FBZ1 FBL5 FB03 SM50 : :

Dialog steps 677 307 169 84 83 12 : :

Response time total(s) avg(ms) 423 492 90 56 19 4 : : 625 789 535 665 227 296 : :

CPU time total(s) avg(ms) 96 52 20 14 7 1 : : 141 168 120 161 82 45 : :

SAP America, Inc. prf3.ppt December, 1996

Page 27

Large configuration
Workload Edit
>> Previous detail

Workload: Task Type Profile Report Goto Environment Monitor System Help
? Next detail Download CPU time total (s) avg (ms) 0 96 0 0 141 34

Task type BUF.SYN DIALOG SPOOL

Dialog steps 5 677 10

Response time total (s) avg (ms) 0 423 0 5 625 49

Summary for tasktype DIALOG Used work processes Dialog steps with DB calls waiting > 50 ms with roll in Avg elapsed time Avg not in workp. Avg response time CPU time wait time load time DB request time Roll time in out
SAP America, Inc. prf3.ppt December, 1996

4 677 372 58 674 2.233,8 1.608,4 625,4 141,2 46,7 78,3 56,8 37,6 41,1 ms ms ms ms ms ms ms s s

First record time Last record time Elapsed time Response time CPU time wait time oad time DB request time Roll in out

11:10:44 11:19:08 504,0 423,4 95,6 31,6 53,0 38,4 720 719 s s s s s s

Monitoring of the New Memory Management System


CCMS: Control Panel: Operation Mode/Server Status
Edit Select Monitoring Control Utilities System Help
Choose Refresh Choose OP mode Alert-Details Previous View Next View

Active op mode: DAY-OPERATION Memory management absolute value Sorted by Servername, active/inactive

Server-Name

Extended Memory (MB) Process-local Memory Amount of Total Peak Current in Current Peak restarted WP's used used process used used DIALOGnon DIA 319 63 319 169 63 179 60 13 98 7 10 13 0 KB 0 KB 4873 KB 0 KB 62 MB 30 MB 0 1 0 0 0 0

hs0301_P30_20 hs0313_P30_20 hs0315_P30_20

P30(1) hs0313 OVR 04:45PM SAP America, Inc. prf3.ppt December, 1996

Page 28

Memory management >= 3.0C


ztta/roll_first ztta/roll_extension ztta/roll_area ztta/roll_first abap/heap_area_dia

DIA

Roll

EM

EM

Roll

Heap
abap/heaplimit

em/initial_size_MB

Extended Memory

ztta/roll_area

abap/heap_area_nondia

BTC UPD

Roll
abap/heaplimit

Heap

EM
ztta/roll_extension

SAP America, Inc. prf3.ppt December, 1996

Configuration Strategy
What can be done to save main memory ? decrease size of roll- and paging buffers rdisp/ROLL_SHM smaller up to 0 rdisp/PG_SHM smaller up to 0 store more data in roll area ztta/roll_first bigger up to (ztta/roll_area - 1MB) in extreme main memory shortage, use traditional paging abap/use_paging = 1

SAP America, Inc. prf3.ppt December, 1996

Page 29

Configuration Strategy
High performance configuration with big main memory and swap space reduce data in roll area ztta/roll_first smaller up to 1 (1 byte !!) provide more extended memory em/initial_size_MB bigger, about 7MB/user full buffering of roll- and paging file rdisp/ROLL_SHM bigger, about 2MB/user rdisp/PG_SHM bigger, about 1MB/user

SAP America, Inc. prf3.ppt December, 1996

Configuration Strategy
What can be done to save swap space ? more efficient use of roll area ztta/roll_first bigger, ztta/roll_area - 100KB return process local space abap/heaplimit smaller, up to 1 MB no buffering of roll- and paging file rdisp/ROLL_SHM 0 rdisp/PG_SHM 0 reduce extended memory em/initial_size_MB smaller, see utilization in ST02 or RZ03

SAP America, Inc. prf3.ppt December, 1996

Page 30

Configuration Strategy
What to do with huge data sizes in background jobs ? increase size of process local space abap/heap_area_nondia bigger, up to OS-limitations abap/heap_area_total bigger, enough swap space must available increase size of quota for extended memory ztta/roll_extension bigger There are platform dependent OS limitations on the size of a processes' address space and on the size of the process local data segment. Limitations on process data segment AIX: 256 MB SINIX: 384 MB HP-UX: about 640 MB SUN, NT: nearly 2000MB - (shared + extended) OSF1: > 4000 MB (64 Bit Architecture) In extreme situations, configure a dedicated background server with traditional paging abap/use_paging = 1
SAP America, Inc. prf3.ppt December, 1996

Workload Analysis

ABAP/4 Trace Tool - Runtime Analysis

SAP America, Inc. prf3.ppt December, 1996

Page 31

Runtime Analysis: Initial Screen SAP ABAP/4ABAP/4 Trace (ATRA) Tool Runtime analysis Edit Goto Utilities System Help ?
Tips & Tricks

Transaction Program

ZFPATRA6

Execute

Options
With subroutines

Restriction to

Function module With internal tables All With technical DB info

Runtime analysis ZFPATRA6 test program: before tuning. 17.04.96 16:10:23 File size : 255 kB

Other trace files ...

Analyze

Delete

TCC(1)
SAP America, Inc. prf3.ppt December, 1996

hsext01

OVR

11:38AM

Runtime Analysis Evaluation: Overview Runtime analysis Edit Goto Utilities System Help ? Hit list Tables Group hit list Hierarchy

Program User

ZFPATRA6 = ATRA test program: before tuning. MDLR Execution time in microseconds: ABAP/4 Database R/3 SYSTEM 0% 50% 100%

Time Date

16:10:23 17.04.96

311.683 = 52,6% 264.986 = 44,7% 15.648 = 2,6% 592.317 = 100,0%

Maximum memory requirement in kB Statistics entry Conversions Convert from type P Convert to type P Type P arithmetic Loaded programs

579 Number 210 104 104 469 4

TCC(1)
SAP America, Inc. prf3.ppt December, 1996

hsext01

OVR

11:38AM

Page 32

Analysis Evaluation: Overview SAP ABAP/4Runtime Trace (ATRA) Tool Runtime analysis Edit Goto Utilities System HelpFilter Display ? Hit list Tables
Display
Program User Applicat. program ZFPATRA6 = ATRA test program: before tuning. Time 16:10:23 System program MDLR Date 17.04.96 Database interface (Open SQL) Database interface (Native SQL) Execution time in microseconds: Database and buffer operations Matchcode processing ABAP/4 Screen system processing steps 311.683 = 52,6% Database 264.986 = 44,7% Memory and program runtime management R/3 SYSTEM 15.648 = 2,6% 0% 50% 100% 592.317 = 100,0%

Group hit list

Hierarchy

Net times are recalculated accordingly


Maximum memory requirement in kB Statistics entry Conversions Convert from type P Convert to type P Type P arithmetic Loaded programs 579 Number 210 104 104 469 4

TCC(1)
SAP America, Inc. prf3.ppt December, 1996

hsext01

OVR

11:38AM

Analysis Evaluation: Hierarchy SAP ABAP/4Runtime Trace (ATRA) Tool Runtime analysis Edit Goto Utilities System Help ?
Choose Absolute <-> % Scre text

Mem.Req.(kB)
292 243 253 253 257 257 257 272

Gross
514.230

Net

Program Lv
0 1 1 2 1 2 1 1

Call hierarchy
Submit report ZFPATRA6 Perform(Ext) BEFORE_EVENT Open Cursor TABNA DB Operation OpenCursor Fetch TABNA DB Operation FetchCursor Collect ITABNA Fetch TABNA

192.385 SAPMS38T 70 ZFPATRA6

897

896 ZFPATRA6 1 ZFPATRA6

67.537

151 ZFPATRA6 67.386 ZFPATRA6 90 ZFPATRA6 58 ZFPATRA6

TCC(1)
SAP America, Inc. prf3.ppt December, 1996

hsext01

OVR

11:38AM

Page 33

Analysis Evaluation: HitTool List SAP ABAP/4 Runtime Trace (ATRA) Runtime analysis Edit Goto Utilities System Help ?
Choose Absolute <-> % Gross <-> Net Scre text

Call
Submit report ZFPATRA6 Fetch TABNA

In progr
SAPM38T ZFPATRA6

No.
1 635 6 634 1 369 1

Gross

Net

Type

Display filter group

514.230 192.385 220.694 27.562 193.132 118.870 3.378 3.282 897 896 DB OpenS DB DB OpenS DB

DB Operation FetchCursor ZFPATRA6 Collect ITABNA Sort TABNASHOW Collect TABNASHOW Open Cursor TABNA ZFPATRA6 ZFPATRA6 ZFPATRA6 ZFPATRA6

TCC(1)
SAP America, Inc. prf3.ppt December, 1996

hsext01

OVR 11:38AM

SAP ABAP/4 Trace Tool


Runtime Analysis Evaluation: Hit List Runtime analysis Edit Goto Utilities System Help ?
Choose Absolute <-> %

Table
TABNA Total

#Access
637 637

Gross
221.596 221.596

Class

Buffering

SQL tab.

Description

TRANSP

BC: Training table

TCC(1)

hsext01

OVR 11:38AM

SAP America, Inc. prf3.ppt December, 1996

Page 34

SAP ABAP/4 Trace (ATRA) Tool


Call of Table accesses TABNA

No

Call
428 Open Cursor TABNA 99 412 261 503 Fetch TABNA Fetch TABNA Fetch TABNA Fetch TABNA

Gross
897 227 160 67.537 30.486

Net
896 227 160 151 125

Program
ZFPATRA6 ZFPATRA6 ZFPATRA6 ZFPATRA6 ZFPATRA6

Include
30 30 30 30 30

Line

ZFPATRA6 ZFPATRA6 ZFPATRA6 ZFPATRA6 ZFPATRA6

TCC(1)

hsext01

OVR

11:38AM

SAP America, Inc. prf3.ppt December, 1996

Runtime Analysis (ATRA) Evaluation: Source Code SAP ABAP/4 Trace Tool Runtime analysis Edit Goto Utilities System Help ?
Editor Program ZFPATRA6 Call Open Cursor TABNA

..... 00029 00030 00031 00032 00033 00034 00035 ..... 00041 00042 00043 ..... 00046 00047 00048 00049 00050

REFRESH ITABNA SELECT * INTO ITABNA FROM TABNA ORDER BY SALES POSTCD. APPEND ITABNA SORTED BY COUNTRY. ENDSELECT. * Countries WRITE: /(39) 'Umsatzzahlen der EG Lnder' COLOR 6 NO-GAP. SKIP. LOOP AT ITABNA. CHECK NOT ITABNA-COUNTRY CP 'USA' AND NOT ITABNA-COUNTRY CP 'CAN' AND MOVE-CORRESPONDING ITABNA TO TABNASHOW. APPEND TABNASHOW SORTED BY COUNTRY. ENDLOOP. * SORT TABNASHOW BY COUNTRY.

TCC(1)
SAP America, Inc. prf3.ppt December, 1996

hsext01

OVR

11:38AM

Page 35

Runtime of ABAP/4 Statements SAP ABAP/4 Trace (ATRA) Tool List Edit Goto System Help ?
Choose

SQL Interface Select ... Where vs. Select + Check Select single vs. Select-Endselect Select aggregates String manipulation Special operators in IF (CA, ...) String concatenation II Deleting leading spaces

Select with index support Select ... Into Table t Select-Endselect vs. Array-Select

String concatenation String split String length

Internal Tables
Building sorted tables Building tables without duplicates Different forms of key access Building condensed tables Linear vs. binary search Secondary indices

TCC(1)
SAP America, Inc. prf3.ppt December, 1996

hsext01

OVR

11:38AM

Runtime Analysis: Initial Screen SAP ABAP/4ABAP/4 Trace (ATRA) Tool Statements Edit Goto System Help ?
Previous example Measure runtime List examples Display data

Select + Check Statement SELECT * FROM VERI_CLNT. CHECK: VERI_CLNT-ARG1 = ' 7 ' ENDSELECT .

Select with Where condition SELECT * FROM VERI_CLNT. WHERE ARG1 = ' 7 ' ENDSELECT .

microsec

18.767

microsec

1.587

* Always specify your conditions in Where-clause instead of * checking them yourself with check-statements. * The database system can then use an index ( if possible ) and the * network load is considerably less.

TCC(1)
SAP America, Inc. prf3.ppt December, 1996

hsext01

OVR

11:38AM

Page 36

Questions ?

SAP America, Inc. prf3.ppt December, 1996

Page 37

Potrebbero piacerti anche