03 Perf Analysis
03 Perf Analysis
Performance Management
Confidential
Performance Management
Purpose
Review proactive performance management procedure
Review reactive performance management procedure
Key Issues
Responsibilities
Response times
Proactive performance management procedures
Reactive performance management procedures
Active Users
Avg. Response Time in Dialog Task
Max. Dialog Steps per Hours
Avg. Response Time at Peak Dialog Hour
Strategy:
(a) Find system-wide throughput bottlenecks and their causes
(b) Find non-optimal program implementation
Method:
Analyze response times with Workload Monitor (Transaction ST03) and other
relevant monitors
Goal: Goal:
Avoid unnecessary workload by
Distribute the given workload optimally to
optimised programs and optimal usage of
avoid performance bottlenecks
applications
Responsible persons:
Responsible persons:
Technical team leader
ABAP developers
System/database administrator
Application consultant
Technical consultant
System/database administrator
Technical consultant
LAN/WAN
LAN
...
Network
Database
Layer
Presentation
Layer
Network
Wait queue Dispatcher Application
(memory)
Layer
Work process
Roll buffer Roll memory
Roll-in time
Extended ...
memory
Roll file
Network
Database
Layer
Presentation
Layer
Network
Wait queue Dispatcher Application
(memory) Layer
Work process
Roll buffer Roll memory
Extended ...
memory Database
interface
Database time
Roll file
Network
Database Database
process Layer
Database
buffers
© 2014 SAP SE or an SAP affiliate company. All rights reserved. Confidential 13
Dialog Step: Access to SAP Buffers
Presentation
Layer
Network
Wait queue Dispatcher Application
(memory) Layer
Work process
Roll buffer Roll memory
Roll file
Network
Database Database
process Layer
Database
buffers
Presentation
Layer
Network
Wait queue Dispatcher Application
(memory) Layer
Work process Response time
Roll buffer Roll memory
Roll file
Network
Database Database
process Layer
Database
buffers
Presentation
Layer
Network
Wait queue Dispatcher Application
(memory) Layer
Work process
Roll buffer Roll memory
Roll out time
Extended ... SAP shared pool buffers
memory Database
interface
Roll file
Network
Database Database
process Layer
Database
buffers
Presentation
Layer
Network
Wait queue Dispatcher Application
(memory) Wait time Layer
Work process Response time
Roll buffer Roll memory
Roll-in time
Extended ... SAP shared pool buffers
memory Database
interface
Presentation
Layer
Network
Wait queue Dispatcher Application
(memory) Layer
Work process
Roll buffer Roll memory
ABAP processing CPU time
Extended memory ... SAP shared pool buffers
Database
interface
Roll file
Network
Database Database
process Layer
Database
buffers
© 2014 SAP SE or an SAP affiliate company. All rights reserved. Confidential 18
Workload Statistics (1)
CPU time
Network
Network
Wait Roll Load Processing time Database time
time in time
Response time
Presentation
Application Server Database Server
Server
Top time Transaction profile Time profile Memory profile Accounting profile
Instance
SAP System TCC First record 10:11:06
Server pswdf727 Last record 10:30:55
Workload
Database calls 101.567
Dialog steps 5.314 Database requests 783.302
Av. CPU time 147,9 ms Time per database request 1,4 ms
Av. response time 657,3 ms Roll-in time 25,6 s
Av. wait time 89,9 ms Roll-out time 26,2 s
Av. load time 80,5 ms Roll wait time 152,5 s
Av. roll time 4,8 ms Roll-ins 4.352
Av. database req. time 207,6 ms Roll-outs 4.164
Task types
Current Dialog Others Total Update Background
CPU time
Network
Network
Wait Roll Load Processing time Roll Database time
time in time time
Response Time
Roll Roll Roll
Presentation in
Server Applicationout
Server wait Database Server
Large load time Program buffer, CUA buffer, or screen buffer too small
10:19 VA01 SAPMV45A SAP_PERF 3.037 5.347 0 1.141 909 480 63,2
10:19 VA01 SAPMV45A SAP_PERF 19.190 5.347 0 1.188 797 7.945 63,2
10:19 VA01 SAPMV45A SAP_PERF 867 1.318 266 78 9 318 32,7
Process Overview
Process Program User session Edit Goto System Help
? Reason: “CPIC”?
Problems with CPIC connections such as "All work processes blocked in destination
? system"?
© 2014 SAP SE or an SAP affiliate company. All rights reserved. Confidential 31
Operating System Monitor
Buffer Hit rat. Allocat. Free Spc. Dir. size Free dir Swaps DB
[%] [KB] [%] Entries [%] access
Nametab(NTAB)
Table defin. 92,76 5.043 98,93 30.000 98,92 0 391
Field descr. 94,02 3.348 7,91 60.001 89,36 520 403
Short NTAB 88,99 4.848 99,40 60.001 99,82 0 108
Initial rec. 85,54 6.348 97,28 60.001 99,69 0 186
Tables
Generic key 98,67 48.828 93,79 10.000 99,00 0 117
Single rec. 56,01 30.000 99,51 500 96,20 0 0
Process Overview
Process Program User session Edit Goto System Help
Top time Transaction profile Time profile Memory profile Accounting profile
Instance
SAP System TCC First record 10:11:06
Server pswdf727 Last record 10:30:55
Workload
Database calls 59.667
Dialog steps 2.376 383.302
Database requests
Task types
Buffer Hitrat. Allocat. Free Spc. Dir. size Free dir Swaps DB
[%] [KB] [%] Entries [%] access
Nametab(NTAB)
Table defin. 99,76 5.043 98,93 30.000 98,92 0 391
Field descr. 98,02 3.348 97,91 60.001 99,36 0 403
Short NTAB 98,99 4.848 99,40 60.001 99,82 0 108
Initial rec. 98,54 6.348 97,28 60.001 99,69 0 186
Program 76,06 111.250 38,87 13.750 96,10 15.186 2.613
CUA 95,56 5.000 94,22 2.500 98,04 0 49
Screen 95,92 9.766 99,57 4.500 99,13 0 40
Calendar 100,00 488 84,31 200 49,50 0 101
Tables
Generic key 98,67 48.828 93,79 10.000 99,00 0 117
Single rec. 56,01 30.000 99,51 500 96,20 0 0
Export/import 4,35 4.096 98,92 5.000 99,56 0 0
Programs are swapped out, and the reloads cause increasing buffer fragmentation
Contents:
Objectives:
User context
Memory attached to individual users, for:
WP
Variables, lists, internal tables
Administrative data (such as authorizations)
Server
Virtual memory
Physical
memory Operating system paging file* =
operating system swap space
physical memory +
operating system swap space
* Do not confuse with R/3 paging !
1:1
Local work process memory is for:
Work Work Work
Executables process process
...
process
Data, stack
Buffer for database transfer
Local roll area
Local paging area
© 2014 SAP SE or an SAP affiliate company. All rights reserved. Confidential 46
R/3 Memory II: R/3 Buffers
Shared memory is
Server
associated with
Virtual memory
all the processes of
Shared memory Local memory one instance
R/3 buffers
1:n
Work Work Work
...
process process process
R/3 buffers contain global objects for all users and
work processes, such as programs, and
Customizing tables
Server
Virtual memory
Shared memory Local memory
Extended
memory
1:n
Extended memory contains Work Work Work
...
user contexts – that is, objects process process process
Server
Virtual memory Allocated on demand
Shared memory Local memory
Heap memory
Allocated at instance start (temporary)
1:1
Heap memory:
Work Work Work
Contains user contexts, for ...
process process process
example, when extended
memory is full
Is allocated and released
on demand
Server
Virtual memory
Shared memory Local memory
Roll buffer
1:n
R/3 roll file Work Work ... Work
process process process
Roll memory contains the initial part of
user contexts
R/3 paging
buffer
1:n
Work Work Work
process process ... process
R/3 paging file
Server
Virtual memory
Shared memory Local memory
R/3 buffers
(programs, tables) Heap memory
Roll buffer (temporary)
Extended memory
R/3 Paging (user contexts)
buffer Local Local ... Local
memory memory memory
1:1
1:n
R/3 roll Work Work ... Work
file R/3 paging process process process
file
Extended memory
Heap memory
Roll memory
1 2 3 4
R/3 user R/3 user R/3 user R/3 user
Dialog Dialog
work work
Data Data
process 1 for user 1 for user 3
process 2
1 2 3 4
R/3 user R/3 user R/3 user R/3 user
Dialog Dialog
work work
Data Data
process 1 for user 1 for user 3
process 2
1 2 3 4
R/3 user R/3 user R/3 user R/3 user
Exit
Dialog Dialog
work work
Data
process 1 for user 3
process 2
Data
for user 1
1 2 3 4
R/3 user R/3 user R/3 user R/3 user
Dialog Dialog
work work
process 1 Data process 2
for user 1
Data
for user 3
1 2 3 4
R/3 user R/3 user R/3 user R/3 user
1 2 3 4
R/3 user R/3 user R/3 user R/3 user
Paging buffer
Paging file
1 2 3 4
R/3 user R/3 user R/3 user R/3 user
Dialog Dialog
work Roll Roll work
process 1 area area process 2
Paging Paging
area area
Extended
memory
(shared)
Swap
© 2014 SAP SE or an SAP affiliate company. All rights reserved. Confidential 61
Allocation Concepts – Summary (1)
- Each work process must be capable of loading the user context data for
successive frontend users
The roll data and paging data is copied to the roll buffer and paging
buffer and the corresponding files when a user leaves the work
process.
R/3 extended memory uses mapping instead of copying and therefore allows:
1 2 3 4
R/3 user R/3 user R/3 user R/3 user
Dialog
Roll
work
1st : A defined initial portion of the roll
area
process 2
Paging
area is used area
Extended
memory
(shared)
1 2 3 4
R/3 user R/3 user R/3 user R/3 user
Dialog
Roll work
2nd : Extended memory is used
area process
2
until ... Paging
area
Extended
memory
(shared)
1 2 3 4
R/3 user R/3 user R/3 user R/3 user
Dialog
Roll work
... the extended memory is full area process
or ... 2
Paging
area
Extended
memory
(shared)
1 2 3 4
R/3 user R/3 user R/3 user R/3 user
Dialog
Roll work
area process 2
... until the user quota is reached
Paging
area
Extended
memory
(shared)
1 2 3 4
R/3 user R/3 user R/3 user R/3 user
Dialog
Roll
work
area
3rd: The rest of the process 2
roll area is used Paging
area
Extended
memory
(shared)
1 2 3 4
R/3 user R/3 user R/3 user R/3 user
Roll Dialog
area work
4th: The system is forced process 2
to use local heap memory Paging
area
Heap
memory
Extended
memory
(shared)
1 2 3 4
R/3 user R/3 user R/3 user R/3 user
Dialog Dialog
work Roll Roll work
process 1 area area process 2
Paging Paging
area area
Heap
memory
Extended
memory
(shared)
Swap
© 2014 SAP SE or an SAP affiliate company. All rights reserved. Confidential 71
Heap Memory and PRIV Mode (2)
1 2 3 4
R/3 user R/3 user R/3 user R/3 user
Dialog Dialog
Roll Roll
work area area work
process 1 process 2
Paging Paging
area area PRIV mode
Heap
memory
(local)
Extended
memory
(shared)
Swap
© 2014 SAP SE or an SAP affiliate company. All rights reserved. Confidential 72
Allocation Sequence for Dialog WPs – Overview
Extended memory Heap memory
Roll memory Roll memory:
up to up to
up to remainder of
ztta/roll_extension abap/heap_area_dia
ztta/roll_first ztta/roll_area
or EM exhausted or HM exhausted
Time
Local
memory
Shared
memory
The memory allocation strategy for dialog work processes aims to prevent work
processes from allocating R/3 heap memory and thus entering PRIV mode.
When a work process enters PRIV mode, it remains connected to the user until the
user ends the transaction.
New strategy
for non-dialog
work processes and Extended memory Heap memory
Roll memory Roll memory:
ongoing strategy for up to up to
up to Remainder of
ztta/roll_extension abap/heap_area_dia
dialog work ztta/roll_first ztta/roll_area
or EM exhausted or HM exhausted
processes
Previous
strategy for
Heap memory
Extended memory
Roll memory
non-dialog work up to up to
up to
processes abap/heap_area_nondia ztta/roll_extension
ztta/roll_area
or HM exhausted or EM exhausted
Local Time
memory
Shared
memory
© 2014 SAP SE or an SAP affiliate company. All rights reserved. Confidential 76
Next Topic in Unit
1 2 3 4
R/3 user R/3 user R/3 user R/3 user
Roll Roll
Work Work
area Heap memory is released area
process 1 process 2
Paging after use Paging
area area
{ Heap
memory
Extended
memory
(shared)
Swap
© 2014 SAP SE or an SAP affiliate company. All rights reserved. Confidential 78
Freeing Heap Memory (2)
1 2 3 4
R/3 user R/3 user R/3 user R/3 user
{ Heap
memory
Extended
memory
(shared)
Swap
© 2014 SAP SE or an SAP affiliate company. All rights reserved. Confidential 79
Freeing Heap Memory (3)
1 2 3 4
R/3 user R/3 user R/3 user R/3 user
Extended
memory
(shared)
Swap
© 2014 SAP SE or an SAP affiliate company. All rights reserved. Confidential 80
Parameter ABAP/HEAPLIMIT
Memory / swap space
Restart
of WP 1
abap/heap_area_dia
abap/heap_area_total ztta/roll_extension
Extended
memory
(shared)
em/initial_size_MB
Check R/3 memory configuration in the Setups/Tune Buffers monitor (Transaction ST02)
Current parameters:
Mode list:
Workload Monitor (Transaction ST03) for all task types dialog, and update
For programs with a lengthy database time, in ST03, choose Statistics records
? Do the statistics records indicate changes to buffered tables (with Note: Tables were
saved in the table buffer)?
Analyze table buffering using Table Call Statistics (Transaction ST10)
Analyze SQL statements using an SQL trace (Transaction ST05)
Stop or redistribute
? High paging rate (> 20% of RAM per hour)?