system performance tuning
TRANSCRIPT
1
ALM160
System Performance Tuning for Beginners
Performance and Scalability, SAP AG
Disclaimer
The information in this presentation is confidential and proprietary to SAP and may not be disclosed without the permission of SAP. This presentation is not subject to your license agreement or any other service or subscription agreement with SAP. SAP has 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's strategy and possible future developments, products and or platforms directions and functionality are all subject to change and may be changed by SAP at any time for any reason without notice. The information on this document is not a commitment, promise or legal obligation to deliver any material, code or functionality. This document is provided without a warranty of any kind, either express or implied, including but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. This document is for informational purposes and may not be incorporated into a contract. SAP assumes no responsibility for errors or omissions in this document, except if such damages were caused by SAP intentionally or grossly negligent
© SAP AG 2009. All rights reserved. / Page 2
were caused by SAP intentionally or grossly negligent.
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, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.
2
1 Introduction to Performance Monitoring of AS ABAP and AS JAVA
Agenda
1. Introduction to Performance Monitoring of AS ABAP and AS JAVA
2. Hardware2.1. AS ABAP2.2. AS JAVA
3. Database3.1. AS ABAP3.2. AS JAVA
4 Application
© SAP AG 2009. All rights reserved. / Page 3
4. Application4.1. AS ABAP4.2. AS JAVA
5. Conclusion
Strategy for Performance Analysis and Optimization
Blockwise analysis: Top downUse monitoring tools for bottleneck analysisBroad, global scopeImproves the situationQuick
Program-independent procedure System Analysis
© SAP AG 2009. All rights reserved. / Page 4
HardwareDatabase
ApplicationCommunication
3
Performance-Relevant Components of NW Double Stack Installation
WebDynproWebDynpro
SAP Web Dispatcher
HTTP, SOAPHTTP
SAPGUI
DIAG
Application Server ICM
Java ABAP
Workprocess
HTTP, SOAP
RFC
ABAP Dispatcher
Globalbuffers &caches
Sharedmemory &buffersServer
node
JCo
© SAP AG 2009. All rights reserved. / Page 5
p
DBMS
Database
DB WP
JCo
DB WP
DB WP
DB WP
node
Applications are usually deployed as ABAP only and Java only. Dual stack is used in BI and PI.
Most Commonly Used Tools and Monitors –AS ABAP
Area System-Wide Single-User
HardwareApplication server OS06 (ST06), OS07
Database
Browser
ICMABAP dispatcherGW DatabaseGeneral DBACOCKPIT
DB accesses ST10 ST05, STAD
ApplicationShared memory & buffers ST02, SHMM
ABAP runtime SAT (SE30)
User memory analysis SM04 S_MEMORY_INSPECTOR
Work process overview SM50, SM66
Workprocesses
ICM
Shared memory and buffers
AS ABAP
ABAP dispatcher
Central services
Message server
Enqueue server
GW
© SAP AG 2009. All rights reserved. / Page 6
Work process overview SM50, SM66
Workload analysis ST03N STAD
Enqueue monitoring SM12 ST05
CommunicationHTTP traffic SMICM, ST03G SMICM
Remote Function Calls ST03N ST05
Database(ABAP schema)
4
Most Commonly Used Tools and Monitors –AS JAVA
Area JAVAHardware
Application server OS06 (ST06), OS07, SAP MC
Database
Browser
ICMcluster managerGWGeneral DBACOCKPIT, DB02 (Java schema)
DB accesses NWA: Open SQL Monitors, Wily Introscope, SAP JVM Profiler
Application
Global Buffers and Caches SAP MC, NWA: Open SQL Monitors
JAVA runtime Wily Introscope, SAP JVM Profiler
User memory analysis SAP JVM Profiler
Server nodes / thread NWA: Operations Management, SAP MC
servernodes/threads
ICM
Global Buffers and Caches
AS Java
cluster manager
Central services
Message server
Enqueue server
GW
© SAP AG 2009. All rights reserved. / Page 7
overviewp g ,
Workload analysis Wily Introscope
Enqueue monitoring NWA: Open SQL Monitors, SAP MC
Communication
HTTP traffic HTTPwatch, NWA, SAP MC
Remote Function Calls NWA, SAP JVM Profiler, Wily Introscope
Database(Java schema)
1 Introduction to Performance Monitoring of AS ABAP and AS JAVA
Agenda
1. Introduction to Performance Monitoring of AS ABAP and AS JAVA
2. Hardware2.1. AS ABAP2.2. AS JAVA
3. Database3.1. AS ABAP3.2. AS JAVA
© SAP AG 2009. All rights reserved. / Page 8
4. Application4.1. AS ABAP4.2. AS JAVA
5. Conclusion
5
Helpful Information from the Operating System Monitor – AS ABAP (HW)
For a detailed analysis, there are dedicated monitors
No. of CPUsCPU utilization ratio
Free memory & paging
Disk utilization, response times, queue length
Network utilization/errors
© SAP AG 2009. All rights reserved. / Page 9
Helpful Information from the Operating System Monitor – AS JAVA (HW)
OS information also available in SAP MC
© SAP AG 2009. All rights reserved. / Page 10
URL: http://<hostname>:5<SysNr.>13
6
1 Introduction to Performance Monitoring of AS ABAP and AS JAVA
Agenda
1. Introduction to Performance Monitoring of AS ABAP and AS JAVA
2. Hardware2.1. AS ABAP2.2. AS JAVA
3. Database3.1. AS ABAP3.2. AS JAVA
© SAP AG 2009. All rights reserved. / Page 11
4. Application4.1. AS ABAP4.2. AS JAVA
5. Conclusion
DBACOCKPIT: Situation on the Database, Utilization, Disk I/O – AS ABAP (DB)
DBMS specific – Some common checks for OLTP systems
Data buffer quality: 96% - 98% Catalog (meta data) cache quality: >= 99-100%Full table scans = 0Sort operations on disk = 0Number of rollbacks = 0Deadlocks = 0
SQL Cache/Statement
Data Buffer quality
Catalog Cache quality
© SAP AG 2009. All rights reserved. / Page 12
SQL Cache/Statement Analysis
Locks or exclusive waits
Catalog Cache quality
7
please note:choose the Java schema to get the appropriate figuresIn double stack
DBACOCKPIT: Situation on the Database, Utilization, Disk I/O – AS JAVA (DB)
In double stack installations AS JAVA and AS ABAP run on the same DB (therefore figures in DBACOCKPIT are “shared”)Usability and interpretation of figures is identical to
© SAP AG 2009. All rights reserved. / Page 13
figures is identical to old ST04
DBACOCKPIT: Problem Analysis on Database, Monitors for Performance – AS ABAP (DB)
Different tools for different problem areas available, e.g.
SQL Locks
SQL Performance
© SAP AG 2009. All rights reserved. / Page 14
etc. …
8
NWA > Open SQL Monitors: Lock Overview –AS JAVA (DB)
© SAP AG 2009. All rights reserved. / Page 15
http://<hostname>:<port>/nwaNWA Problem Management Database Open SQL Monitors Native DB Monitors Show Current Exclusive Lock Wait Situations
Trace can be activated per each application server onlyOnly one trace “in
ST05: SQL Trace –AS ABAP (DB)
Only one trace in parallel”New: also call stack available
© SAP AG 2009. All rights reserved. / Page 16
9
Trace can be activated per each server nodeAlso call stack available
Open SQL Monitors: Tracing SQL Accesses to the DB – AS JAVA (DB)
© SAP AG 2009. All rights reserved. / Page 17
1 Introduction to Performance Monitoring of AS ABAP and AS JAVA
Agenda
1. Introduction to Performance Monitoring of AS ABAP and AS JAVA
2. Hardware2.1. AS ABAP2.2. AS JAVA
3. Database3.1. AS ABAP3.2. AS JAVA
© SAP AG 2009. All rights reserved. / Page 18
4. Application4.1. AS ABAP4.2. AS JAVA
5. Conclusion
10
ST02: Tune Summary on Application Server –AS ABAP (APP)
BuffersThere must be no swaps on SAP buffers
check free space and free directory entriesConstant number of database accesses (steady state)No invalidations (not counted as swaps!)
© SAP AG 2009. All rights reserved. / Page 19
ST02: Table Call Statistics (directly via ST10) – AS ABAP (APP)
Buffer State = valid Optimal: No invalidationsAcceptable: Ratio of invalidations to reads is <1% (◄)
◄
© SAP AG 2009. All rights reserved. / Page 20
◄
11
ST02: Tune Summary, Memory Quality –AS ABAP (APP)
SAP memory = User contextsMaxUse < In MemAutoextend on some OS up to em/max_size_MBWindows, Linux 32bit
CheckUse SM04 to determine the top memory consumers observe growth, may be memory leak"Old sessions" adjust timeout parameter for user or plugins
© SAP AG 2009. All rights reserved. / Page 21
NWA: Buffer and Cache Status (1) –AS JAVA (APP)
Cached system tablesBuffer type „single“ or „full“
URL http://<hostname>:<port>/nwaProblem Management Database Open SQL Monitors
© SAP AG 2009. All rights reserved. / Page 22
12
NWA: Buffer and Cache Status (2) –AS JAVA (APP)
Take care of free sizeCache efficiencyNumber ofNumber of modifications
© SAP AG 2009. All rights reserved. / Page 23
NWA > Open SQL Monitors: Table Call Statistics – AS JAVA (APP)
Interpretation of figures is identical to ST02/ST10
© SAP AG 2009. All rights reserved. / Page 24
p gTake care of selects, inserts, updates and deletesNo buffer states
13
SAP MC: GC History –AS JAVA (APP)
SAP Systems SID Instance AS Java GC History
© SAP AG 2009. All rights reserved. / Page 25
Exercise on Checking the System Status –AS ABAP
Logon to the system and find outHow many CPUs and how much main memory the server hasHow much free memory the server has
15 min
Which of the previous days showed the highest CPU usage
The size of the data buffer of the database and the buffer quality
How many users are currently working on the application server(s)Which user allocates most memoryWhether there are any problems with the SAP buffers
© SAP AG 2009. All rights reserved. / Page 26
14
Exercise on Checking the System Status –AS JAVA
Logon to the NWA and start SAP MC and find outHow many Java server nodes are running in the Java clusterHow often minor and full GCs where happening on the server node
10 min
How much heap memory is configured for each server node and how many of it is currently occupied
© SAP AG 2009. All rights reserved. / Page 27
Guidelines for Using SM66 to Look –AS ABAP (APP)
ChecklistCheck for blocked work processes
CPIC RFC problems, non-DIA-WPsPRIV Insufficient extended
memorySemaphore many different, F1 helpENQ Problems with message/
enqueue server
ChecklistDo most work processes execute DB commands?
DB bottleneck (CPU, memory, buffer sizes, I/O, ST04)DB locks (WP accessing the same row, ST04)
Do program names appear repeatedly?May contain the coding which slows down the system
© SAP AG 2009. All rights reserved. / Page 28
Active programsSAPLNRIV Number range bufferSAPLGLIV Improve COMMIT times on
database (ERP)Long running SQL Statements
Problems with Cost Based Optimizer
Find hot spots with ABAP run time analysis SATOther signs of serialization?
Semaphore locks (Generic table buffer, Number range buffer, Roll, …)Enqueue locks (non-blocking)Lack of free work processes (root cause?)
15
SM66: Work Process Overview –AS ABAP (APP)
Not typical for production systems
16
Involved DBtables
© SAP AG 2009. All rights reserved. / Page 29
Processing time
Semaphore 16:Generic table buffer
Why did the process stop?
SAP MC: Thread Overview –AS JAVA (APP)
© SAP AG 2009. All rights reserved. / Page 30
SAP Systems SID Instance AS Java Threads
16
ST03G Workload Analysis: A PowerfulAnalysistool – AS ABAP (APP) AS JAVA (APP)
Ch kli tChecklistAutomatic data collection, aggregation, historyBreakdown of the processing time
CPUWait for RFC, http requests, free work process, …DB request time
Memory usage and network traffic
© SAP AG 2009. All rights reserved. / Page 31
Specialized profiles forRFCWeb requestsVMC
Ranking lists, like Top-50 longest response timesDisplay single statistical recordsAggregation according to individual criteria
ST03G: Statistic Records –AS ABAP (APP)
Workload aggregation according to time- Day, Week, Month
Workload aggregation according to location- Individual servers, Total
Workload for individual selections on time, server, Type, Program, User, …
,
© SAP AG 2009. All rights reserved. / Page 32
Different views on the workload – answers every question
17
ST03G – Statistic Records –AS ABAP (APP)
Server BServer CServer DServer E
Different views on the workload with different dimensions and filters
task typetransactionusertime
© SAP AG 2009. All rights reserved. / Page 33
Variety of meaningful KPIs per view
ST03G: Statistic Records –AS ABAP (APP)
…and also for AS JAVA!
© SAP AG 2009. All rights reserved. / Page 34
Variety of meaningful KPIs per view
18
SAP JVM Profiler: Profiling (1/5) –AS JAVA (APP)
Profiling response times of classes/methods on AS JavaProfiling of memory consumption of classes/methods on AS Java
© SAP AG 2009. All rights reserved. / Page 35
SAP JVM Profiler: Profiling (2/5) –AS JAVA (APP)
Prerequisite: enable debug on AS Java server nodeDebug port isDebug port is normally5<SysNr><26>, 5<SysNr><27>, ... for each AS Java server node
© SAP AG 2009. All rights reserved. / Page 36
19
SAP JVM Profiler: Profiling (3/5) –AS JAVA (APP)
First step: create profiling configurationOne can profile response times and memory simultaneously or separately
© SAP AG 2009. All rights reserved. / Page 37
SAP JVM Profiler: Profiling (4/5) –AS JAVA (APP)
Response time profiling: method tree (hierarchical)Response time profiling: methodprofiling: method statistic (flat file)Response time profiling: user filter
© SAP AG 2009. All rights reserved. / Page 38
20
SAP JVM Profiler: Profiling (5/5) –AS JAVA (APP)
Memory profiling: allocated objectsMemory profiling: method tree (hierarchical)(hierarchical)Memory profiling: method statistic (flat file)Memory profiling: user filter
© SAP AG 2009. All rights reserved. / Page 39
Exercise on Workload Analysis –AS ABAP
The goal of the exercise is to perform a workload analysis of the system for a specific period in the past.
15 min
Start the analysis of the workload of the whole system in expert mode for a period which will be given by the presenterWhich task type dominates the load during that period?What does the “User by Activity” profile look like?Determine the transactions or reports which show the highest average response timesAre there time periods with peak load visible?D t i th d t ti d f th i l di l t ith th hi h t
© SAP AG 2009. All rights reserved. / Page 40
Determine the date, time and user name of the single dialog step with the highest response time
21
Exercise on Workload Analysis –AS JAVA
The goal of the exercise is to perform a workload analysis of the system for a specific period in the past and online.
10 min
Start the analysis of the workload of the whole system for a period which will be given by the presenterStart the appropriate tool to conduct a memory analysis. Let the tool run for about 30 seconds and the stop the measurement (alternatively, use the trace file provided by the lecturer)Which user is consuming most of the memory?What call is consuming most of the memory?What single objects consume most memory? Who is responsible for the
© SAP AG 2009. All rights reserved. / Page 41
What single objects consume most memory? Who is responsible for the instantiation for that object(s)?
1 Introduction to Performance Monitoring of AS ABAP and AS JAVA
Agenda
1. Introduction to Performance Monitoring of AS ABAP and AS JAVA
2. Hardware2.1. AS ABAP2.2. AS JAVA
3. Database3.1. AS ABAP3.2. AS JAVA
© SAP AG 2009. All rights reserved. / Page 42
4. Application4.1. AS ABAP4.2. AS JAVA
5. Conclusion
22
Conclusion
SAP's monitoring infrastructure provides you with the means to quickly analyze the performance of the system
System analysis is a procedural approach by which you eliminate the potential y y p pp y y pcauses for poor performance
Performance monitoring helps you to decide which follow-on activities are requiredExtend hardwareAnalyze codingAnalyze business process design
© SAP AG 2009. All rights reserved. / Page 43
Virtual SAP TechEd :Extend your SAP TechEd Year Round
Best of SAP TechEd at Your fingertipsView sessions that you missedReplay and review sessions that you attendedattended
Quality SAP TechEd TrainingBest PracticesProduct Roadmaps
Learn at your own pace Gain Access to sessions recorded in 2006, 2007, 2008 and 2009* (*available December 2009)24/7 A li / ffli
© SAP AG 2009. All rights reserved. / Page 44
24/7 Access online/offlineFlexible Course Syllabus
Volume LicensingSpecial Pricing for multiple subscribers
http://www.sdn.sap.com/irj/scn/virtualteched-allsessions
23
Further Information
SAP Public Web:SAP Developer Network (SDN): www.sdn.sap.comBusiness Process Expert (BPX) Community: www.bpx.sap.com
Instructions: (Delete this element)Please mention any related developer areas or forums on SDN.
Related Workshops/Lectures at SAP TechEd 2009Session ID, Title, Session Type
Related SAP Education and Certification Opportunitieshttp://www.sap.com/education/
Instructions: (Delete this element)Please mention any related SAP TechEd workshops or lectures.
Instructions: (Delete this element)Please mention any related SAP certification and training courses.
SAP BusinessObjects Community (BOC): www.boc.sap.com
© SAP AG 2009. All rights reserved. / Page 45
pIf you have too many sessions to fit on slide, please use a second Further Information slide for Related Workshops/Lectures.
DEMO
24
Th k Y !Thank You!
ContactFeedback
Please complete your session evaluation.p y
Be courteous — deposit your trash, and do not take the handouts for the following session.
25
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice.
Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.
Microsoft, Windows, Excel, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation.
IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, System z10, System z9, z10, z9, iSeries, pSeries, xSeries, zSeries, eServer, z/VM, z/OS, i5/OS, S/390, OS/390, OS/400, AS/400, S/390 Parallel Enterprise Server, PowerVM, Power Architecture, POWER6+, POWER6, POWER5+,
Copyright 2009 SAP AGAll Rights Reserved
, , , , , , , , p , , , , , ,POWER5, POWER, OpenPower, PowerPC, BatchPipes, BladeCenter, System Storage, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, Parallel Sysplex, MVS/ESA, AIX, Intelligent Miner, WebSphere, Netfinity, Tivoli and Informix are trademarks or registered trademarks of IBM Corporation.
Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.
Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries.
Oracle is a registered trademark of Oracle Corporation.
UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.
Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc.
HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web Consortium, Massachusetts Institute of Technology.
Java is a registered trademark of Sun Microsystems, Inc.
JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape.
SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP Business ByDesign, and other SAP products and services mentioned herein as well as their respective
© SAP AG 2009. All rights reserved. / Page 49
logos are trademarks or registered trademarks of SAP AG in Germany and other countries.
Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects S.A. in the United States and in other countries. Business Objects is an SAP company.
All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.
These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group 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 warrant.