c66274c870ac041d058a147ab3d49c46.ppt
- Количество слайдов: 49
J 2 EE Applications Performance Management § Kenneth Merkel § Systems Engineer 3/16/2018
Agenda § J 2 EE Applications Performance Management —Challenges in Managing Web/J 2 EE Applications —Methodology & Goals of Performance Management —Performance Management Approaches / Techniques § Real Issues § Introscope Copyright © 2003 Wily Technology, Inc. TM Platform Technology Overview 2
Why Is Web Application Performance Management So Complex? Internet Customers Mission-Critical Java Applications CICS/IMS on Mainframe MQ / Back-End Tuxedo Servers Web Servers Database Web Application Servers Copyright © 2003 Wily Technology, Inc. 3
Why Is Java Application Performance Management So Complex? Java/J 2 EE Application Internet Customers Web Servers Application Server MQ / Back-End Tuxedo Servers JVM Web Application Servers Copyright © 2003 Wily Technology, Inc. CICS/IMS on Mainframe Database 4
Typical J 2 EE Architecture J 2 EE Application Login Request Login JSP JNDI LDAP Server Response Transaction Request Response Account Info Servlet Account Transaction Servlet JDBC Driver Account EJB Database MQSeries Connector CICS Connector MQ Back-End Systems CICS Server Thread Pool EJB Pools JDBC Pools Application Server Memory File and Network I/O JVM Copyright © 2003 Wily Technology, Inc. 5
Common Performance Problems §Bottlenecks on resources § 3 rd party interaction points §Configuration problems §Memory leaks §Deadlocks and threading problems §Sloppy code Copyright © 2003 Wily Technology, Inc. 6
What is Performance Measurement and Analysis? § 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 Copyright © 2003 Wily Technology, Inc. 7
Web Application Performance Management Methodology Establish performance criteria Maintain criteria Analyze 1. Business Analysis 2. System Architecture Analysis 3. Application Analysis 4. Establish Baseline Apply criteria Failed criteria Test in QA Manage in Production 6. Production Deployment 7. Real-time Application Monitoring 8. Event Management 9. Problem Resolution 10. Application Server Tuning 11. Continuous Performance Management 5. Functional & Stress Test Met criteria Copyright © 2003 Wily Technology, Inc. New criteria requirements 8
What do I analyze? § 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? Copyright © 2003 Wily Technology, Inc. 9
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 Copyright © 2003 Wily Technology, Inc. 10
… And what about the application server? Application Server Queues § Web Container § EJB Container § ORB Thread Pool § Datasource Queuing Memory considerations § Garbage collection Connection Pools • JDBC Statement Types • Prepared Statement Cache • Exceptions Messaging • JMS • MQ Application Server Exceptions § Memory Leaks Copyright © 2003 Wily Technology, Inc. 11
Now how do I get this info? §Logging §Profiling §Byte. Code Instrumentation Copyright © 2003 Wily Technology, Inc. 12
Approach #1: Logging § How does it work? — You log (Log 4 J, 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. Web. Logic, Web. Sphere) — Hard or impossible to change once application is deployed While logging is powerful and flexible, it can be very costly in terms of IO performance Copyright © 2003 Wily Technology, Inc. 13
Approach #2: Profiling § 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. . ) Copyright © 2003 Wily Technology, Inc. § Pros: — Lots of Information — Detailed Memory Data § Cons: — Lots of Information — Lots of overhead (not usually possible under load) 14
Approach #3: Bytecode Instrumentation § How does it work? — In-memory or Out-ofmemory 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 Copyright © 2003 Wily Technology, Inc. § 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 15
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? Copyright © 2003 Wily Technology, Inc. 16
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 J 2 EE Application performance management is constant vigilance. Copyright © 2003 Wily Technology, Inc. 17
All Systems Green Actual Issues Copyright © 2003 Wily Technology, Inc. 18
Additional Examples of Performance Issues and Improvement Points § 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) Copyright © 2003 Wily Technology, Inc. 19
Info regarding 24 instances of an app servlet Copyright © 2003 Wily Technology, Inc. 20
Slow leak in connections to MQSeries? Copyright © 2003 Wily Technology, Inc. 21
History of the number of active MQ connections settles into average of 26 Copyright © 2003 Wily Technology, Inc. 22
One server starts to back up execute threads Copyright © 2003 Wily Technology, Inc. 23
Different view showing concurrency problems Copyright © 2003 Wily Technology, Inc. 24
Transaction Tracer shows slow point Copyright © 2003 Wily Technology, Inc. 25
Memory Usage (The Good) Copyright © 2003 Wily Technology, Inc. 26
Memory Usage (The Bad) Copyright © 2003 Wily Technology, Inc. 27
Memory Usage (The Ugly) Copyright © 2003 Wily Technology, Inc. 28
Caused a component slowdown Copyright © 2003 Wily Technology, Inc. 29
Isolated to single EJB via Blame Copyright © 2003 Wily Technology, Inc. 30
Leak. Hunter isolates leak in each transaction that is run. Copyright © 2003 Wily Technology, Inc. 31
Synchronization Issue Copyright © 2003 Wily Technology, Inc. 32
Copyright © 2003 Wily Technology, Inc. 33
Copyright © 2003 Wily Technology, Inc. 34
Copyright © 2003 Wily Technology, Inc. 35
Copyright © 2003 Wily Technology, Inc. 36
Copyright © 2003 Wily Technology, Inc. 37
Wily Introscope Technology Overview Copyright © 2003 Wily Technology, Inc. 38
Introscope Agent • Gathers All Data Required to Manage a J 2 EE Application § § § Introscope Probes JMX PMI CPU Stats JVM Stats • Enables Management of the Whole Application… • Runs Inside the JVM § Negligible Overhead § Benign (Fault Tolerant) § Easy to Install Copyright © 2003 Wily Technology, Inc. § § Application Code Performance Application Server Health and Configuration Back-End System Performance Network/Infrastructure Health 39
Introscope Probes™ -Patented Bytecode Instrumentation Technology Timer and Counter “Probes” inserted into Java bytecode. Servlet 10100101110101 01001010001011 01101111001101 010100011 1101111101 01010100000011 1101001010 0011111110101001001 010000011 No Source Code modifications required! Copyright © 2003 Wily Technology, Inc. 40
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 J 2 EE Component § File-system and Network I/O Bytes Per Second Counts § Total Number of Servlet Invocations § Number of open Database connections § Etc. Copyright © 2003 Wily Technology, Inc. 41
Introscope Probes™ -Provide the Agent with Performance Metrics • Introscope Agent “listens” to Probes Introscope Agent • Probes Can be Installed in Any Java Code § Application Server § Back-End System Connector Libraries § CICS, MQSeries, JDBC § 3 rd Party Applications and Libraries • Provides Low-Overhead Visibility into Java Performance Copyright © 2003 Wily Technology, Inc. 42
Introscope Enterprise Manager -The Central Processing Unit • Processes and Manages Data Gathered by Introscope Agents Agent • Processes Alerts, Database Storage, Systems Management Integration, etc • Stand-alone Java Application. Runs Anywhere… § § § UNIX (AIX, Solaris, HPUX) Windows NT OS/390 AS 400 Linux Copyright © 2003 Wily Technology, Inc. Agent Introscope Enterprise Manager Agent 43
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 Copyright © 2003 Wily Technology, Inc. 44
Historical Performance Reporting -Enterprise Manager Preserves Data in RDBMS Introscope Enterprise Manager • • Configurable frequency and volume of data output • Run Batch Summary Reports on Historical Data • System Performance Reports Enterprise Manager can write any or all metrics to a RDBMS Interrogate Historical Data in Introscope Workstation Historical & Trend Performance Data Historical Data Copyright © 2003 Wily Technology, Inc. 45
Systems Mgmt Framework Integration -SNMP MIB and Alerts Make Integration Seamless Introscope Enterprise Manager • MIB Alerts e ive anc L m r IB rfo ata M Pe D MP SN a Vi 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 Operations Center Copyright © 2003 Wily Technology, Inc. 46
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. • Power. Packs ™ § App Specific Metrics and Views for 3 rd Party Apps and App. Servers Copyright © 2003 Wily Technology, Inc. 47
Introscope Architecture Introscope Agent Introscope Workstation Agent Re a Pe l-tim rfo e rm , H an ist ce ori Ale cal rti , & ng Introscope Enterprise Manager J 2 EE Application Server Systems Management Integration Alerts & Events Performance Data via SNMP MIB Stand-Alone Java Application Agent Java Application Server Agent System Performance Reports Capacity Planning ================== 02: 00 Stock. Trading: Serlvet 42 318 586 =================================== 02: 00 Stock. Trading: Serlvet 42 318 586 02: 00 Stock. Trading: Serlvet 42 318 586 Availability Reports Trend Reports Historical Charts Historical & Trend Performance Data Historical Data Copyright © 2003 Wily Technology, Inc. 48
All Systems Green For more info on achieving World Class Java Application management Ray Beecher – (972) 830 -9033 rbeecher@wilytech. com Kenneth Merkel – (713) 669 -9239 kmerkel@wilytech. com Copyright © 2003 Wily Technology, Inc. 8000 Marina Blvd, Suite 700 Brisbane, CA 94005 http: //www. wilytech. com 1 888 GET WILY sales@wilytech. com – (415) 562 -2000 54