follow me on Twitter |
SAP R/3 Performance Monitoring & TuningHere is a condensed (without the sales hype) analysis of how to make SAP R/3 systems performant. Included are tips on how to analyze, measure, and tune SAP for performance.
valid:
|
|
Enough ABAP Work Processes?ABAP servers have a fixed number of work processes. So make sure that there are enough "unoccupied" work processes (CPU utilization of near zero) on a particular machine by using Transaction SM50 (Process Overview). Click on the CPU column heading to sort by CPU utilization. To monitor work processes on the whole landscape, use transaction SM66 (Global Work Process Overview). By default, abbreviated information is shown (based on ADM special C calls). In Settings unselect "Display only abbreviated information" so that RFC is scheduled to collect detailed data. |
SAP Performance Tuning Strategies
Tuning efforts on SAP systems include:
|
Performance Management at Each Phase of Implementation
Among SAP's Business Blueprint library offerings downloaded from SAP Software Distribution Center on the SAP Service Marketplace (for free with S-User ID) include a reference system as an implementation starting point in the Baseline Package. SAP's AcceleratedSAP (ASAP) project documentation service documents SAP System design project decisions, issue resolution, and configuration changes. Each ASAP Roadmap prescribes activities which group specific tasks producing deliverables. Before SAP Solution Manager, AcceleratedSAP 4.0 contained 350 "accelerators" such as predefined templates and forms for use while performing implementation as well as examples, how-to documents, and descriptive texts such as white papers. Each roadmap organizes tasks within activities within work packages within 5 phases: Those concerned with performance testing would be identifying stakeholders in security and administration to ensure that
Those concerned with performance testing would be identifying application components and utilities.
Those concerned with performance testing would be creating scripts and the framework which make debugging and running scripts efficient.
Those concerned with performance testing would be running performance tests.
Those concerned with performance testing would be monitoring metrics collected from production. The Project Estimator generates project plans during the sales phase that precede all this. SAP's R/3 Info Database (InfoDB) tracks skill levels. | SAP R/3 Implementation with ASAP: The Official SAP Guide (Hardcover) (Sybex Inc., 1998) by Dr. Hartwig Brand of SAP's TCC (Technical Core Competence) Group. SAP Planning: Best Practices in Implementation (Paperback) (Sams; Pap/Cdr edition (May 19, 2003) by George W. Anderson
Implementing SAP With an Asap Methodology Focus (Paperback) (Writers Club Press, July 2002) by Arshad H. Khan
Configuring SAP R/3 FI/CO: The Essential Resource for Configuring the Financial and Controlling Modules (Hardcover) (Sybex; 1st edition, April 15, 2000) by Quentin Hurst and David Nowak SAP ABAP Performance Tuning Tips & Tricks Introduction among SAP Tutorials at thespot4sap |
Major Physical Component ServersThe components for technical tuning are the operating system, the database, the R/3 work processes, R/3 buffers, memory management, and the network, laid out here for each component server of a full SAP system:
Performance problems in large R/3 installations with more than 10 application servers are most often caused by bottlenecks in the database server. Several application servers may belong to a single SAP System (identified by a SID). |
SAP Clients and End-User Terminals
SAPGUI.exe for Windows is the most commonly used client.
SAPGUI for Java a platform-independent implementation uses the DIAG protocol. [_] Set protocol.ora file parameter tcp.nodelay=yes so that packets are streamed onto the network without delay. [_] Reduce memory usage during login by disabling images. Use transaction SM30 and select table SSM_CUST to create a new entry named HIDE_START_IMAGE. Set its value to YES. One way to identify how many users are using the system is to configure and activate SAP Audit Profiles with Tx SM19, then use Tx SM20 to review the mass of data it outputs. | Experts with SAP's "Remote Support" service log onto systems to resolve problems. The multiclient concept of R/3" on SAPnet. |
Server Machines
Each set of servers to run SAP contains several machines:
All hard disk drives would be mirrored. There is a set of these servers for each environment (dev, integration, SCM, functional test, performance test, staging, production, etc.). Java and ABAB each go into their separate application, messaging, and enque servers. In 1998 SAP AG announced a four-tiered client/server architecture that uses an expanded database memory cache SAP calls liveCache that insulates the database from SAP applications and allows for real-time manipulation of database objects in memory.
SAP TransactionsIn the SAP world, a transaction is an operation that lets a user make changes to a database.Each transaction is a sequence of related dialog steps controlled by a dynpro (dynamic program) presenting fields in screens. Its processing logic consists of the PBO (process before output) to screen and PAI (Process After Input) by user. The SAP dispatcher transaction monitor sequences those steps. Transactions operate with locking and commit as a database LUW (Logical Unit of Work) so that related changes either update all as a unit or none at all. Transactions usually contain an interactive phase and an update phase. Load BalancingSAP can be configured automatically to balance the load on the systemSAP's J2EE Engine is activated by the Icman (ICM monitor) service that forwards requests to the J2EE server. Configured in /sap/public/icman and /sap/public/icf_info. and started with SAP Transaction SMICM, "Administration J2EE Server". In Transaction RZ11, set the rdisp/j2ee_start parameter to 1. Icf_info supplies the web dispatcher with information needed for load balancing. The web application server receives both ABAP and Java requests. The web dispatcher forwards requests to the web application server or the J2EE server. A stand-alone Message server is required for each installation. Java installations also require a separate enqueue server. The stand-alone dispatcher for J2EE, dpj2ee, is activated with profile parameter icm/dpj2ee to TRUE. It doesn't require a database, work process, or a SAP gateway. It starts the ICM and the J2EE Engine and connects to the message server.
| Download from SAP’s Developer Network site. SAP Netweaver Performance Forum SAP Forum: Documentation & Guidelines ASUG (American SAP User Group) OraTips published by Andy Klee of Klee Associates, Inc. Sams Teach Yourself SAP in 24 Hours (Sams; 2 edition, November 7, 2005) by George Anderson and Danielle Signorile Larocca Mastering Enterprise SOA with SAP NetWeaver and mySAP ERP (John Wiley & Sons © 2007, 599 pages) by Scott Campbell and Vamsi Mohun SAP NetWeaver For Dummies (John Wiley & Sons © 2004, 414 Hardcopy pages) by Dan Woods and Jeffrey Word
SAP Enterprise Portal: Technology and Programming (SAP PRESS, April 30, 2005, Hardcover) by Arnd Goebel, Dirk Ritthaler
SAP R/3 Handbook, Third Edition (McGraw-Hill/Osborne, 2006, 624 pages) by Jose Antonio Hernandez, Jim Keogh and Franklin Martinez
SAP R/3 Implementation Guide (McGraw-Hill © 1999 (509 pages) by J.A. Hernandez, E.R. Bueno, S.A Servera and J.R.S. Elechiguerra
Testing SAP Solutions (SAP Press, Hardcover, 2007) by Markus Helfen and Hans Martin Trauthwein, both of SAP Test Management Consulting. Michael Lauer is a Senior Quality Specialist in the Product Technology Group at SAP AG. Testing SAP R/3: A Manager's Step-by-Step Guide (Wiley, April 20, 2007) by Jose Fajardo and Elfriede Dustin ABAP Objects: ABAP Programming in SAP NetWeaver (SAP Press, 2007, 1024 pages) by Horst Keller and Sascha Krüger [publisher website] Interactive Electronic Technical Manual (IETM)
|
R/3 Databases
The evaluation version downloadable from SAP comes with SAP's own Max DB database.
Although SAP also supports Microsoft's SQL Server, IBM's DB2 Universal Database,
SAP mandates that the Oracle SID (System IDentifier) (specified in Unix and some other operating systems as ORACLE_SID) always begin with an uppercase "SA" followed by a single alphanumeric digit or a single uppercase alphabetic character (such as "SA9" in the range SA0-SA9 or SAA-SAZ). | SAP Note 327494 recommends settings for MS SQL Server. |
|
R/3 On OracleReorganize MemorySAP encourages a buffer hit ratio of at least 95%.[_] Dedicate a large amount of memory to the DB_BLOCK_BUFFER initialization parameter.
Spread I/O Around[_] Segregate highly volatile tablespaces (such as PSAPSTABD and PSAPBTABD containing main transaction tables VBAP, VBUP, and VBEP) into separate dedicated tablespaces so that they can grow very large over many data files with file striping to balance the load across many disk devices.[_] Create two copies of each target tablespace to allow for COPY TABLE AS SELECT reorganization between them. [_] Dedicate (partition) a separate disk controller for writing the archived redo logs. To that mount point isolate high volumes and write activity with exclusive control.
Size Redo Logs[_] Size redo logs so that they switch no more than once every 30 minutes.[_] Set the LOG_BUFFER initialization parameter large enough to avoid redo log space requests. [_] Buffer tables with many read accesses but with fewer than 100 changes per day. Display table call statistics from the initial screen, Administration > System administration > Monitor > Performance > Setup/Buffers > Buffers > Detail analysis menu > Call statistics. On the next screen, make a selection and choose Enter. Sort the display according to the data records called. Position the cursor on an entry in the column Calls (under DB activity) and choose Sort. The Changes column indicates which tables are being changed most frequently since the system was started.
Size Rollback Segments[_] Rollback segments should be set large enough to avoid "snapshot too old" messages, while containing enough extents. For example, if a 64MB rollback segment is large enough to avoid all "snapshot too old" messages, then allocate the rollback segment with the following code: INITIAL=16M NEXT=16M MINEXTENTS=2Freespace Not Needed In blocksIn its table creation data defintion language (DDL), SAP uses fixed-length CHAR datatypes rather than VARCHAR (variable length character) datatype. This is perhaps not all database vendors do not support it.Oracle provides VARCHAR so that it can store data using the actual size of the field rather than taking up blank space defined to make sure that users don't run out of room on a field. However, because SAP tables are NOT created with VARCHAR datatypes SAP produces large archived redo logs. So it is not uncommon for large SAP databases to archive many gigabytes of information every hour. Also for efficiency, Oracle performs I/O to/from disk in fixed-sized (e.g., 4KB) blocks containing several rows. Oracle accomodates varying actual VARCHAR lengths by reserving a percent of blocks free for expansion as users add more bytes to VARCHAR fields. As of SAP 4.0, SAP tables are defined with PCTFREE=10, which means that 10% of every block is reserved for row expansion. With default 4K blocks, the reserved space will equal 400 bytes (not counting block header space). So any row that has more than 400 bytes in length is likely to encounter much additional I/0 looking for free blocks. Ironically, since SAP does not use VARCHAR datatypes, expansion will never occur and the space is wasted. Furthermore, PCTFREE=10 is not large enough because many SAP table rows are usually quite large (up to 15,775 bytes). Thus, Oracle wastes additional I/O looking for free blocks which are usually too small anyway. It is usually faster for Oracle to extend into new blocks than to reuse existing blocks, which incurs I/O for Oracle to link and unlink blocks to a freelist of where free blocks are available for use.
Therefore, the strategy for SAP is:
[_] Because of large rows and use of LONG RAW within SAP's tables (particularly in the CLU tablespace) increase Oracle's default block size to the largest allowed by the Unix operating systems (8K) would minimize row chaining when the row length exceeds the database block size. user-defined SAP tables begin with the letter "Z". PCTUSEDBurelson [1999, pg. 130] notes that, as of SAP 4.0, SAP delivers all of its tables, regardless of the database block size or the average row length for the table, with PCTUSED=40. This setting means that a block must become less than 40% full before being relinked on the table freelist. The lower the value for PCTUSED, the less I/O the system will have at insert time, and the faster the system can run. A block will be nearly empty before it becomes eligible to accept new rows. As a result, many SAP tables relink blocks onto the freelists, even though there is not enough room on the block to accept a new row.
[_] set PCTUSED so that newly linked blocks have enough room to accept rows. Burelson's pctused.sql script calculates the setting for PCTFREE and PCTUSED as a function of the number of rows to store between I/Os.
Cluster Resequence Tables[_] When SAP table rows are resequenced in the same physical order as the table's primary key index, adjacent rows reside on a cluster of contiguous blocks that Oracle can retrieve together all at once. This situation saves as much as 50% in I/O with some SAP queries.To identify tables that will benefit from resequencing, analyze the SAP primary key indexes (i.e., those that end in a zero) to obtain the clustering factor column in the DBA_INDEXES data dictionary view. Just because a table has many extents does not necessarily mean it's inefficient. Numerous benchmarks have repeatedly demonstrated that extended tables often outperform tables that reside in a single extent. Due to file size limitations in older Unix systems, larger SAP tables must be allocated in two-gigabyte chunks. This means that any SAP tables that are more than two gigabytes must have more than two extents, since Oracle does not permit an extent to span a datafile. Resequencing can be performed one of several ways:
Index OptimizationSAP tables are created with a primary key index (TABLENAME_0). This means that full table index range scans are not needed. This also means that during normal SAP processing does not take advantage of Oracle's parallel query features which make use of SMP (Symmetric Multi-Processors) with multiple "independent" CPUs sharing a common communication bus.
However, SAP applications can take advantage of Oracle Parallel Server (OPS) services,
which enables several Oracle instances to read the same database.
A Distributed Lock Manager (DLM) specific to each hard disk manages access from several CPUs
and transfer data blocks between the buffer caches of each instance.
[_] Create large indexes with tablespaces that are twice as large as the index tree so that the index can be rebuilt in place within the same tablespace. ALTER INDEX index_name REBUILD TABLESPACE tablespace_name PARALLEL 20 UNRECOVERABLE STORAGE (INITIAL new_initial NEXT new_next FREELISTS new_freelist_number)UNRECOVERABLE avoids the overhead of writing to the redo logs, which nearly double the speed. But these indexes need to be recreated after a roll-forward recovery operation.
| Oracle SAP Administration (Sebastopol, Calif.:O'Reilly and Associates, 1999) by Donald K. Burleson is based on SAP R/3 4.0 and Oracle 8i running on Unix machines.
Oracle Database Programming Using Java and Web Services (Amsterdam, Boston: Elsevier, 2006) by Kaussi Mensah. |
Disk Space Utilization Monitoring
|
|
R/3 InstancesTo display all instance parameters, invoke report RSPARAM. Even though it is possible an application server to have more than one, there is usually only one dialog instance on an application server to run the SAP kernel (similar to an Oracle instance) which intercepts requests for work from SAP clients and executes ABAP programs and manages requests for data and services. Each dialog instance contains a dispatcher task and a set of R/3 work processes (WPs). | mySAP Tool Bag for Performance Tuning and Stress Testing (prentice hall, 2006) by George W. Anderson [ read it online]
SAP System Operations (SAP Press, Hardcover, 2004) by Michael Missbach, Ralf Sosnitzka, Josef Stelzel, Matthias Wilhelm
Basis Administration for SAP (Premier Press © 1999, 580 pages) by Robert E. Parkinson, Kay Tailor, Victor Wood and Johan Marneweck |
SAP Server Services (Central Instance) Work Processes
Most generic SAP architecture implementations have numerous application servers, but only a single central instance that manages SAP interfaces. A central instance is a concept unique to SAP. The central instance is a combination of hardware and software. It contains a physical server (the application server) and numerous software components, including a message server, a database gateway (a pre-established connection between SAP and Oracle--or another database), and various update, enqueue, dialog, and spool facility software. These work processes all run in parallel:
The Global Work Process Overview displays: * The status of each application server * The reason why it is not running * Whether it has been restarted * The CPU and request run time * The user who has logged on and the client that they logged on to * The report that is running [_] Indicate the number of update work processes of type V1 and V2 inside the profile parameter file for each instance by specifying parameters rdisp/wp_no_vb and rdisp/wp_no_vb2 |
R/3 Basis System Tunables[_] The number of available work processes per application server should be configured using the SAP system profile parameters values appropriate to hardware capacity and the peak activity anticipated.[_] The number of database buffers should be set for the maximum anticipated number of simultaneously active users.
Shared memory areas (buffers) holding user context data
are available to all Work processes of all applications.
Data there are quicker to access than retrievals from the database.
However, data may be rolled out to the hard disk if not enough memory is available.
[_] Parameter rdisp/wpdbug_max_no specifies the maximum number of work processes that can be run simultaneously in debugging mode.
[_]
Ensure that a large enough size is specified (in bytes) for the
|
Dispatcher Request Que Length and TimeOut[_] Set dispatcher request que length so that there are enough to the calculated total number of requests that may que up (be buffered) during the time it takes for operators to recognize an overflow and the time it takes to add more servers to handle the overflow.The SAP instance profile parameter rdisp/max_wprun_time is the maximum allowed time for interactive execution of a dialog step before the dispatcher stops the work process and issues a TIME_OUT error. It has a default value of 300 seconds (5 minutes). [_] Especially during stress tests, the default client time-out value of 10 seconds needs to be increased. |
Day and Night Op (Operation) ModesThe number and type of work processes (WPs) supported by each application server are controlled by the "op mode" running.
A "night mode" may consist of more batch WPs for batch processes run overnight. Op modes are automatically switched by a SAP background job according to the timetable set by the BASIS administrator. Additionally, different database initialization (Oracle INIT.ORA) files may be used at different times of day:
The night mode has shift memory to support backups and other batch processing. R/3 application server work processes are configured so that each work process handles, on average, 5 to 10 active users (assuming that typical users need around 10 times as long to enter data in the screen and interpret the results as the R/3 System needs to process the user requests.) Reading data from the R/3 buffer in memory is approximately 10 to 100 times faster than reading data from the database server. Global data available to all work processes on the R/3 instance, such as programs, table field definitions, and the contents of Customizing tables are stored temporarily in the buffer. Op modes are established by the SAP system administrator, commonly called the BASIS administrator, |
Web AS Server Instance Profile Configuration
Location of Files
Instance profiles named <SID>_<instancename>_<hostname> are automatically generated by the R/3 setup utility when an instance (dialog or central) is installed. By default, the name assigned to them has the format , Instance type profiles for a particular instance can override system profiles in DEFAULT.PFL. Although the sappad text editor can edit profiles even if the system cannot start, profile maintenance should be performed using SAP R/3 Computer Center Management System (CCMS) transaction RZ10 (Edit Profiles).
sappfpar CHECK pf=C:\SAP\NSP\SYS\profile\NSP_DVEMGS00_BUBBA1
Enter transaction code SMLG or menu Tools > _CCMS > Configuration > _Logon Groups to configure logon groups and their instance servers for Load balancing. This information is used by the SAP logon Windows application on each workstation to decide which system the user logs on to.
Changes to profile parameters take effect after a system restart.
High-level Memory Allocation
Connections[_] Configure the number of users allowed to log on to an instance and the response time threshold for that instance.
[_] Ensure there are enough connections specified with these parameters:
|
|
R/3 Shared Memoryallocated in segments.
|
|
R/3 SAP Buffers in MemoryCommand $TAB resets Table buffers.Command $SYNC resets (in up to one hour) all SAP buffers on the application server. This is issued automatically every time new developed source is transported into a system running tp.
Set the count of entries approriate to its size, since an increase in one may lead to a bottleneck in the other. SAP Cursor Cache (in the shadow process owned by each WP) reduces the number of parsing of SQL statements by storing cursors for SELECT statements to avoid time consuming PREPARE processing. The DBSL (Database SQL Library) creates and maintains statement IDs. Its profile setting of dbs/stmt_cache_size is different for each database (default fixed size of 250), so it should not be changed. The memory space of each entry in the statement cache is allocated dynamically, with a maximum 64KB per entry.
|
|
More on Roll and Paging Buffers (Extended memory)
User session context information is moved around thus:
If ztta/max_memreq_MB is set too low, message SYSTEM_NO_ROLL will be issued. |
|
Benchmark Applications
Settings to avoid distorting measurements:
|
Solution Manager Monitoring
The SAP Solution Manager framework for monitoring and implementing SAP systems. During the configuration and management of the system landscape, SAP Solution Manager can execute ABAP scenarios executable configuration (IMG) files. LoadRunner and Performance Center includes several SAP tools for working with the SAPGUI protocol.
SAPGUI Verify Scripting verifies whether the SAPGUI Scripting API is enabled. To install the Verify Scripting component, run VerifyScripting.exe from the SAP_Tools directory. Verify RFC User determines whether a SAP user specified to connect to the SAP system has permissions to invoke the required RFC functions necessary for working with SAP Diagnostics. To install this component, copy RFCFunctionsCollection.dll from the Verify RFC User directory to your local hard drive. Then register the file by selecting Run from the Windows Start menu and typing:
In the Verify RFC User directory, load AddMTSDestinationsFolder.reg by double-clicking the file and acknowledging the risks. Then run VerifyRFCUser.exe. |
SAP Solution Manager (SAP Press, February 12, 2007) by Matthias Melich LoadRunner obtains statistics from CCMS through (after additional HP licensing) port 8888 on a HP SiteScope server with SAP Java Connector (JCO) installed. |
|
Related Topics:
LoadRunner
SNMP
Rational Robot
Free Training!
Tech Support
| Your first name: Your family name: Your location (city, country): Your Email address: |
Top of Page
Thank you! |