50% found this document useful (2 votes)
421 views99 pages

SAP Performance Analysis - AC

Uploaded by

Ramesh Harshan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
50% found this document useful (2 votes)
421 views99 pages

SAP Performance Analysis - AC

Uploaded by

Ramesh Harshan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 99

The ST12 trace tool

Usage and Analysis


Dáithí Mac Lochlainn, SAP
21 July, 2021

PUBLIC
Overview of today’s topic

• Over the years there have been many tools developed for performance analysis on an SAP
NetWeaver ABAP application server. Like the tools in a toolbox, each has its own special
purpose. There is one however that over time has shown itself to be the ultimate trace tool for
transactional analysis.

• Today we are going to look at the usage of the ST12 Single Transaction Analysis trace tool, its
features and how you can apply it in your systems to the maximum effect.

• ST12 was developed internally within SAP Support due to frustrations with the limitations of the
ABAP trace (SE30) and the performance trace (ST05). It is part of the add-on ST/A-PI and is not
officially documented as it was primarily intended as a tool for SAP Support and certified
consultants during SAP Service Sessions such as the GoingLive Check or a Business Process
Performance Optimization (BPPO).

• All the details can be found in SAP Note 755977 - ST12 "ABAP Trace for SAP
EarlyWatch/GoingLive“ which whilst dated 2006 still provides a solid overview of the tool.
© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 3
Agenda

▪ A Brief Introduction to Performance Optimization

▪ ST12 trace tool introduction

▪ ST12 trace capturing

▪ Additional data collection for Performance Optimization

▪ Trace file analysis

▪ Key takeaways

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 4


Performance Optimization Introduction
Performance Optimization Introduction
What is Performance Optimization?

▪ Goal
The aim of Performance Optimization is to improve the runtime of
either the overall system or individual transactions.
▪ Scope
• Use standard transactions ST02, ST03, ST06 and trace tools to
analyze the system in question and determine if there are any
system-level issues (affecting all users and transactions) or any
application-specific issues affecting individual transactions or
reports.
• In this example we can see transaction IW37 took 30 minutes
before ending in a time out situation.
• The transaction IW37 Change Operations was traced using ST12
and an expensive access to the database view AFVC was identified
and tuned, thereby reducing the average runtime to less than one
minute. The graph shows three tests on 31st March with the
optimized runtime.
▪ Benefits
• Elimination of costly performance bottlenecks
• Improvement of response times
• Improvement of database request times
• Optimization of hardware resource usage

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 6


Performance Optimization Prerequisites
SAP Performance Optimization -> appendix

• The ultimate reference for all things related to SAP Performance Optimization is the book
published by SAP Press. It is currently in its 8th edition. Its author Thomas Schneider has
updated the book for over twenty years.

• There are also many SAP Notes, Knowledge Base Articles, blogs and whitepapers available on
the topic.
• In our discussions of ST12 we are assuming a basic understanding of performance tuning.
© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 8
Performance Optimization Prerequisites
Technical prerequisites
◼ Managed Systems / Systems to be analyzed
▪ User with sufficient authorizations as per 1405975 (ST12, ST05, SE30, STAD, ST03,
etc.)
▪ SAP Note 1634757 and SAP Note 1609155 for ST12 Trace Analysis
▪ Reproducible transactional performance problem within connected SAP systems
▪ Use report RTCCTOOL to ensure that the latest versions of add-ons ST-PI (SAP Note
539977) and ST-A/PI (SAP Note 69455) are implemented
▪ Running EarlyWatch Alert on managed systems (optional)

◼ SAP Solution Manager


▪ SAP Solution Manager 7.2 & ST-SER 720 is required for the delivery of SAP services
▪ Technical Perquisites as per SAP Note 2253047 (in particular: System connections, SDR,
User Authorizations, SDCCN, Content Update )
▪ Use report RTCCTOOL to ensure that the latest versions of add-ons ST-PI (SAP Note
539977) and ST-A/PI (SAP Note 69455) are implemented
▪ RFC (READ, TRUSTED and LOGIN) connections from SAP Solution Manager to
managed/to be analyzed systems

◼ Support Backbone set up according to the following.

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 9


Performance Optimization Prerequisites
Additional information

• Reproducible example (transactional performance problem)

• Data required for this session must represent your normal daily operations

• Transactions and data to be used for this session must be suitable for a trial run of all the functions you
use in your production environment.

• All transactions can be executed several times (prepare a reusable scenario) – filling buffers

• After running the step at least once, you should execute the step together with an ST12 trace for one
action only (e.g. hit "Save" button within one transaction).

• Start an ST12 trace during execution of a batch job, if necessary

• Different ST12 trace execution modes exist which we will go into in detail

• MS Word available on frontend PC (optional)

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 10


Identifying issues for Performance
Optimization
Identifying issues for Performance Optimization
Early Watch Alert (EWA) Trend Analysis

EarlyWatch Alert Trend Analysis shows


transactions, jobs and HTTP requests
with high response times, including total
response time in % within the system

Once you identify problematic


Transactions/Jobs/Requests on the
system, collect an ST12 trace of the
problem step (batch, dialog or HTTP(S)
task) and use GSS Performance
Optimization to support the analysis

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 12


ST03 Workload Monitor
ST12 trace tool introduction
ST12 trace tool introduction
Overview

The steps involved in the tracing and Define trace settings


analysis of a program/transaction can be
split into 4 distinct sections:
▪ Definition of trace settings Trace capturing

▪ Trace capturing
Collect additional data
▪ Collection of additional data
▪ Analysis of the trace Trace Analysis

ABAP Trace Performance Trace SQL Summary Stat. Records Others


A brief introduction of each of the above is
included in this section

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 16


Differences between ST12 and the older ST05 and SE30

Original SE30 and ST05 traces

• Per instance

• Stored on file system

ST12

• Across instances

• Stored in database

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 17


ST12 trace tool introduction
Trace capturing

1. User or specific task type such as 1 2 3 4


HTTP or RFC

2. Trace of a single work process

3. Trace current user execution

4. Trace a background job

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 18


ST12 trace tool introduction
Collect Additional Data

1 2
1. Collect external traces (Manual)

2. Statistical records (Automated)

3. SQL Summary (Automated)

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 19


ST12 trace tool introduction
Trace analysis

ABAP Trace analysis involves the


following:

▪ Gross time analysis

▪ Net time analysis

▪ Per modularization unit analysis

▪ Top down time-split

▪ Bottom-up call hierarchy

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 20


ST12 trace capturing
ST12 trace tool introduction
Define trace settings

1. Maintain the trace settings

2. Ensure flag ‘with internal tables’ is


set (default)
1
3. Set trace file size and max. trace
time 2
3

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 22


ST12 trace capturing
Trace-independent settings
1

Record most often accessed tables in STAD


- Navigate to ST03 -> Dialog Step Statistics

1. Set the dynamic parameter stat/tabrec to at least 5


for all the application servers

2. Activate values

Note: Once the tracing activities are finished, please 2


revert this setting back to the default value, as it can
have a negative impact on system performance.

Prevent System Trace overwrite


- Navigate to ST01 -> Menu GoTo -> Administration. 3

3. Set Maximum File Size to 100MB

4. Activate
4
5. Write to Buffer
5

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 23


ST12 trace capturing
Use of current mode

Define trace settings


Current mode tracing is utilized
if the user currently being used

Trace Recording
to login to the system can
execute the Activate Trace Execute Application
program/transaction in Dialog
mode

Display

Display
ABAP Trace Performance Trace SQL Summary Stat. Records Others
Analyze

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 24


ST12 trace capturing
Current Mode timeline

ST12 current mode trace


The ABAP and SQL Traces are T1 T1a T1b T2
recorded for all of the execution time
(between T1 and T2). This means
that all activities are recorded,
including, for instance, the report
screen generation.

Start Report Results Back


Execute
Z_ITAB_ALL

ABAP Trace

SQL Trace

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 25


ST12 trace capturing
Current Mode Settings

1
1. Choose Current Mode
2
2. Enter trace description
3 5
3. Enter name of program being analyzed e.g.
Z_ITAB_ALL 4

4. Choose options
5. Execute

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 26


3

ST12 trace capturing 2

Current Mode execution and tracing

1. ABAP trace is activated


2. Execute the report
3. End of report (Back or F3)

1
© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 27
ST12 trace capturing
Current Mode, back to ST12

1. Trace is finished
2. Trace is created
3. The trace is still being imported into the database
(red and white circle)

3
2

1
© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 28
ST12 trace capturing
Current Mode, Trace is generated

1. Trace analysis is available


2. The trace is ready (green tick)

2
1

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 29


ST12 trace capturing
Use of current mode – particular units
Set flag
‘Particular units’ Define trace settings
Current mode tracing is utilized if Set trace markers
the user currently being used to

Trace Recording
/ron, /roff
login to the system can execute
the program/transaction in Activate Trace Execute Application
Dialog mode.

Using particular units, it is


possible to activate the trace for Display

Display
only a specific part of the
execution of a transaction.
ABAP Trace Performance Trace SQL Summary Stat. Records Others
Analyze

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 30


ST12 trace capturing
Current Mode, particular units timeline

ST12 current mode trace


We don't want to trace the whole T1 T1a T1b T2
execution (dashed black arrow)
between T1 and T2 but only the
data process (solid red arrow) /ron /roff
between T1a and T1b.

Start Report
Note: The SQL trace (dashed grey Execute Results Back
Z_ITAB_ALL
arrow) records the whole execution
of the transaction and not only
particular units of it. ABAP Trace

SQL Trace

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 31


ST12 trace capturing
Current Mode, Particular Units settings

1. Choose Current Mode


2. Enter trace description 1
3. Enter name of program being analyzed e.g. 2
Z_FLIGHT_PARTICULAR
3 5
4. Activation of Particular units mode
5. Execute
4

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 32


2

ST12 trace capturing


Current Mode, particular units tracing

1. ABAP trace started, waiting for particular unit activation


2. Execute any steps that you wish to not include in the trace.
In this example, this will be an Initialization step.

1
© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 33
1

3
ST12 trace capturing
Current Mode, particular units – tracing on

1. Set “/ron” to activate the Particular unit trace


2. Runtime analysis is enabled
3. Execute the step you want to analyze

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 34


1 3
ST12 trace capturing
Current Mode, particular units – tracing off

1. Set “/roff” to deactivate the Particular unit trace


2. Runtime analysis is disabled
3. Quit the report

2
© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 35
1
ST12 trace capturing
Current Mode, Particular units trace result

1. Trace finished and trace being collected


2. The trace collected and is ready for analysis (green
tick)

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 36


ST12 trace capturing
Current Mode, Particular units activation alternatives

Alternatively you can use the menu path:


▪ System - Utilities(H) - Runtime Analysis - Switch on
▪ System - Utilities(H) - Runtime Analysis - Switch off

In the ABAP Code:


▪ SET RUN TIME ANALYZER ON.
▪ SET RUN TIME ANALYZER OFF.

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 37


ST12 trace capturing
Use of work process trace

Define trace settings


Running
The work process tracing is
Application
dedicated to tracing an already

Trace Recording
running program.
Activate Trace
Deactivate Trace

Display

Display
ABAP Trace Performance Trace SQL Summary Stat. Records Others
Analyze

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 38


ST12 trace capturing
Work Process trace settings

1. Choose ‘Workprocess’
1
2. Enter a descriptive comment to
ease the identification of the 2 3
trace 3
5
3. Choose Application Server
4
- This will include a list of all the
Application Servers on your
system. The system used only
had a single Application Server
and thus, only the <Local >
server is listed
4. Choose options
5. Start traces for workprocress

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 39


2 4

ST12 trace capturing


Work Process tracing

1. Mark Work process


2. Activate trace
3. ABAP traces started (see icons & refresh)
4. Stop trace
5. Trace is finished, go back to ST12

1 3

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 40


ST12 trace capturing
Use of User / Tasks trace

Define trace settings Exec 1


The User/ Tasks trace can trace RFC
every single task a given user is

Trace Recording
performing, or a single task type. Exec 3
Activate Trace HTTP
Exec 2
Ensure the user being traced is
DIA Deactivate Trace
only executing actions relating to
the process step being traced.
Exec 4
This makes it easier to identify the BTC
corresponding trace. Display

Display
Example – it is possible to trace
only Execution 2 by specifying the ABAP Trace Performance Trace SQL Summary Stat. Records Others
task type. If it was not specified,
traces would also be collected for
Execution 3.
Analyze

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 41


ST12 trace capturing
User / Tasks settings
3

1. Choose User/ Tasks


2. Enter a descriptive comment to ease the 1
identification of the trace
2
3. Choose application server
3
4. Choose User and/or Task type 4
4 5
5. Number of trace activations / requests 6

6. Start trace

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 42


ST12 trace capturing
User / Tasks tracing
4

1. ABAP waiting trace requests


2. ABAP running traces
3. ABAP finished trace files 1 2 3

4. Refresh the table


5. End traces and collect
5

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 43


1
ST12 trace capturing
User / Tasks collection

1. Select the relevant traces


2. Validate
3. Traces are imported and available

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 44


ST12 trace capturing
User / Tasks background information

The content of the ABAP trace part might not be T1 T2


the same as the content of the performance trace ST12 from trace ON to trace OFF
part as:
▪ New ABAP traces are created for each SQL Trace 1
transaction/Logical Unit of Work (LUW) R1 R2
▪ However, only one performance trace for all AS1 ABAP Trace 1 ABAP Trace 2
requests for a given user/task/servers is
created

The red arrows (ABAP trace 1, 2, and 3, respectively)


show the time frames which will be recorded in the R3
ABAP trace if each request (R1, R2, R3) is a transaction.
AS2 ABAP Trace 3
SQL Trace 2
The grey dashed arrows (SQL trace 1 and ,2
respectively) show the time frames which will be
recorded in the performance trace.

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 45


ST12 trace capturing
Use of scheduled trace

Define trace settings


The scheduled trace is used to
trace background jobs, or

Trace Recording
executions which cannot be Background Automatic Trace activation
easily traced using the other Job
means (e.g. due to long Automatic Trace activation
execution, execution on
weekends / at night etc.) but can
be executed in the background Display

Display
ABAP Trace Performance Trace SQL Summary Stat. Records Others
Analyze

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 46


ST12 trace capturing
Scheduled trace, settings

1. Maintain the trace settings as for normal ST12


traces.
2. Check flag “with internal tables”
3. Set the max size of file to at least 20 MB by clicking
the pushbutton. Available options are:
- Normal (2 MB / 1800 sec max.) 1
- Large (20 MB / 4200 sec max.)
- Max. (99 MB / 4200 sec max.) 2
3

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 47


ST12 trace capturing
Scheduled trace, settings

Use one of the following 1


1. Select ‘Schedule >’ on the ST12 screen
2. Navigate to Utilities –> Schedule trace -> For
Batchjob or Workprocess

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 48


ST12 trace capturing
Scheduled trace, settings

Enter the following: 2

1. The name of the job 3


AND/ OR
2. Username
AND/ OR
3. The name of the report 4

4. The time frame (e.g. 1.5h.,12 h. or 24h.)


5
5. Trace duration max, start delay and check interval
6. Number of follow-up traces
6
7. Enter a descriptive comment to ease the identification
of the trace 7

8. Press the button “Schedule trace” 8

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 49


ST12 trace capturing
Scheduled trace, tracing

After scheduling the trace :


1. An entry in the list of scheduled trace 4
requests is visible. Check if entry is
correct. If the job has not started yet, 1
the binocular icon will be present
2. You can refresh to monitor the trace
requests. If a job based on the
selection criteria has been found, the 4
trace will be switched on.
2
3. The trace has been complete OR no
job was found matching the criteria.
See log for details.
4. You can stop the trace at any point
before or during the execution. You
can also delete the trace request.
3

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 50


ST12 trace capturing
Scheduled trace, Important information

– Perform only short SQL traces to avoid overwriting the trace.

– Work process tracing is used, therefore, if the scheduled trace is starting during a long running SQL
statement, and after its “OPEN CURSOR” execution, then the ABAP recording will not start, only the
performance trace will record FETCH lines, and therefore no access to the ABAP source code is possible.
(see work process tracing example)

– At any one time only one ABAP trace request can be done by ST12. So do not plan parallel requests, only
sequential requests.

– If several jobs match the criteria set for the trace, only the first job will be traced, the others will be ignored
(only 1 work process can be traced)

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 51


ST12 trace capturing
Scheduled trace, Delay setting example

It is possible to set up 3 sequential


scheduled traces, for a batch job running
for 6 hours. In our examples we want to
trace the 1st, 3rd and 5th hour. 1h 2h 3h 4h 5h 6h

Background Job
Parameters to set : Delay 14400s Trace 3
1. 1st hour : no delay, duration 3600 Delay 7200s Trace 2

2. 3rd hour : delay of 7200, duration 3600 Trace 1

3. 5th hour : delay of 14400, duration 3600


Time

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 52


Additional data collection for
Performance Optimization
Additional data collection for Performance Optimization
External traces

After a trace has already been scheduled and 1


collected on the external system:
1. Collect ext. traces 2
2. Select a local RFC destination
3. Enter Timeframe 3
4 5
4. Select read time or end time option
5. Select additional timeframe options
6
6. Select TransactionID (E2E analysis) 7

7. Search 5

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 54


Additional data collection for Performance Optimization
External traces (continued)

After scheduling the trace :


1
1. Select the found external trace
2. Validate and import it into the database

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 55


Additional data collection for Performance Optimization
Statistical records

1. Statistical records 1

2. Select the trace for importing stat rec. 3


4 5
3. Enter Timeframe
4. Select read time or end time option
5. Select additional timeframe options 6

6. Select TransactionID (E2E analysis)


7
7. Search

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 56


Additional data collection for Performance Optimization
Statistical records (continued)

2
1. Select a record for detail
analysis 1
2. Detail of this statistical
record
3. Select all the relevant
records from the chosen
timeframe
3

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 57


Additional data collection for Performance Optimization
Store Statistical records

1. Import it to your ABAP/Perf. Trace


The following options are available:
2) Merge – add the selected statistical
records to the analysis alongside any
already existing records.
3) Store + Delete - add the selected
statistical records to the analysis and
delete any other existing records. 2

4) Save as new trace analysis – creates


3
a new analysis independent of the
5
currently existing ones.
5. Statistical records were saved in the 4

trace – you can go back to ST12

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 58


Additional data collection for Performance Optimization
Display Statistical records

1. Select the trace where you’ve imported


the statistical record. 1
2. Show Stat. records

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 59


Additional data collection for Performance Optimization
Display SQL Summary

1
The SQL Summary is imported
2
automatically and asynchronously after
the ABAP trace collection has been 3 5

finished.
5

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 60


Non-Performance Analysis using ST12
Transaction Correctness Analysis (TCA)

• ST12 can also be used to check the correctness of a transaction

• ABAP transactions follow the general ACID principle of Atomicity – Consistency – Isolation -
Durability

• Transactional correctness means that all data that is logically dependent on another has to be posted
either all together or not at all. The amount of database changes required for this operation is called a
Logical Unit of Work (LUW). These exist on both the database and the functional levels.

• A database logical unit of work (LUW) is a non-separable sequence of database operations.


Database LUWs allow the encapsulation of logically related actions from a business process.

• An SAP LUW is a logical unit consisting of dialog steps, whose changes are written to the database
in a single database LUW. Multiple SAP LUWs combine to form an SAP Transaction.

• ST12 only considers statements of type INSERT, UPDATE, DELETE, COMMIT and ROLLBACK as
well as ENQUEUE, DEQUEUE and DEQUEUE ALL and brings them into a chronological order
depending on their trace time stamp. It analyzes the contents of the trace based on rules.

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 61


Analyzing traces
Analyzing traces
Start with the high-level overview

• And now for the fun part, the analysis….

• The sigma symbol gives us a summation of the functions called. It is the first indicator of whether
we have an ABAP or a database issue to investigate.

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 63


SAP Tools for analyzing traces
Guided Self Services

• The analysis of ST12 traces can be considered an expert task and as such, SAP have
developed a number of supporting tools to help with the analysis.

• The main tool is Guided Self Services via the Solution Manager and there are various types of
this tool.

• In our case the Guided Self Service for Performance Optimization can be used for analysing the
ST12 trace

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 65


Guided Self Service Performance Optimization Introduction
Guided Self Services - Overview

▪ Goal
Use in all phases of your application lifecycle management the various
SAP service best practices built and proven by SAP’s Centers of
Expertise. Guided procedures enable you to tailor the service content
to the relevant one for your requirements and solution environment.
▪ Scope
• Guided analysis based on automated data collection and data
evaluation
• Guided follow-up actions
• How to implement the service recommendations
• How to control the future target to ensure that any deviations
are corrected (e.g. control of Business Process KPIs)
▪ Benefits
• Automation and Self-help industrialization
• Standardized expert collaboration and continuous learning

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 66


Guided Self Service Performance Optimization Introduction
Guided Self Service ”Performance Optimization” (PERF)

▪ Goal
The Guided Self Service Performance Optimization
helps to optimize your transactional performance
by using SAP Active Global Support application
analysis tools.
▪ Scope
• Automated pre-analysis of ST12 traces, Solution
Manager Diagnostics E2E traces and ST14 application
analysis
• Provide generic and specific recommendations how to
optimize SAP coding, customer coding and database
accesses
▪ Benefits
• Elimination of costly performance bottlenecks
• Improvement of response times
• Improvement of database request times
• Optimization of hardware resource usage

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 67


Application tuning – Classification of
Tuning Methods and common issues
GSS Performance Optimization – Follow-up
Application tuning – Classification of Tuning Methods

Starting Point
Optimal system set-up and tuning!
Technical Methods
General methods which are independent
Major from the application and which are purely technical
Focus Technical- Application Methods
Optimization techniques inside the application with a low
impact on core process

Application Methods
Major changes in the application with a high impact on the
set-up of the core process

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 69


GSS Performance Optimization – Follow-up
Application tuning – Classification of Tuning Methods
1
1. Presentation layer (GUI)
– Little tuning potential

2. LAN/WAN network between GUI & SAP Application server


– Sufficient network capacity

3. SAP Application Server


– Optimal SAP Buffer tuning & Memory Management tuning 2

4. LAN network between SAP Application server & DB server 3


– Sufficient network capacity Application Server(s)
5. Database Management System 4

– Optimal database tuning & optimal DB layout for the I/O 5


environment Database
6
I/O
6. I/O Subsystem
– Optimal tuning of the file cache
© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 70
GSS Performance Optimization – Follow-up
Application tuning – Classification of Tuning Methods
1
1. Presentation layer (GUI)
– Little tuning potential

2. LAN/WAN network between GUI & SAP Application server


– Sufficient network capacity

3. SAP Application Server


– Optimal SAP Buffer tuning & Memory Management tuning 2

4. LAN network between SAP Application server & DB server 3


– Sufficient network capacity Application Server(s)
5. Database Management System 4

– Optimal database tuning & optimal DB layout for the I/O 5


environment Database
6
I/O
6. I/O Subsystem
– Optimal tuning of the file cache
© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 71
GSS Performance Optimization – Follow-up
Application tuning – Classification of Tuning Methods
1
1. Presentation layer (GUI)
– Little tuning potential

2. LAN/WAN network between GUI & SAP Application server


– Sufficient network capacity

3. SAP Application Server


– Optimal SAP Buffer tuning & Memory Management tuning 2

4. LAN network between SAP Application server & DB server 3


– Sufficient network capacity Application Server(s)
5. Database Management System 4

– Optimal database tuning & optimal DB layout for the I/O 5


environment Database
6
I/O
6. I/O Subsystem
– Optimal tuning of the file cache
© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 72
GSS Performance Optimization – Follow-up
Application tuning – Classification of Tuning Methods
1
1. Presentation layer (GUI)
– Little tuning potential

2. LAN/WAN network between GUI & SAP Application server


– Sufficient network capacity

3. SAP Application Server


– Optimal SAP Buffer tuning & Memory Management tuning 2

4. LAN network between SAP Application server & DB server 3


– Sufficient network capacity Application Server(s)
5. Database Management System 4

– Optimal database tuning & optimal DB layout for the I/O 5


environment Database
6
I/O
6. I/O Subsystem
– Optimal tuning of the file cache
© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 73
GSS Performance Optimization – Follow-up
Application tuning – Classification of Tuning Methods
1
1. Presentation layer (GUI)
– Little tuning potential

2. LAN/WAN network between GUI & SAP Application server


– Sufficient network capacity

3. SAP Application Server


– Optimal SAP Buffer tuning & Memory Management tuning 2

4. LAN network between SAP Application server & DB server 3


– Sufficient network capacity Application Server(s)
5. Database Management System 4

– Optimal database tuning & optimal DB layout for the I/O 5


environment Database
6
I/O
6. I/O Subsystem
– Optimal tuning of the file cache
© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 74
GSS Performance Optimization – Follow-up
Application tuning – Classification of Tuning Methods
1
1. Presentation layer (GUI)
– Little tuning potential

2. LAN/WAN network between GUI & SAP Application server


– Sufficient network capacity

3. SAP Application Server


– Optimal SAP Buffer tuning & Memory Management tuning 2

4. LAN network between SAP Application server & DB server 3


– Sufficient network capacity Application Server(s)
5. Database Management System 4

– Optimal database tuning & optimal DB layout for the I/O 5


environment Database
6
I/O
6. I/O Subsystem
– Optimal tuning of the file cache
© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 75
GSS Performance Optimization – Follow-up
Application tuning – Classification of Tuning Methods
1
1. Presentation layer (GUI)
– Little tuning potential

2. LAN/WAN network between GUI & SAP Application server


– Sufficient network capacity

3. SAP Application Server


– Optimal SAP Buffer tuning & Memory Management tuning 2

4. LAN network between SAP Application server & DB server 3


– Sufficient network capacity Application Server(s)
5. Database Management System 4

– Optimal database tuning & optimal DB layout for the I/O 5


environment Database
6
I/O
6. I/O Subsystem
– Optimal tuning of the file cache
© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 76
GSS Performance Optimization – Follow-up
Application tuning - Areas of technical performance tuning

There are different areas of tuning. As you will see later some of the tuning methods cover different areas:

▪ Parallel Processing

▪ Database Locks

▪ SAP Enqueues

▪ Workload Distribution

▪ Database Server versus Application server

▪ Shared Resources

▪ Sizing

▪ Customer Specific Coding

▪ Tuning of application functions

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 77


GSS Performance Optimization – Follow-up
Areas of technical performance tuning – Parallel Processing

Scenario: Post the Goods Issue for 1000


deliveries between 8 and 9 am. 8am 9am 10am 11am

Option 1:
Goods Issue Posting in a single job
-> Time conflict

Option 2:
Goods Issue with three jobs in parallel
-> Executed within timeframe

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 78


GSS Performance Optimization – Follow-up
Areas of technical performance tuning – Parallel Processing (continued)

Prerequisites:

▪ Application allows parallel processing

▪ Building subsets (variants) is possible

▪ System resources are available (work processes, CPUs)

Potential problems:

▪ DB Locks (see next slides)

▪ SAP Enqueues (see next slides)

▪ High system load is generated on application server and database server

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 79


GSS Performance Optimization – Follow-up
Areas of technical performance tuning – Database Locks

Scenario: Post the Goods Issue for 1000


deliveries between 8 and 9 am. 8am 9am 10am 11am

‘The Number Range Problem’


- All jobs require a new number from the
number range object for their material
document.
- First job locks the record and remaining
jobs have to wait for it to be released

Database
NRIV
RF_BELEG 12345678

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 80


GSS Performance Optimization – Follow-up
Areas of technical performance tuning – Database Locks (continued)

Solution: (General)

▪ Avoid DB Locks or try to minimize the critical path

Solution: (Example)

▪ Number range buffering

Remarks:

▪ DB Locks cannot be avoided in every case

▪ Efficient coding of the application can reduce DB Locks

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 81


GSS Performance Optimization – Follow-up
Areas of technical performance tuning – SAP Enqueue

Scenario: Post the Goods Issue for 1000


deliveries between 8 and 9 am. 8am 9am 10am 11am

‘The Material Lock Problem’


- All jobs have to lock the same
material/plant during the creation of their
material document.
- First job locks the record in exclusive
mode and remaining jobs have to wait for
it to be released
SAP ERP
Enqueue table
001PLANT
Excl MARC
BMAT

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 82


GSS Performance Optimization – Follow-up
Areas of technical performance tuning – SAP Enqueue (continued)

Solution: (General)

▪ Avoid conflicts on SAP Enqueues

Solution: (Example for Goods Movements)

▪ Activate Late Locking (transaction OMJI)

▪ No parallel processing for materials of the same plant

Remark:

▪ Efficient coding of the application can reduce conflicts on SAP Enqueues

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 83


GSS Performance Optimization – Follow-up
Areas of technical performance tuning – Workload Distribution

Scenario: There are certain jobs which


have to be executed. There are jobs 8am 9am 10am 11am
(Order Entry, Delivery Due, Billing Due)
Order Entry
with a high priority and others with a
low priority Delivery Due
Billing Due
‘The Scheduling Problem’
- The high priority jobs have to run at FI Reporting
a fixed time Sales Reporting
- The low priority jobs running in
MRP Run
parallel to high priority (Bottlenecks)
- The low priority jobs running MRP Run
outside the critical time window
Sales
(Bottlenecks avoided) Reporting
FI Reporting

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 84


GSS Performance Optimization – Follow-up
Areas of technical performance tuning – Workload Distribution (continued)

Prerequisites:

▪ Business allows a better schedule - there are no time requirements for the low priority jobs

Remark:

▪ The scheduling problem belongs to Application Operations. There are business and
technical requirements which might lead to conflict situations

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 85


GSS Performance Optimization – Follow-up
Areas of technical performance tuning – Database Server versus Application Server

A distributed system consists of one database server and


several application servers. The database server is shared by
all application servers.

Problem: The database server can become overloaded. The Database


first priority of the DB server is to run the database system

Solution: (General)
App 1 App 2 App 3
▪ You can add application servers if they are required

▪ You can distribute the workload over the different servers

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 86


GSS Performance Optimization – Follow-up
Areas of technical performance tuning – Shared Resources

A distributed system consists of one database server and


Database
several application servers

Problem: Bottlenecks due to exhaustion of shared resources


App 1 App 2 App 3
Solution: (General)

▪ Depending on the load situation a separation of database Addition:


server and SAP central instance should be considered.
Central Instance
Especially if the Enqueue Service is critical in high load
situations Enqueue,
Message,
Update Services

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 87


GSS Performance Optimization – Follow-up
Areas of technical performance tuning – Tuning by Hardware Extension

If all other tuning methods cannot solve the


performance problems, a hardware extension might
help – scaling up or scaling out

Database
Remark:

▪ Scaling up adds more resources to the existing


servers App 1 App 2 App 3 Hardware
Extension:
▪ Scaling out adds more servers. CPUS
Memory
▪ Scaling out can be done on both the application
server and the database server layers.

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 88


GSS Performance Optimization – Follow-up
Areas of technical performance tuning – Customer Specific Coding

Many performance problems are caused by inefficient Programs


coding of customer specific code
Customer Programs

Customer specific coding includes customer programs, user


exits and modifications in SAP programs SAP Standard Programs

User Exits
Solution:
Customer
Modifications
▪ Performance Tuning of ABAP Coding and SQL
Statements

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 89


GSS Performance Optimization – Follow-up
Areas of technical performance tuning – System performance vs. transactional performance

Problem: System Bottlenecks


System bottlenecks may cause long-
running programs Hardware:
OR - CPU, RAM, I/O, Network
Long-running programs may cause
Configuration:
system bottlenecks
- Memory/buffer configuration,
Remarks: process configuration

▪ Technical implementation includes


topics such as Database indexes, table Long-running Programs
buffering, ABAP coding. Unnecessary functionality
▪ Logical implementation relates to the Non-optimal Implementation
non-optimal use of SAP standard - Technical implementation
functionality - Logical implementation
© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 90
Four most common cases for performance analysis
and Analysis Roadmaps
GSS Performance Optimization – Follow-up
Four most common cases for performance analysis

▪ Specific transaction currently performing badly

▪ Specific background job currently performing badly

▪ Specific background job constantly performing badly or even performing worse over
time

▪ Specific transaction constantly performing badly or even performing worse over time

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 92


GSS Performance Optimization – Follow-up
Analysis Roadmap: Specific transaction currently performing badly

Problem Analysis roadmap Typical solutions

Check Cursor Access


Cache in ST04 Statement
⚫ Specify missing
Summary or
key fields in the
Identical Selects
WHERE-clause
of SQL trace
within GSS Perf ⚫ Create new
Use ST12 for
secondary index
SQL trace
Complaint that ⚫ Buffer accessed
Use SM50 or
transaction Yes DB tables
SM66 to find
Identified ⚫ Use ABAP
XYZ is the occupied
DB tables? No buffering
currently instance and
performing bad WP/PID techniques
Use ST12 for
ABAP trace
⚫ Getting rid of
LOOP AT
statements
Use GSS Perf Perform net time Perform gross ⚫ Using binary
for pre-analysis analysis time analysis search for READ
TABLE
statements

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 93


GSS Performance Optimization – Follow-up
Analysis Roadmap: Specific background job currently performing bad

Problem Analysis roadmap Typical solutions

Check Cursor Access


Cache in ST04 Statement
⚫ Specify missing
Summary or
key fields in the
Identical Selects
WHERE-clause
of SQL trace
within GSS Perf ⚫ Create new
Use ST12 for
secondary index
SQL trace
Complaint that ⚫ Buffer accessed
Use SM50 or
background job Yes DB tables
SM66 to find
Identified ⚫ Use ABAP
ABC is the occupied
DB tables? No buffering
currently instance and
performing bad WP/PID techniques
Use ST12 for
ABAP trace
⚫ Getting rid of
Use SM37 (job
LOOP AT
details) to find
statements
the occupied
instance and Use GSS Perf Perform net time Perform gross ⚫ Using binary
WP for pre-analysis analysis time analysis search for READ
TABLE
statements

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 94


GSS Performance Optimization – Follow-up
Analysis Roadmap: Specific background job/transaction performing worse over time

Problem Analysis roadmap Typical solutions

Check Cursor Access ⚫ Specify missing


Cache in ST04 Statement key fields in the
Use ST12 for Summary or WHERE-clause
SQL trace Identical Selects
⚫ Create new
of SQL trace
secondary index
within GSS Perf

Complaint that
background Use ST03N or Increase in Direct/
job ABC/ STAD to check Sequential reads ⚫ Delete/archive
transaction XYZ for amount of data → DVM
is performing processed data
worse over time
Increase in
DB time Use GSS Perf Perform net time
for pre-analysis analysis ⚫ Getting rid of
Use EWA,
ST03 or STAD LOOP AT
to check for Increase in statements
runtime trend CPU time Use ST12 for Perform gross ⚫ Using binary
analysis & time ABAP trace time analysis search for READ
share TABLE
distribution statements

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 95


Key takeaways
Key Takeaways

Issue Identification
▪ Not only reactive – proactive monitoring using EWA/ST03/STAD
ST12 – Trace tool
▪ Central tool used to collect the necessary information needed for analysis
▪ Several methods available depending on the analyzed process
▪ Collects several trace types as well as collecting STAD information
▪ Start manual analysis with an overview and then classify the nature of the performance problem in terms of
which technical components are involved.

Guided Self Service


▪ Guided analysis based on automated data collection and data evaluation

GSS Performance Optimization


▪ Helps to optimize your transactional performance by using SAP Active Global Support application analysis
tools.

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 97


Appendix – some common terms

Acronym Meaning

• ATRA ABAP Trace Runtime Analysis

• ST-A/PI Service Tools for Applications Plug In

• ST-PI Support Tools Plug In

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 98


Thank you.
Contact information: SAP Enterprise Support Academy
Dáithí Mac Lochlainn
Expert Support Engineer
[email protected]
Customer Success
SAP Global Support Centre Ireland

1012 - 1014 Ascaill Choill an Rí


Campas Gnó Iarthar na Cathrach
Bóthar an Náis
Baile Átha Cliath 24
D24 VF5D
Éire
T +353 1 471 7163
Follow us

www.sap.com/contactsap

© 2021 SAP SE or an SAP affiliate company. All rights reserved.


No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of
SAP SE or an SAP affiliate company.
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. National product specifications may vary.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or
warranty of any kind, and SAP or its affiliated companies shall not be liable for errors or omissions with respect to the materials.
The only warranties for SAP or SAP affiliate company 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.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or
any related presentation, or to develop or release any functionality mentioned therein. This document, or any related presentation,
and SAP SE’s or its affiliated companies’ strategy and possible future developments, products, and/or platforms, directions, and
functionality are all subject to change and may be changed by SAP SE or its affiliated companies at any time for any reason
without notice. The information in this document is not a commitment, promise, or legal obligation to deliver any material, code, or
functionality. All forward-looking statements are subject to various risks and uncertainties that could cause actual results to differ
materially from expectations. Readers are cautioned not to place undue reliance on these forward-looking statements, and they
should not be relied upon in making purchasing decisions.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered
trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries. All other product and service names
mentioned are the trademarks of their respective companies.
See www.sap.com/copyright for additional trademark information and notices.
SAP folgen auf

www.sap.com/germany/contactsap

© 2021 SAP SE oder ein SAP-Konzernunternehmen. Alle Rechte vorbehalten.


Weitergabe und Vervielfältigung dieser Publikation oder von Teilen daraus sind, zu welchem Zweck und in welcher Form auch immer,
ohne die ausdrückliche schriftliche Genehmigung durch SAP SE oder ein SAP-Konzernunternehmen nicht gestattet.
In dieser Publikation enthaltene Informationen können ohne vorherige Ankündigung geändert werden. Die von SAP SE oder deren
Vertriebsfirmen angebotenen Softwareprodukte können Softwarekomponenten auch anderer Softwarehersteller enthalten. Produkte
können länderspezifische Unterschiede aufweisen.
Die vorliegenden Unterlagen werden von der SAP SE oder einem SAP-Konzernunternehmen bereitgestellt und dienen ausschließlich
zu Informationszwecken. Die SAP SE oder ihre Konzernunternehmen übernehmen keinerlei Haftung oder Gewährleistung für Fehler
oder Unvollständigkeiten in dieser Publikation. Die SAP SE oder ein SAP-Konzernunternehmen steht lediglich für Produkte und
Dienstleistungen nach der Maßgabe ein, die in der Vereinbarung über die jeweiligen Produkte und Dienstleistungen ausdrücklich
geregelt ist. Keine der hierin enthaltenen Informationen ist als zusätzliche Garantie zu interpretieren.
Insbesondere sind die SAP SE oder ihre Konzernunternehmen in keiner Weise verpflichtet, in dieser Publikation oder einer
zugehörigen Präsentation dargestellte Geschäftsabläufe zu verfolgen oder hierin wiedergegebene Funktionen zu entwickeln oder zu
veröffentlichen. Diese Publikation oder eine zugehörige Präsentation, die Strategie und etwaige künftige Entwicklungen, Produkte
und/oder Plattformen der SAP SE oder ihrer Konzernunternehmen können von der SAP SE oder ihren Konzernunternehmen jederzeit
und ohne Angabe von Gründen unangekündigt geändert werden. Die in dieser Publikation enthaltenen Informationen stellen keine
Zusage, kein Versprechen und keine rechtliche Verpflichtung zur Lieferung von Material, Code oder Funktionen dar. Sämtliche
vorausschauenden Aussagen unterliegen unterschiedlichen Risiken und Unsicherheiten, durch die die tatsächlichen Ergebnisse von
den Erwartungen abweichen können. Dem Leser wird empfohlen, diesen vorausschauenden Aussagen kein übertriebenes Vertrauen
zu schenken und sich bei Kaufentscheidungen nicht auf sie zu stützen.
SAP und andere in diesem Dokument erwähnte Produkte und Dienstleistungen von SAP sowie die dazugehörigen Logos sind Marken
oder eingetragene Marken der SAP SE (oder von einem SAP-Konzernunternehmen) in Deutschland und verschiedenen anderen
Ländern weltweit. Alle anderen Namen von Produkten und Dienstleistungen sind Marken der jeweiligen Firmen.
Zusätzliche Informationen zur Marke und Vermerke finden Sie auf der Seite www.sap.com/corporate/de/legal/copyright.html.

You might also like