Practical Performance Understanding the Performance of Your Application

Similar documents
Holly Cummins IBM Hursley Labs. Java performance not so scary after all

An Oracle White Paper September Advanced Java Diagnostics and Monitoring Without Performance Overhead

THE BUSY DEVELOPER'S GUIDE TO JVM TROUBLESHOOTING

How To Use Java On An Ipa (Jspa) With A Microsoft Powerbook (Jempa) With An Ipad And A Microos 2.5 (Microos)

Tomcat Tuning. Mark Thomas April 2009

Tool - 1: Health Center

Monitoring and Diagnosing Production Applications Using Oracle Application Diagnostics for Java. An Oracle White Paper December 2007

Tuning WebSphere Application Server ND 7.0. Royal Cyber Inc.

Virtualization and the U2 Databases

Java VM monitoring and the Health Center API. William Smith

Memory-to-memory session replication

IBM RATIONAL PERFORMANCE TESTER

Java Garbage Collection Best Practices for Sizing and Tuning the Java Heap

IBM Software Group. SW5706 JVM Tools IBM Corporation 4.0. This presentation will act as an introduction to JVM tools.

Enterprise Manager Performance Tips

Mission-Critical Java. An Oracle White Paper Updated October 2008

Oracle Corporation Proprietary and Confidential

An Oracle White Paper July Oracle Primavera Contract Management, Business Intelligence Publisher Edition-Sizing Guide

Business Process Management IBM Business Process Manager V7.5

IBM WebSphere Application Server Communications Enabled Applications

Development Environment and Tools for Java. Brian Hughes IBM

Oracle JRockit Mission Control Overview

Performance Best Practices Guide for SAP NetWeaver Portal 7.3

WebSphere Architect (Performance and Monitoring) 2011 IBM Corporation

Using Microsoft Performance Monitor. Guide

How To Improve Performance On An Asa 9.4 Web Application Server (For Advanced Users)

Performance brief for IBM WebSphere Application Server 7.0 with VMware ESX 4.0 on HP ProLiant DL380 G6 server

Performance and scalability of a large OLTP workload

IBM Tivoli Provisioning Manager V 7.1

Trace-Based and Sample-Based Profiling in Rational Application Developer


<Insert Picture Here> Java Application Diagnostic Expert

Insight into Performance Testing J2EE Applications Sep 2008

Advanced Performance Forensics

WebSphere Business Monitor

Cognos8 Deployment Best Practices for Performance/Scalability. Barnaby Cole Practice Lead, Technical Services

How to analyse your system to optimise performance and throughput in IIBv9

Gavin Payne Senior Consultant.

Contents Introduction... 5 Deployment Considerations... 9 Deployment Architectures... 11

MID-TIER DEPLOYMENT KB

Running SAP Solutions in the Cloud How to Handle Sizing and Performance Challenges. William Adams SAP AG

Java Performance. Adrian Dozsa TM-JUG

IBM WebSphere Partner Gateway V6.2.1 Advanced and Enterprise Editions

Resource Utilization of Middleware Components in Embedded Systems

Delivering Quality in Software Performance and Scalability Testing

Configuring Apache Derby for Performance and Durability Olav Sandstå

How To Integrate Pricing Into A Websphere Commerce Pricing Integration

IBM Business Monitor. BPEL process monitoring

COLO: COarse-grain LOck-stepping Virtual Machine for Non-stop Service

WebSphere DataPower Release DNS Enhancements

Java Coding Practices for Improved Application Performance

Effective Java Programming. measurement as the basis

14/05/2013 Ed Merks EDL V1.0 1

IOS110. Virtualization 5/27/2014 1

11.1 inspectit inspectit

Minimum Hardware Configurations for EMC Documentum Archive Services for SAP Practical Sizing Guide

An Oracle White Paper March Load Testing Best Practices for Oracle E- Business Suite using Oracle Application Testing Suite

WebSphere Commerce V7 Feature Pack 3

Business Process Management IBM Business Process Manager V7.5

WebSphere Performance Monitoring & Tuning For Webtop Version 5.3 on WebSphere 5.1.x

Using Iometer to Show Acceleration Benefits for VMware vsphere 5.5 with FlashSoft Software 3.7

IBM WebSphere Application Server

IBM Software Information Management. Scaling strategies for mission-critical discovery and navigation applications

WebSphere Commerce V7 Feature Pack 2

Justin Bruns, Performance Test Lead, Fireman's Fund Insurance Robert May, Enterprise Software Tools Administrator Fireman's Fund Insurance

JVM Performance Study Comparing Oracle HotSpot and Azul Zing Using Apache Cassandra

HeapStats: Your Dependable Helper for Java Applications, from Development to Operation

WebSphere Business Monitor

IBM DB2 specific SAP NetWeaver Business Warehouse Near-Line Storage Solution

IBM Tivoli Network Manager V3.9

NetBeans Profiler is an

Winning the J2EE Performance Game Presented to: JAVA User Group-Minnesota

Debug 101-Using ISA Tools for Apps in WebSphere Application Server z/os

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Analyzing IBM i Performance Metrics

Symantec Endpoint Protection Shared Insight Cache User Guide

JBoss Data Grid Performance Study Comparing Java HotSpot to Azul Zing

Tech Tip: Understanding Server Memory Counters

Virtualizing a Virtual Machine

Initial Hardware Estimation Guidelines. AgilePoint BPMS v5.0 SP1

Garbage Collection in the Java HotSpot Virtual Machine

Java Performance Tuning

DELL TM PowerEdge TM T Mailbox Resiliency Exchange 2010 Storage Solution

A Practical Method to Diagnose Memory Leaks in Java Application Alan Yu

WebSphere Application Server V6: Diagnostic Data. It includes information about the following: JVM logs (SystemOut and SystemErr)

Best Practices for Monitoring a Vmware Environment. Gary Powell Senior Consultant IBM SWG Tivoli

This presentation covers virtual application shared services supplied with IBM Workload Deployer version 3.1.

Monitoring HP OO 10. Overview. Available Tools. HP OO Community Guides

An Oracle Benchmarking Study February Oracle Insurance Insbridge Enterprise Rating: Performance Assessment

SAS deployment on IBM Power servers with IBM PowerVM dedicated-donating LPARs

Throughput Capacity Planning and Application Saturation

What s Cool in the SAP JVM (CON3243)

Monitoring your cloud based applications running on Ruby and MongoDB

z/os V1R11 Communications Server System management and monitoring Network management interface enhancements

Apache Tomcat Tuning for Production

Rational Asset Manager 7.2 Editions and Licensing

A Scalability Study for WebSphere Application Server and DB2 Universal Database

Identifying Performance Bottleneck using JRockit. - Shivaram Thirunavukkarasu Performance Engineer Wipro Technologies

New!! - Higher performance for Windows and UNIX environments

Agile Performance Testing

Transcription:

Neil Masson IBM Java Service Technical Lead 25 th September 2012 Practical Performance Understanding the Performance of Your Application 1 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Important Disclaimers THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY. WHILST EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION CONTAINED IN THIS PRESENTATION, IT IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. ALL PERFORMANCE DATA INCLUDED IN THIS PRESENTATION HAVE BEEN GATHERED IN A CONTROLLED ENVIRONMENT. YOUR OWN TEST RESULTS MAY VARY BASED ON HARDWARE, SOFTWARE OR INFRASTRUCTURE DIFFERENCES. ALL DATA INCLUDED IN THIS PRESENTATION ARE MEANT TO BE USED ONLY AS A GUIDE. IN ADDITION, THE INFORMATION CONTAINED IN THIS PRESENTATION IS BASED ON IBM S CURRENT PRODUCT PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM, WITHOUT NOTICE. IBM AND ITS AFFILIATED COMPANIES SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION. NOTHING CONTAINED IN THIS PRESENTATION IS INTENDED TO, OR SHALL HAVE THE EFFECT OF: - CREATING ANY WARRANT OR REPRESENTATION FROM IBM, ITS AFFILIATED COMPANIES OR ITS OR THEIR SUPPLIERS AND/OR LICENSORS 2 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Goals of the Talk So... You have a performance problem.. You are not sure what the application is doing under the covers What next? After this talk you will: Understand when and why to use performance tools Have a toolkit of performance tools and techniques Get to know your Java application better 3 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Agenda Performance why should you care? Approaches to performance Layers of the application Identifying bottlenecks 4 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Approaches to performance Outside in approach Start from where performance can be measured Work along the activity path Ideal for identified performance problems Layered approach Analyze and eliminate layers of the application Simplify the problem as you go Ideal for application health check A hybrid of both approaches can often be useful 5 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Performance baseline Important to have a repeatable performance test Measure baseline performance Internal measurements affect the performance of what your measuring External measurements have less impact on system performance 6 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Layers of a Java application Three layers of a deployment: Infrastructure: Hardware and Operating System Java Runtime: Garbage Collection Java Application: Java application code Each can suffer from resource constraints, typically: Memory CPU Synchronization I/O 7 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Infrastructure Typical resource constraints: Memory: insufficient physical memory results in paging/swapping CPU: insufficient CPU time limits throughput of the application I/O: insufficient I/O limits throughput of the application Synchronization driven by Java runtime/java application Easy to diagnose Easy to resolve (relatively) Note that each can also be caused by deficiencies higher up the stack! 8 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Infrastructure memory usage Infrastructure uses memory for: Backing the process data: OS runtime, Java runtime, Java application Caching of IO: filesystem and network buffers Lack of physical memory causes: Reduction and removal of IO caching Paging/swapping of process memory to disk Paging/swapping is costly for a Java process Particularly affects Garbage Collection performance Paging usually occurs on Least Recently Used basis All of Java heap is traversed during mark and sweep phases Least Recently Used does not work well for the Java heap 9 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Infrastructure CPU usage Insufficient CPU time availability will reduce performance Can occur periodically: Cron Jobs running batch applications Database backups Or during periods of high load: System becomes CPU bound, limiting performance 10 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Detecting infrastructure issues Detect using Operating System level tools Memory on Windows: Paging: using perfmon with Process counter for Page Faults/sec File Cache: using perfmon with Memory counter for System Cache Resident Bytes CPU on Windows: Per process: using perfmon with Process counter for % Processor Time Per machine: using perfmon with Processor counter for % Processor Time IO on Windows: Network: using perfmon with Network Interface counter for Output Queue Length Disk: using perform with Physical Disk counter for Current Disk Queue Length 11 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Page response performance benchmark: baseline Page Performance Average Page Response 25000 20000 Response Time (ms) 15000 10000 Baseline 5000 0 1 2 3 4 5 6 7 8 9 10 Page 12 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Paging in perfmon 13 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Resolving infrastructure issues Add more physical resources to the process Assign more to the: Machine, Guest OS, LPAR, Zone, etc Reduce the physical resource requirements Reduce the application footprint Reduce the application CPU usage Reduce the IO 14 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Page response performance benchmark: memory increased Page Performance Average Page Response 25000 20000 Avg response time (ms) 15000 10000 Baseline Memory Increased 5000 0 1 2 3 4 5 6 7 8 9 10 15 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Page response performance benchmark: memory increased Page Performance %age changes 10 9 8 7 6 Memory Increased Page 5 4 3 2 1 0.0% 5.0% 10.0% 15.0% 20.0% 25.0% 30.0% 35.0% Performance 16 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Java runtime Typical resource constraints: Memory: insufficient Java heap results in OutOfMemory or high GC overhead CPU Garbage Collection overhead, or driven by Java application Synchronization driven by Java application IO driven by Java application Easy to diagnose Easy to resolve (relatively) 17 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Java runtime memory Java runtime uses memory for: Java Heap(s), Java Virtual Machine (JVM), Native heap, OS and C-language runtime 0 GB 2 GB 4 GB -Xmx OS and C-Runtime JVM Java Heap(s) 0x0 0x40000000 0x80000000 0xC0000000 0xFFFFFFFF Java heap(s) are managed using Garbage Collection Other memory usage can be indirectly driven by application usage and garbage collection eg. Java Threads Java Heap Native Heap 18 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Java runtime problems Insufficient Java heap memory leads to: OutOfMemoryError due to Java heap exhaustion Garbage Collection running excessively, increasing CPU and affecting performance Insufficient non-java ( native ) heap leads to: OutOfMemoryError due to process address space exhaustion Driver for Java heap garbage collection (DirectByteBuffer cleaners) 19 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Detecting Java runtime problems Log and trace analysis: Native heap: OS level logs (ps, svmon, perfmon) Java heap: verbose:gc output Post processed using: IBM Monitoring and Diagnostic Tools for Java - Garbage Collection and Memory Visualizer (GCMV ) Live monitoring: Native heap IBM Monitoring and Diagnostic Tools for Java - Health Center Java heap: IBM Monitoring and Diagnostic Tools for Java - Health Center Visual VM, Mission Control 20 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Garbage collection performance Heap Size Too Frequent Garbage Collection Memory Heap Occupancy Long Garbage Collection Cycles Time 21 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Too Frequent Garbage Collection 22 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Garbage Collection Pause Times 23 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Resolving Java runtime problems Add more resources to the Java runtime Java heap: Increase Java heap size Native heap: Move to 64bit or reduce Java heap size Reduce the memory requirements Reduce the Java application footprint 24 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Increased Java heap size 25 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Effect on Garbage Collection Pause Times Reduction in: Time spent in GC 59% However this is only 4.84% of total time 26 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Page response performance benchmark: Java Heap Size Increased Page Performance Average Page Response Time 25000 20000 Response Time (ms) 15000 10000 Baseline Memory Increased Heap Size Increased 5000 0 1 2 3 4 5 6 7 8 9 10 27 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Page response performance benchmark: Java Heap Size increased Page Performance %age changes 10 9 8 7 6 Heap Size Increased Page 5 4 3 2 1-5.0% 0.0% 5.0% 10.0% 15.0% 20.0% 25.0% 30.0% 35.0% 40.0% Performance 28 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Java application Typical resource constraints: Memory: insufficient caching affects application throughput and responsiveness CPU: insufficient threading causes limits on scalability Synchronsation: synchronized resources limits scalability and throughput of the application I/O: blocking on I/O limits throughput and responsiveness Hard to diagnose Can be expensive (or impossible!) to resolve 29 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Java application CPU usage High CPU usage by Java methods highlight areas of potential optimization Code is being invoked more than it needs to be Easily done with event driven models An algorithm is not the most efficient Easily done if performance is not the focus at development time Fixing CPU bound applications requires knowledge of what code is being run Identify methods which are suitable for optimisation Optimising methods which the application doesn t spend time in is a waste of your time Identify methods where more time is being spent that you expect Why is so much of time being spent in this trivial method? 30 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Java application synchronization Throughput does not increase linearly with load At limit of throughput the CPU is still low Inability to scale Not all CPU can be utilized Limit on throughput and responsiveness Bottleneck where threads need to synchronize with each other for application correctness Caused by large numbers of threads requiring synchronized resource at the same time Caused by long hold time by thread that owns resource Or a mixture of both 31 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Health Center: application method CPU usage 32 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Health Center: application synchronization 33 WebSphere User Group: Practical Performance Understand the Performance of Your Application

ShoppingServlet.deliberateSlowMethod() private void deliberateslowmethod() { // ---------------------------------------------------------------- // User clicked on the Tulips, let's tip toe through a // slow method // ---------------------------------------------------------------- System.out.println("==> STARTING SLOW METHOD"); long timestamp = System.currentTimeMillis(); long target = timestamp + SLOWTIME; System.out.println("timestamp="+timestamp); System.out.println("resume at="+target); while(timestamp < target) { } timestamp = System.currentTimeMillis(); } System.out.println("==> ENDING SLOW METHOD"); 34 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Health Center: application method CPU usage 35 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Health Center: application synchronization 36 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Page response performance benchmark: deliberateslowmethod() changed Page Performance Average Page Response 25000 20000 Response Time (ms) 15000 10000 Baseline Memory Increased Heap Size Increased Application Fixed 5000 0 1 2 3 4 5 6 7 8 9 10 Page 37 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Page response performance benchmark: deliberateslowmethod() changed Page Performance %age changes 10 9 8 7 6 Application Fixed Page 5 4 3 2 1-40.0% -20.0% 0.0% 20.0% 40.0% 60.0% 80.0% 100.0% 120.0% Performance 38 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Java application memory usage Used for in-flight work eg. Currently active transactions in a messaging system Used for caching data Reduce volume of IO and improve responsiveness 39 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Java application memory problems Memory Leaks Unbounded growth of collections OutOfMemoryErrors Memory Footprint Incorrectly sized caches Inefficient collection selection Leads to lower performance Garbage generation Creation/destruction of large amounts of data Leads to lower performance 40 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Analyzing your Collections Eclipse Memory Analyzer Tool (MAT) provides Collection analysis: 41 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Analyzing your garbage Eclipse Memory Analyzer Tool (MAT) with the IBM Extensions for Memory Analyzer provides garbage analysis: 42 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Memory Footprint Summary Collections exist in large numbers in many Java applications Example: IBM WebSphere Application Server running PlantsByWebSphere: HashSet 1,551 instances HashMap 12,151 instances 10,600 instances (excluding HashSets) LinkedList 1,148 instances ArrayList 9,530 instances 22,829 total collection instances When running a 5 user test load, and using 206MB of Java heap 43 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Summary Importance of: Repeatable benchmark Incremental measurements as changes are made Tools are available to help you see what's going on: Garbage Collection and Memory Visualizer (all vendors) HealthCenter (IBM only) Other profilers (eg. YourKit) (all vendors) Memory Analyzer (all vendors) 44 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Page response performance benchmark: Summary of Changes Page Performance %age changes 10 9 8 Page 7 6 5 Memory Increased Heap Size Increased Application Fixed 4 3 2 1-40.0% -20.0% 0.0% 20.0% 40.0% 60.0% 80.0% 100.0% 120.0% Performance 45 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Summary Infrastructure resources affect performance Paging and Garbage Collection much less than you might expect However, beware of CPU starvation from other processes! Vast majority of performance gains are in the application! 46 WebSphere User Group: Practical Performance Understand the Performance of Your Application

References Get Products and Technologies: IBM Monitoring and Diagnostic Tools for Java: https://www.ibm.com/developerworks/java/jdk/tools/ Learn: Health Center InfoCenter: http://publib.boulder.ibm.com/infocenter/hctool/v1r0/index.jsp Discuss: IBM on Troubleshooting Java Applications Blog: https://www.ibm.com/developerworks/mydeveloperworks/blogs/troubleshootingjava/ Health Center Forum: http://www.ibm.com/developerworks/forums/forum.jspa?forumid=1461 IBM Java Runtimes and SDKs Forum: http://www.ibm.com/developerworks/forums/forum.jspa?forumid=367&start=0 47 WebSphere User Group: Practical Performance Understand the Performance of Your Application

Copyright and Trademarks IBM Corporation 2012. All Rights Reserved. IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business Machines Corp., and registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web see the IBM Copyright and trademark information page at URL: www.ibm.com/legal/copytrade.shtml 48 WebSphere User Group: Practical Performance Understand the Performance of Your Application