SAP Performance Tuning
SAP Performance Tuning
Architecture
The Architecture level to improve performance
The R/3 System has a three-layer client/server architecture,
With a Presentation layer, an Application layer and a Database layer.
The presentation layer and the application layer are scalable.
This means that if there is a hardware bottleneck, you can extend the system by adding
more
One goal is to reduce the run time of programs on the application server, thereby reducing the
CPU load.
Another goal is to reduce the database load. Reducing the database load is particularly important
since the database software is not scalable.
If the required data is in the R/3 buffers on the application server, accessing them requires
approximately 0.1 milliseconds for each data record.
If the data records are read from the database buffer, around 1 millisecond is required.
When the data is read from the disk, this requires approximately 10 milliseconds for each data
record.
The R/3 table buffers allocate approximately 120 MB (40 MB for single record buffers, 80
MB for generic table buffers).
The data buffers of the database use around 500 MB of memory. The database on the disks
can reach a size of several terabytes.
The data transfer between front end and application server occurs in blocks of 2 KB.
The transfer between application server and database server occurs in blocks of up to 32
KB.
Work process
From presentation server
Application server
Dispatcher
Dispatcher
Queue
Work Process
WP
WP
WP
WP
Roll area
To DB server
General Definitions
Response time:
Time from the receipt of a user request to the sending of a response ( measured on the application
server; does not include network time between the presentation server and the application server).
Dispatcher wait time: Time spent by the user request in the dispatcher queue.
Roll-in: Time required to roll the user context in to the R/3 work process.
Load time: Time required for loading and generating R/3 Repository or ABAP Dictionary objects.
Processing time: = response time - dispatcher wait time - roll-in - roll-out - load time - database
time enqueue time - roll wait time
Enqueue time:
Time from sending an enqueue request to the R/3 enqueue server to the receipt of the results
Definitions
Database time: Time from sending an SQL statement to the receipt of the results (measured on the
application server; includes network time between the application server and the database server).
Roll wait time: Time in which the user context is rolled out of the work process pending response
to an RFC call.
Roll-out: Time required to roll the user context in to the roll buffer.
CPU time: Time spent by the CPU in processing the transaction step (measured by the operating
system; not an additive component of the response time).
ST 03
DB 01
SM 50
Standard Tables :
Used generally . Can be sorted
Sorted Tables
Sorted automatically based on key
Hashed Tables
Used when I record is to be retreived . Good in performance . Work based on hash
Key
SQL Trace
ST05 Components
SQL Trace
Buffer Trace
Enquee Trace
RFC Trace
The goal of using an SQL Performance Trace is to find SQL statements with a high
optimization potential. Use three user sessions.
One user session is for the trace list, one for the compressed summary, and one for
identical selects.
From the trace list you can access Explain SQL or the ABAP code.
An expensive SQL statement is indicated when a database operation takes longer
than 200,000 milliseconds, or when more than 10 FETCHes are required for a
database operation.
In addition, a series of SQL statements that are similar in structure usually indicate
nesting that can be optimized considerably. If the sum of SQL statements that are
similar in structure take more than 200,000 milliseconds, they can be regarded as
expensive.
Binary Search
ZPR_PER_T1
REPORT
ZPR_PER_T1
TABLES : VBAK .
TABLES : VBAK .
Data
data
Not Recommended
Recommended
REFRESH TAB_DEST.
LOOP AT TAB_SRC INTO TAB_DEST.
APPEND TAB_DEST.
ENDLOOP
TAB_DEST[ ] = TAB_SRC[ ].
Aggregate Function
Not Recommended
Recommended
Refresh: itab_flight.
Refresh: intab_flight.
Append intab_flight.
Clear intab_flight.
Endselect.
Not Recommended
Loop at int_fligh.
If int_fligh-flag is initial.
Int_fligh-flag = X.
Endif.
Modify int_fligh.
Endloop.
Recommended
Int_fligh-flag = X.
Modify int_fligh
transporting flag where
flag is initial.
1.
2.
3.
4.
5.
6.
7.
8.
9.
11.
12.
13.
14.
15.