Showing posts with label Performance Improvement. Show all posts
Showing posts with label Performance Improvement. Show all posts

Friday, January 20, 2012

System Performance Analysis Transaction Codes

Here are some transaction codes I find useful when checking for performance related issues in a system:
Depending on the issue, I start with ST05 with all trace options (SQL, Enqueue, RFC, Buffer) active with a very small time frame where data is captured so as not to have more than +-2000 records.
I then compare the results with an identical capture of the same process and time frame using standard SAP.
With both recordings I activate the extended results, which gives times for each execution. Permitting one to easily see the time differences between the executions. These results should point you in the right direction.
Here are the transaction codes I find useful in this analysis:
  • SM21 – System Log
  • ST03N - R3 Workload statistics
  • ST03G - Global System Workload Analysis
  • STAD - Statistical Records
  • STATTRACE - Functional Trace
  • ST05 - Performance Trace (SQL, Enqueue, RFC, Buffer)
  • SLIN - ABAP Program Syntax Check
  • SE30 - ABAP Runtime Analysis

Measure specific portions of ABAP Runtime

Most people know about SE30 which can be used to do an ABAP runtime analysis. However did you know that you are able to dynamically call the runtime analysis for a portion of source code for example a section of a user exit, or for a specific function module?
This is easily done by changing the user variant as follows:
  1. Open SE30
  2. On Measurement restrictions (1/2 way down the page) create/change your user defined variant.
    1. Within the variant under program parts, select the “particular Units” check box and save.
Now from within SE38 for the code you wish to measure – set your breakpoint for the position from which you  wish to measure and another for the position to which you wish to measure.
Go back to SE30 and execute your code when you reach the breakpoint activate the runtime analysis from System–>Utilities–>Runtime Analysis –> Switch On.

Run through the code by selecting F8.

When you reach your end point de-activate the analysis by selecting System–>Utilities–>Runtime Analysis –> Switch Off.

TIP: You can activate the runtime performance analysis start by entering the command prompt code /RON in the transaction box. You can de-activate the analysis by using the command prompt code /ROFF.

NOTE: If you get the message “The Particular “units” option is not selected – S7100.  It means you are not using your new changed default user variant for the execution.

What to use to measure performance improvement?

You know of ST05, ST01 and SE30. But do you know why you would use one transaction code and not the other? What are the main purposes of each one when it comes to performance improvement and measurement?

To measure and improve performance of ABAP programs – Use SE30 to measure:
  • Excessive or unnecessary use of modularization units
  • CPU-intensive program functions
  • User-specific functions that could be replaced with ABAP statements
  • Inefficient or redundant database access.
In addition you may want to analyze or fine-tune a program’s database accesses – Use ST05 to measure:
  • Database accesses (SQL trace)
  • Table buffers
  • RFC calls
  • Lock operations (client side)
If you wishto fine tune the system – use ST01 to measure:
  • Authorization checks
  • Kernel functions
  • Kernel module
In addition ST01 encompasses the majority of the functionality of ST05.