490 likes | 512 Views
Kenneth Merkel Systems Engineer. J2EE Applications Performance Management. Agenda. J2EE Applications Performance Management Challenges in Managing Web/J2EE Applications Methodology & Goals of Performance Management Performance Management Approaches / Techniques Real Issues
E N D
Kenneth Merkel Systems Engineer J2EE Applications Performance Management
Agenda • J2EE Applications Performance Management • Challenges in Managing Web/J2EE Applications • Methodology & Goals of Performance Management • Performance Management Approaches / Techniques • Real Issues • IntroscopeTM Platform Technology Overview
Why Is Web Application Performance Management So Complex? Mission-Critical Java Applications CICS/IMS on Mainframe Internet MQ / Tuxedo Back-End Servers Web Servers Customers Database Web Application Servers
Why Is Java Application Performance Management So Complex? JVM Java/J2EE Application CICS/IMS on Mainframe Internet MQ / Tuxedo Back-End Servers Application Server Web Servers Customers Database Web Application Servers
JDBC Driver MQSeries Connector CICS Connector Memory File and Network I/O Typical J2EE Architecture JVM J2EE Application Login JSP Login Request JNDI LDAP Server Response Account Info Servlet Account EJB Database Transaction Request Account Transaction Servlet Response Back-End Systems MQ CICS Server Application Server Thread Pool EJB Pools JDBC Pools
Common Performance Problems • Bottlenecks on resources • 3rd party interaction points • Configuration problems • Memory leaks • Deadlocks and threading problems • Sloppy code
Different definitions for different parts of your project… Development Profiling Logging Unit Testing Staging/QA Functional Testing Performance/Load Testing Defect/Performance Tracking Production Audit Trails Availability Service Level Agreements (SLAs) Sitemining What is Performance Measurement and Analysis?
Establish performance criteria Maintain criteria • Analyze • Business Analysis • System Architecture Analysis • Application Analysis • Establish Baseline • Manage in Production • Production Deployment • Real-time Application Monitoring • Event Management • Problem Resolution • Application Server Tuning • Continuous Performance Management Failed criteria Apply criteria • Test in QA • Functional & Stress Test New criteria requirements Met criteria Web Application Performance Management Methodology
Think in terms of user transactions or use cases for your application Typical examples of a single transaction might be… Logging in Looking Up Account Balance Transferring Funds Look at resource usage by use-case (especially high concurrency points) Stay focused on what your customers do with your application… why tune something unrelated? What do I analyze?
What am I looking for? Intra-component … • Resource usage/abuse • Using Exceptions to handle non-exceptional cases. • Synchronization/Contention Costs • Collection Load Factors • Proper pattern usage
… And what about the application server? • Connection Pools • JDBC Statement Types • Prepared Statement Cache • Exceptions • Messaging • JMS • MQ • Application Server Exceptions Application Server Queues • Web Container • EJB Container • ORB Thread Pool • Datasource Queuing Memory considerations • Garbage collection • Memory Leaks
Now how do I get this info? • Logging • Profiling • ByteCode Instrumentation
How does it work? You log (Log4J, JDK 1.4 Logging, ..) They log (EPM, JMX, PMI ..) How can you use it? In a file… Into a monitor... Pros (of you log): Produce any statistic Send stat anywhere Cons (of you log): You write it yourself Can not log into components you did not write (e.g. WebLogic, WebSphere) Hard or impossible to change once application is deployed Approach #1: Logging While logging is powerful and flexible, it can be very costly in terms of IO performance
How does it work? – Java Virtual Machine Profiler Interface (JVMPI) What can it get you? CPU usage Clock time CPU time Memory usage Navigating a Java Heap Reference Graph Watching the Garbage Collector (temporaries, etc..) Pros: Lots of Information Detailed Memory Data Cons: Lots of Information Lots of overhead (not usually possible under load) Approach #2: Profiling
How does it work? In-memory or Out-of-memory post-processing of byte code (e.g. JAR or ZIP files) “Logging without source code changes” How can you use it? Like you do logging or profiling, but… Without the same level of detail about memory utilization For example: average response times, call count, call rate, stalled thread counts Pros: Add or remove on demand Low overhead Watch anything (even components you don’t own, like the application server) Cons: Limited options on what kind of tracing can be done Doing it for free would be hard Approach #3: Bytecode Instrumentation
So which technique is best for me? Depends on your performance goals… • What impact does the technique have in production? • How much overhead can you tolerate? • What are your performance goals? • Is source code modification feasible? • Do I need instance level metrics? • How much data will the technique produce? • How hard is the data to interpret?
Best advice… • Think through performance goals early - setting target benchmarks/baselines. • Implement a methodology that allows measurement of application performance against benchmarks and baselines. • Use the right tools when/where possible. Preferably tools that generate actionable data and allow for proactive management. • Build repeatable and automated test scripts. • Remember the key to J2EE Application performance management is constant vigilance.
All Systems Green Actual Issues
Back-End and Concurrency Issue Garbage Collection and Memory Utilization Synchronization and Script Bug Issue Load Generation Test Performance Data and Component Unit Test Counts (Weighted Averages) Additional Examples of Performance Issues and Improvement Points
History of the number of active MQ connections settles into average of 26
Introscope Agent • Gathers All Data Required to Manage a J2EE Application • Introscope Probes • JMX • PMI • CPU Stats • JVM Stats • Enables Management of the Whole Application… • Application Code Performance • Application Server Health and Configuration • Back-End System Performance • Network/Infrastructure Health • Runs Inside the JVM • Negligible Overhead • Benign (Fault Tolerant) • Easy to Install
Servlet 10100101110101010010100010110110111100110101010000100011110111011111010101010000001111010101001010001111111010101010010100100101000010000011 Introscope Probes™-Patented Bytecode Instrumentation Technology Timer and Counter “Probes” inserted into Java bytecode. No Source Code modifications required!
Metrics Provided by Introscope Probes™ Average Response Times • Run time for Servlet Execution, Method Call, JDBC Call, Etc. • Measured in milliseconds • Average value over small fixed time interval Rates • Invocations Per Second of Object, Method, or any J2EE Component • File-system and Network I/O Bytes Per Second Counts • Total Number of Servlet Invocations • Number of open Database connections • Etc.
Introscope Agent Introscope Probes™-Provide the Agent with Performance Metrics • Introscope Agent “listens” to Probes • Probes Can be Installed in Any Java Code • Application • Application Server • Back-End System Connector Libraries • CICS, MQSeries, JDBC • 3rd Party Applications and Libraries • Provides Low-Overhead Visibility into Java Performance
Introscope Enterprise Manager Agent Agent Agent Introscope Enterprise Manager -The Central Processing Unit • Processes and Manages Data Gathered by Introscope Agents • Processes Alerts, Database Storage, Systems Management Integration, etc • Stand-alone Java Application. Runs Anywhere… • UNIX (AIX, Solaris, HPUX) • Windows NT • OS/390 • AS400 • Linux
Introscope Alerts Enable Actionable Response to Changes in Performance • Easily Configurable Thresholds • Caution and Danger Levels • Configured in GUI Workstation • Maximums or Minimums • Available for Any Metric in System • Response Times, Rates, Counts, … • Servlets, EJBs, Methods, … • Flexible/Powerful Event Manager • Console Alert Dialog Boxes • Emails • Shell Scripts (executed on EM machine) • Any combination of Events for either Threshold
Introscope Enterprise Manager Historical Performance Reporting-Enterprise Manager Preserves Data in RDBMS • Enterprise Manager can write any or all metrics to a RDBMS • Configurable frequency and volume of data output • Run Batch Summary Reports on Historical Data • Interrogate Historical Data in Introscope Workstation System Performance Reports Historical & Trend Performance Data Historical Data
Introscope Enterprise Manager Systems Mgmt Framework Integration-SNMP MIB and Alerts Make Integration Seamless • Enterprise Manager collects and analyzes data • Enterprise Manager PUSHES SNMP Alert to SNMP Manager • Enterprise Manager publishes live application metrics in Dynamic SNMP MIB • SNMP Manager displays SNMP Alert • SNMP Manager reads MIB and PULLS live performance data and displays graphically Alerts MIB Live Performance Data Via SNMP MIB Operations Center
Introscope Workstation-Intuitive Visualization of Performance Data • The Console • Dashboards • Customized Display of Multiple Metrics • Different Dashboards for Different Users • The Explorer • Hierarchical View of Application • Management Modules • Containers for Alerts, Dashboards, Calculators, Groupings, etc. • PowerPacks™ • App Specific Metrics and Views for 3rd Party Apps and AppServers
Introscope Agent Introscope Workstation Introscope Enterprise Manager Capacity Planning Historical Charts =================================== 02:00 StockTrading:Serlvet42 318 586 02:00 StockTrading:Serlvet42 318 586 02:00 StockTrading:Serlvet42 318 586 02:00 StockTrading:Serlvet42 318 586 02:00 StockTrading:Serlvet42 318 586 02:00 StockTrading:Serlvet42 318 586 02:00 StockTrading:Serlvet42 318 586 02:00 StockTrading:Serlvet42 318 586 Availability Reports Trend Reports =================================== 02:00 StockTrading:Serlvet42 318 586 02:00 StockTrading:Serlvet42 318 586 02:00 StockTrading:Serlvet42 318 586 02:00 StockTrading:Serlvet42 318 586 02:00 StockTrading:Serlvet42 318 586 02:00 StockTrading:Serlvet42 318 586 02:00 StockTrading:Serlvet42 318 586 02:00 StockTrading:Serlvet42 318 586 =================================== 02:00 StockTrading:Serlvet42 318 586 02:00 StockTrading:Serlvet42 318 586 02:00 StockTrading:Serlvet42 318 586 02:00 StockTrading:Serlvet42 318 586 02:00 StockTrading:Serlvet42 318 586 02:00 StockTrading:Serlvet42 318 586 02:00 StockTrading:Serlvet42 318 586 02:00 StockTrading:Serlvet42 318 586 Introscope Architecture Agent J2EE Application Server Real-time, Historical, & Performance Alerting Agent Java Application Server Systems Management Integration Stand-Alone Java Application Alerts & Events Performance Data via SNMP MIB Agent System Performance Reports Historical & Trend Performance Data Historical Data
All Systems Green For more info on achieving World Class Java Application management Ray Beecher – (972) 830-9033 rbeecher@wilytech.com Wily Technology, Inc.8000 Marina Blvd, Suite 700Brisbane, CA 94005http://www.wilytech.com1 888 GET WILY Kenneth Merkel – (713) 669-9239 kmerkel@wilytech.com sales@wilytech.com – (415) 562-2000