Professional Documents
Culture Documents
AS ABAP
Performance Analysis
Publication ID:
SAP Copyrights and Trademarks
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE. The information contained herein may be changed without prior
notice.
Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.
Microsoft, Windows, Excel, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation.
IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, System z10, System z9, z10, z9, iSeries, pSeries, xSeries, zSeries, eServer, z/VM,
z/OS, i5/OS, S/390, OS/390, OS/400, AS/400, S/390 Parallel Enterprise Server, PowerVM, Power Architecture, POWER6+, POWER6, POWER5+, POWER5, POWER, OpenPower,
PowerPC, BatchPipes, BladeCenter, System Storage, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, Parallel Sysplex, MVS/ESA, AIX, Intelligent Miner, WebSphere,
Netfinity, Tivoli and Informix are trademarks or registered trademarks of IBM Corporation.
Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.
Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries.
Oracle is a registered trademark of Oracle Corporation
UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.
Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc.
HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology.
Java is a registered trademark of Sun Microsystems, Inc.
JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape.
SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP BusinessObjects Explorer, StreamWork, and other SAP products and services mentioned herein as well as their respective
logos are trademarks or registered trademarks of SAP SE in Germany and other countries.
Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and other Business Objects products and services
mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects Software Ltd. Business Objects is an SAP company.
Sybase and Adaptive Server, iAnywhere, Sybase 365, SQL Anywhere, and other Sybase products and services mentioned herein as well as their respective logos are trademarks or
registered trademarks of Sybase, Inc. Sybase is an SAP company.
All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications
may vary.
These materials are subject to change without notice. These materials are provided by SAP SE and its affiliated companies ("SAP Group") for informational purposes only, without representation or
warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the
express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.
Course Overview
Lesson Objectives
After completing this lesson, you will be able to:
Lesson Agenda
Learn About:
SAP System Overview
Performance Components
Database Monitoring
User Monitoring
Buffer Monitoring
Lesson Agenda
SAP Technology Tuning
Wait Time
Roll-In Time
Processing Time
Enqueue Time
ADM315 Unit 1 Lesson 1
Lesson Agenda
Roll-Out Time
CPU Time
GUI Time
Analysis Roadmap
Watch:
How to Explain the Flow of Requests through an SAP System
ADM315 Figure 1: SAP Systems and Releases of Software Unit 1 Lesson 1
Component SAP_Basis
ADM315 Table 1: Transaction Codes: Monitoring Unit 1 Lesson 1
2. The program loads are stored in table REPOLOAD, starting with SAP NetWeaver
Application Server 6.40 (before that, loads had been stored in table D010L).
4. The program load (or parts of it) are then copied into local memory of the work
process to be executed.
ADM315 Unit 1 Lesson 1
2. Products based upon SAP NetWeaver AS 7.0 or later. In this case, the work
process needs another work process of type DIA for this work. While this second
work process generates the load, the first work process is in status On Hold with
Reason RPC.
The complete work of the second work process is considered as Load & Generation
Time. In this case, the accumulated database request time is not separated from
the Load & Generation Time (as was the case with SAP NetWeaver Application
Server 6.40 or earlier). If no second dialog work process is available, then the same
procedure as in former releases is used.
ADM315 Figure 6: Components of the Dialog Response Unit 1 Lesson 1
Time
ADM315 Unit 1 Lesson 1
Starting with release 4.6A, the sending of data to the SAP GUI can be performed
with round trips. A round trip is a synchronous RFC to the front end. In this case a
roll-out can also be performed. Again, Roll Wait Time is accumulated.
ADM315 Figure 7: Roll Wait Time due to Synchronous RFC Unit 1 Lesson 1
and Roundtrips to the Front End
ADM315 Unit 1 Lesson 1
Synchronous Update processing - a dialog work process can hand over update
work to an update work process and wait for the update to complete. Remember
that the work process does not wait but, in fact, continues with a roll-out. However,
the dialog step (from the end users point of view) is not finished yet.
WAIT - this ABAP statement can be issued in situations when processing stops for
a specified time. Again, roll-out occurs.
ADM315 Figure 8: High Roll Wait Time Unit 1 Lesson 1
ADM315 Table 2: Potential Problems: Scenarios Unit 1 Lesson 1
Summary
You should now be able to:
Lesson Objectives
After completing this lesson, you will be able to:
Lesson Agenda
Learn About:
Workload Monitor Overview
Learn:
To Use a Statistical Record
Watch:
How to Determine the Average Dialog Response Time for a Given Period
ADM315 Unit 1 Lesson 2
Lesson Agenda
Do:
Determine the Average Dialog Response Time for a Given Period
ADM315 Figure 11: ST03: Workload Monitor - Last Minute Unit 1 Lesson 2
Load Screen
ADM315 Unit 1 Lesson 2
The average response time for transactions used on the SAP instance under
inspection.
ADM315 Figure 12: ST03: Transaction Profile - Standard Unit 1 Lesson 2
View
ADM315 Unit 1 Lesson 2
To display the single records grouped by business transaction or job, select Show
all records, grouped by business transaction.
ADM315 Figure 13: Initial Selection Screen Unit 1 Lesson 2
ADM315 Figure 14: STAD: List of Single Statistical Unit 1 Lesson 2
Records
ADM315 Figure 15: STAD: Single Statistical Records on Unit 1 Lesson 2
Display: Subview Time
ADM315 Figure 16: Data Flow for STAD and ST03 Unit 1 Lesson 2
ADM315 Unit 1 Lesson 2
3. The stat file(s) can be accessed directly by transaction STAD. The last minute load
analysis in transaction ST03 also accesses the stat file(s) directly. There is also a
report STATDUMP that displays raw data of the stat file(s).
4. The content of the stat file(s) is transferred regularly to the database table
SWNCMONI by report RSCOLL00.
The data is aggregated during this transfer. This means that not all statistics
information is transferred to table SWNCMONI. RSCOLL00 runs periodically as a
background job, named SAP_COLLECTOR_FOR_PERFMONITOR. RSCOLL00
evaluates the entries of table TCOLL to determine what actions should be
executed. Actually, RSCOLL00 triggers several reports, but only RSSTAT90 (or a
newer one) is used for transferring the stat file data to table SWNCMONI.
ADM315 Unit 1 Lesson 2
Summary
You should now be able to:
Lesson Objectives
After completing this lesson, you will be able to:
Lesson Agenda
Learn About:
Local Work Process Overview
Lesson Agenda
Buffer Problems and Solutions
Watch:
How to Analyze the Workload to Determine Performance Issues
Do:
Analyze the Workload to Determine Performance Issues
ADM315 Figure 17: Local Work Process Overview Unit 2 Lesson 1
ADM315 Unit 2 Lesson 1
Note:
The SAP system sometimes encounters situations in which work processes
cannot be restarted because of technical reasons (for example, out of memory).
The restart flag is set to No after unsuccessful restart attempts by the dispatcher.
If you encounter such a situation, remember that the problem lies somewhere
else, and can most likely be analyzed by evaluating the developer trace files of the
corresponding work processes.
For more information on unexpected terminations of work processes (NOT
because of errors), read the profile parameter abap/heaplimit because, as in this
case, no error will be reported.
Locked Semaphore
The semaphores of a work process that are currently being hold.
Requested Semaphore
ADM315 Unit 2 Lesson 1
Note:
This kind of evaluation only makes sense if the following conditions apply:
There has not been an operation mode switch since instance startup.
Operation mode switches change the type of work process but do not
reset the CPU time counter.
The work process has not been restarted since startup of the instance.
ADM315 Unit 2 Lesson 1
Swaps in buffers occur because there is not enough free space left in the buffer for
buffering the new object, or the buffer has run out of free directory entries.
Directory entries determine how many different objects can be contained in one
buffer area. However, directory entries also diminish the available size of the
buffer, independent of their usage. It is not advisable to set the number of directory
entries to high numbers, or no space may be left for the actual objects to be
buffered. However, a buffer should not swap because there are no directory
entries left.
Swaps are to be avoided, as are all other situations leading to lines shown in red in
the ST02 display.
You can find the parameters for all buffer-related settings by clicking the Current
Parameters button. If you then select the Profile maintenance (F6) button, you will
be referred to transaction RZ10; if you select the Change Profile parameter (F7)
ADM315 Unit 2 Lesson 1
Summary
You should now be able to:
Lesson Objectives
After completing this lesson, you will be able to:
Lesson Agenda
Learn About:
Dynamic and Reserved Work Processes
Watch:
How to Activate the Dynamic Work Process
ADM315 Figure 32: Dynamic Work Processes and Unit 2 Lesson 2
Associated Parameters
ADM315
Summary
You should now be able to:
Lesson Objectives
After completing this lesson, you will be able to:
Lesson Agenda
Learn About:
Virtual Memory in the SAP System
Memory Areas
Extended memory is allocated at instance start and can increase on demand
depending on the operating system.
Summary
You should now be able to:
Lesson Objectives
After completing this lesson, you will be able to:
Lesson Agenda
Learn About:
Memory Allocation
Watch:
How to Check the Limits of SAP Memory Usage
ADM315 Figure 41: Private Area of the Dialog Work Unit 3 Lesson 2
Process
ADM315 Figure 42: User Context and Extended Memory Unit 3 Lesson 2
Pool
ADM315 Figure 43: Work Processes Processing One Step Unit 3 Lesson 2
at a Time
ADM315 Figure 44: Roll Out Unit 3 Lesson 2
ADM315 Figure 45: Roll In Unit 3 Lesson 2
ADM315 Figure 46: Mapping Used for Accessing Data in Unit 3 Lesson 2
Extended Memory
ADM315 Unit 3 Lesson 2
- ztta_roll_first: Defines the first initial allocation size for the roll area
- ztta/roll_area: Defines the local roll area per work process
- rdisp/roll_SHM: Defines the size of the roll buffer
- rdisp/roll_MAXFS: Defines the total size of the roll area (consisting of roll
buffer and roll file)
Summary
You should now be able to:
Lesson Objectives
After completing this lesson, you will be able to:
Identify the causes of dialog work processes that enter PRIV mode
ADM315 Unit 3 Lesson 3
Lesson Agenda
Learn About:
Parameters for Sizing the Extended Memory
Watch:
How to Analyze the Cause of Work Processes PRIV Mode
Do:
Analyze the Cause of Work Processes PRIV Mode
ADM315 Figure 62: Problems with Many Dialog Work Unit 3 Lesson 3
Processes in PRIV Mode
ADM315 Figure 63: Detecting Insufficient Extended Unit 3 Lesson 3
Memory
ADM315 Figure 64: Controlling PRIV Modes Unit 3 Lesson 3
ADM315 Figure 65: Roadmap to Detect and Solve Unit 3 Lesson 3
Problems with Extended Memory
ADM315
Summary
You should now be able to:
Identify the causes of dialog work processes that enter PRIV mode
Unit 4: Hardware Capacity Verification
Lesson Objectives
After completing this lesson, you will be able to:
Lesson Agenda
Learn About:
Hardware Performance Issues
Watch:
How to Identify Hardware Performance Issues
Do:
Identify Hardware Performance Issues
ADM315 Unit 4 Lesson 1
CPU Bottlenecks
1. Choose ST06 Systems <SID> then Snapshot Top 40 CPU processes to
identify processes with high CPU utilization.
2. If a process found in step 1 is an SAP work process, write down its process ID (PID)
and compare it (quickly) to the list in transaction SM50 to find out what activity in
the SAP system is causing the load. This activity might need some tuning.
3. If the process found in step 1 is part of your database infrastructure, try to identify
the reason for this database activity. Transaction ST04 will help you in this task.
Check if this database activity might be tuned or moved to another time, thus
causing less interference with online work.
4. If the process found in step 1 is not part of the SAP system, you need to decide if
this process might be moved to other hardware.
ADM315 Figure 67: Hardware Analysis Roadmap 2 Unit 4 Lesson 1
ADM315 Unit 4 Lesson 1
2. If necessary, reduce the size of the file system cache to less than 10% of the total
physical memory.
Summary
You should now be able to:
Lesson Objectives
After completing this lesson, you will be able to:
Lesson Agenda
Learn About:
Memory Configuration Recommendations
After startup of all necessary components for an instance of an SAP system, the
initial usage of virtual memory on the server the SAP instance runs on, should be
below 1.5 times the size of physical memory (RAM) provided that no AS Java is in
use. When using AS Java, avoid using page/swap.
Swap size (UNIX) should be about three times physical memory (or less), 64-bit
systems should have 20 GB swap space (or more) available.
ADM315 Unit 4 Lesson 2
Update processing might use between 10% and 20% of the total CPU power of
your entire SAP system.
ADM315 Unit 4 Lesson 2
Visit http://service.sap.com/sizing
Carefully read the information provided in the installation and upgrade guide for
the SAP solution you would like to use.
ADM315
Summary
You should now be able to:
Lesson Objectives
After completing this lesson, you will be able to:
Detect expensive SQL statements using the transaction profile and statistical records
Lesson Agenda
Learn About:
Expensive SQL Statements
Lesson Agenda
Long Running Transaction Analysis
Lesson Agenda
SQL Monitor Data Display
Learn:
To Use Database Process Monitor
Watch:
How to Display the Details of an ABAP Program with Work Process Overview
How to Find Expensive SQL Statements Using the Shared Cursor Cache
Do:
Optimize Runtimes of Expensive SQL Statements
ADM315 Figure 71: Consequences of Expensive SQL Unit 5 Lesson 1
Statements
ADM315 Unit 5 Lesson 1
The work process is waiting for the database response and therefore not available
for other requests (potentially increasing their wait time).
Many blocks might be displaced from the database buffer; this can have negative
impact on following requests.
ADM315 Unit 5 Lesson 1
2. Sort the Total Database Time column in ascending order, and then total this
column. Transactions causing more than 5% of this total database time are worth
a closer look with respect to tuning measures.
3. Sort the Total Response Time column in ascending order, and then Total this
column. Transactions causing more than 5% of this total response time are worth
a closer look with respect to tuning measures.
ADM315 Figure 76: Basic Usage of the Database Monitor Unit 5 Lesson 1
ADM315 Unit 5 Lesson 1
Check the number of user calls compared to recursive calls. There should be no
more than 1 recursive call for each 2 user calls.
Check the Reads/User Call. If this value exceeds 15 (blocks read per user call) then
this is an indicator for expensive SQL statements.
ADM315 Figure 77: The Database Process Monitor Unit 5 Lesson 1
ADM315 Figure 78: The Database Process Monitor Screen Unit 5 Lesson 1
Details
ADM315 Figure 79: Access the Execution Plan Unit 5 Lesson 1
ADM315 Figure 80: Monitoring Buffer Gets Unit 5 Lesson 1
ADM315 Figure 81: How SAP SQL Trace Works Unit 5 Lesson 1
ADM315 Unit 5 Lesson 1
5. Proceed, in another session, with the action you would like to trace.
6. After the action of interest has been finished, switch back to the session offering
ST05 and choose Deactivate Trace.
8. The default settings on the popup screen are relevant for your last active trace.
You can proceed without changing any settings, unless you would like to evaluate
an older trace recording.
ADM315 Unit 5 Lesson 1
The Program Name column displays the name of the accessed database object.
The Object Name column displays the name of the database operation carried out.
In all relevant cases, Explain, will be carried out for operation Reopen. The operation
open means that a specific DB operation is carried out for the first time. Following
identical operations are named reopen. The other possible DB operations are not of
central relevance for our goal. You may go to the database manufacturers
documentation to get more information on these operations.
What is the SQL profile of my main business process (for example, transaction X)?
Which SQL statement has the highest execution time?
Which SQL statement is executed most frequently in my custom code?
ADM315 Unit 5 Lesson 1
Summary
You should now be able to:
Lesson Objectives
After completing this lesson, you will be able to:
Lesson Agenda
Learn About:
SQL Statement Index Application
Database Statistics
Watch:
How to Tune Expensive SQL Statement Issues
Do:
Tune Expensive SQL Statement Issues
ADM315 Unit 5 Lesson 2
Database Statistics
The structure of the queried table as expressed by its statistics.
The fields specified in the WHERE clause of the SQL statement.
The availability of indexes for the queried tables.
ADM315 Figure 96: Checking the Optimizer Decisions Unit 5 Lesson 2
Using Explain
ADM315 Unit 5 Lesson 2
2. As a result of this check, all tables that have experienced more than a certain
degree of changes during a specified period (for example, one week) will be written
(by name) in table DBSTATC. This check should run, for example, once a week.
3. Once per week DBSTATC is evaluated and the statistics of the tables listed there
are refreshed. As the content of DBSTATC is subject to change, the number of
tables with statistic updates might also change from week to week.
ADM315 Figure 97: Analyze Function in Transaction DB20 Unit 5 Lesson 2
ADM315 Figure 98: Tips for Optimizing ABAP Coding Unit 5 Lesson 2
ADM315 Figure 99: Using Tips and Tricks Unit 5 Lesson 2
ADM315 Figure 100: Identify and Tune Expensive SQL Unit 5 Lesson 2
Statements 1 of 2
ADM315 Figure 101: Identify and Tune Expensive SQL Unit 5 Lesson 2
Statements 2 of 2
ADM315
Summary
You should now be able to:
Lesson Objectives
After completing this lesson, you will be able to:
Lesson Agenda
Learn About:
Table Buffers in the SAP System
Lesson Agenda
Recommendations for Table Buffering
Watch:
How to Display Buffer Settings for Tables
Do:
Display Buffer Settings for Tables
ADM315 Figure 109: Table Buffers in SAP Systems Unit 6 Lesson 1
ADM315 Unit 6 Lesson 1
Generic area buffered: You set the number of key fields for the table used to
determine the data to be buffered during access. This is also known as generic key
buffering.
Do not activate buffering for tables that contain data that must not be read/
evaluated when outdated.
When activating the buffering for new tables, the table buffers should offer enough
free space to hold the expected amount of data.
Summary
You should now be able to:
Lesson Objectives
After completing this lesson, you will be able to:
Lesson Agenda
Learn About:
Buffering Problem Detection
By choosing next view (CTRL + F3), information such as the volume of buffered
data for individual tables and the peak volume buffered for those.
ADM315 Figure 118: Identify How Often Tables are Unit 6 Lesson 2
Accessed
ADM315 Figure 119: Getting more Information from Unit 6 Lesson 2
Transaction ST10
ADM315 Figure 120: Using Transaction ST10 to Identify Unit 6 Lesson 2
Buffering Problems
ADM315
Summary
You should now be able to:
Lesson Objectives
After completing this lesson, you will be able to:
Lesson Agenda
Learn About:
Selected Interface Technologies Used in an SAP Environment
Purposes of RFCs
Communication between two SAP systems, or between an SAP system and a non-
SAP system
Asynchronous RFC (aRFC) Used for communication between systems, and for
parallel processing.
Queued RFC (qRFC) A specialized tRFC (and aRFC) that is used for multiple
communication steps in a specified order.
Background RFC (bgRFC) A replacement for the classic tRFC and qRFC, available
with SAP NetWeaver AS 7.00.
ADM315 Figure 123: Dialog Step with Synchronous RFC Unit 7 Lesson 1
and Round Trip
ADM315
Summary
You should now be able to:
Lesson Objectives
After completing this lesson, you will be able to:
Lesson Agenda
Learn About:
RFC Monitoring Requirements
Performance Trace
ADM315 Unit 7 Lesson 2
Lesson Agenda
Benefits of Running a Performance Trace
Watch:
How to Monitor RFC Load and Resolve RFC Load Issues
ADM315 Unit 7 Lesson 2
Lesson Agenda
Do:
Monitor RFC Load and Resolve RFC Load Issues
ADM315 Figure 124: RFC Server Profile and More Unit 7 Lesson 2
ADM315 Figure 125: RFC Calls in STAD, Calling System/ Unit 7 Lesson 2
Client System
ADM315 Figure 126: RFC Monitoring: RFC+CPIC Time as Unit 7 Lesson 2
Seen at the Client in the Dialog Step Record
ADM315 Figure 127: RFC Sub-Records in Detail - STAD Unit 7 Lesson 2
ADM315 Figure 128: Performance Trace: RFC Record Unit 7 Lesson 2
ADM315 Figure 129: Performance Trace: RFC Record Unit 7 Lesson 2
Details
ADM315 Figure 130: Transactional RFCs Unit 7 Lesson 2
ADM315 Figure 131: aRFC Quotas Setting Unit 7 Lesson 2
ADM315
Summary
You should now be able to: