Sie sind auf Seite 1von 9

DIAGNOSING J2EE PERFORMANCE PROBLEMS

T H R O U G H O U T T H E A P P L I C AT I O N L I F E C Y C L E
Ta b l e o f C o n t e n t s

Challenges for J2EE Applications Diagnosing Performance Problems


and Performance 3 with Mercury for J2EE 6

Typical J2EE Application Summary 8


Performance Problems 4

Alternative Technologies for Capturing


J2EE Performance Data 5

ABSTRACT
MANY LARGE-SCALE AND COMPLEX ENTERPRISE APPLICATIONS ARE NOW BUILT AND DEPLOYED USING THE J2EE

ARCHITECTURE. HOWEVER, MANY OF THESE APPLICATIONS SUFFER FROM POOR PERFORMANCE AND SCALABILITY BECAUSE

THE FOCUS OF THE DEVELOPMENT PROCESS IS ON FUNCTIONALITY, WHILE PERFORMANCE AND SCALABILITY ARE DEALT

WITH AS AN AFTERTHOUGHT.

THIS PAPER WILL PRESENT TECHNIQUES FOR DELIVERING HIGH PERFORMANCE APPLICATIONS TO PRODUCTION, MANAGING

AND MEASURING THE PERFORMANCE OF APPLICATIONS, AND DIAGNOSING THE TOUGHEST J2EE PROBLEMS THROUGHOUT

THE ENTIRE APPLICATION LIFECYCLE. THE PAPER WILL EXAMINE THE VARIOUS TYPES OF PERFORMANCE ISSUES THAT NEED

TO BE DEALT WITH AT EACH STAGE OF THE LIFECYCLE AND WHAT DIFFERENT DIAGNOSTIC TOOLS AND TECHNIQUES CAN

BEST RESOLVE THEM.

2
CHALLENGES FOR J2EE APPLICATIONS Many applications have not been sufficiently • During quality assurance cycles, load testing
AND PERFORMANCE architected for performance and scalability, with typically follows integrated functional and
Today’s enterprises are choosing to build business regression testing. A complete application,
thorough consideration of design and usage
applications that leverage the power, portability, including all interfaces with external systems,
patterns, and adequate attention to planning
should be fully load tested prior to software
and rapid development of Java technology. and testing performance against well defined release. Objectives include scalability and
J2EE offers many advantages to developers, but service objectives. J2EE scalability capabilities, capacity estimation under load that realistically
introduces new challenges for the development, while extensive, do not substitute for such represents expected live usage, along with
performance diagnosis, tuning, deployment, and efforts. Later in the lifecycle, applications may visibility into the internal performance behavior
management of applications. Successful delivery of the application and actionable data on
be pushed into production to meet deadlines,
and management of typically complex J2EE-based bottlenecks. This should include transaction
with insufficient validation of performance or
breakdown of latencies for each J2EE tier
applications requires evaluating performance scalability and inadequate tools to see into and method, along with additional specific
throughout the entire application lifecycle. application internal behavior, making it difficult root cause diagnostic information.
and expensive to fix problems. Getting to the
An application may perform well in the develop- Profiling tools used at the developer desktop
root of performance problems in the complex,
ment and QA environment, but fail to scale or cannot be used in QA during load testing for
distributed, and dynamic J2EE environment is performance diagnosis, due to the high over-
may exhibit transient performance problems
truly a challenge. head they impose. J2EE diagnostic tools used
in production. It is important to understand
at this stage need to be designed for load and
the impact of the infrastructure in which the Performance Evaluation and Diagnostic should be integrated with load testing tools to
application runs and the behavior of the many Needs Throughout the Application Lifecycle
boost productivity and testing effectiveness.
application components as they interact under During the application lifecycle, there are many
• During staging or pre-production, deployment
load. From the diagnostic perspective, it is IT stakeholders in application performance. They
teams should determine the performance and
important to be able to isolate the problem by include application architects, developers, load
scalability of the application in the specific
tier of the application architecture, by application testers and engineers in QA, application support IT environment and configuration that will
component, and to have progressive drill-down staff, and site operations in production. They serve live users, verify projected peak load
visibility into J2EE performance problems, the share common requirements for performance capability, and tune the application and
J2EE environment, and into the actual code, diagnostics, but also have specific roles and infrastructure to meet its designed transaction
throughput and response time service levels.
with sufficient detail to determine the root needs unique to their environments.
Load testing and performance diagnostic
cause of the problems.
• In the design and specification phases, a tools that can optimize both application
topic outside the scope of this diagnostic and infrastructure, and drill down to solve
There are additional factors that can increase
paper, performance and scalability issues problems, are essential during this stage.
the difficulties of application delivery and
need to be considered, incorporated, and
management. The deployment lifecycle for many • In live production, operations and application
specific objectives set.
Web-facing J2EE applications is compressed, managers need the ability to continuously
• In the development and unit-testing phase, monitor the health of the entire system,
due to increased pressures for quick time to
profiling tools can be useful to validate measure the performance of the application,
market. Boundaries between development, QA,
performance, along with functionality. and, if something starts to go wrong, be able
deployment, and production stages and IT Developers should test the performance of to quickly alert, triage, isolate, and pinpoint
groups are blurred. Centralized IT organizations components against identified latency and the root cause of the problem. Needs include
may be managing hundreds of applications, system resource utilization criteria. real-time monitors that provide drill-down
with little depth of each. IT staff skills for visibility into the application, and in-depth,
offline analytic tools for application support to
J2EE may not be developed enough.
dig into deep details of performance problems.

3
It is sometimes difficult to reproduce tough TYPICAL J2EE APPLICATION c. Memory problems, including memory
production problems in staging or QA test beds. PERFORMANCE PROBLEMS thrashing and memory leaks
A toolset that provides drill-down from a broad There are a wide variety of problems that can
d. Coding practices, such as using
user and business transaction view all the way to surface during the application lifecycle. For exceptions as a means to transfer
detailed internal diagnostics can be essential for J2EE Web applications in production, user control in the application
eliminating persistent or recurring performance experience of performance is affected by many
2. Application Server configuration problems:
problems. The toolset should provide a combi- external network infrastructure factors that are
independent of application behavior. External a. JDBC Connection pool size
nation of agentless infrastructure monitoring,
low-overhead J2EE monitoring agents, and the monitors can improve isolation of problems, b. JVM Heap size
ability to narrowly target problem areas for deep assisting triage. From the J2EE application
c. Thread pool sizes
measurements. Such toolsets should be able diagnostic perspective, it is essential to be
able to capture and correlate specific external 3. Architecture and design problems, with a
to diagnose the toughest problems, such as
parameters, such as HTTP arguments, that can wide range of issues, such as:
intermittent slow methods, full transaction
tracing including arguments, memory leaks, drive performance problems in a J2EE method a. Data marshalling problems resulting from
synchronization, and deadlock issues. or sequence of transactions. Specific latencies filtering at the wrong tier
and parameter captures are also frequently
b. Single-threading resulting from inadequate
Throughout the entire application lifecycle,
needed to identify problems at J2EE interfaces synchronization design in custom code
J2EE-specific visibility and diagnostic capability
to external systems, such as backend databases,
should be integrated with and complementary to An effective diagnostic toolset must provide
legacy systems, and packaged software.
multi-platform, multi-protocol tools for functional capabilities and techniques to be able to isolate
testing, load testing, and application performance Within the J2EE environment, some of the most and identify the root cause of each of these
management. Common tools and measurements common problems include: common problems, regardless of when they
help facilitate communication, while each team 1. Code problems: emerge, from development through production.
member needs specific features and capabilities Capturing J2EE performance data sufficient for
a. Slow methods
suited to their role. solving this range of problems is a significant
• Consistently slow methods technical challenge.

• Intermittently slow methods, related


to specific user/data values driving
problematic application behavior

b. Synchronization problems, including


both under synchronization and over
synchronization for locks and threads

4
ALTERNATIVE TECHNOLOGIES FOR
CAPTURING J2EE PERFORMANCE DATA
There are three types of measurement interfaces
for capturing J2EE application performance data. BYTE CODE

The first is the JMX interface provided by the


JVM INSTRUMENTATION
Monitoring
SAMPLING focus:
application server vendors, exposing fixed, fairly first-level
APPLICATION       diagnostics
coarse-grained performance counters from the EVENTS

EJB Container. While useful for aggregated, AGGREGATION


APPLICATION      
high-level performance monitoring at very low SERVER
EVENTS
overhead, diagnostic capability is quite limited. JMX Deep
JVMPI TOTAL TRACE Diagnostics:
The second is a set of highly detailed, dynamic at low
overheads
data exposed by the JVM provider though JVMPI
and JVMDI interfaces. These interfaces, used
SIMPLE MONITORS PROFILERS
by code profilers, provide excellent diagnostic
Low overhead, Detailed view,
detail to developers, including specific instance fixed, coarse high overhead,
grained unsuitable
transaction tracing, but at a heavy overhead under load
price that prevents their use in load testing or
production. The third is byte-code instrumentation, Figure 1. J2EE Application Visibility: Alternatives for Capturing Performance Data

used by vendors of diagnostic tools for use in


later stages of the lifecycle.
of all common events well, but loses granularity
Within byte-code instrumentation, several for diagnosing problems related to specific data
techniques can be used to manage the balance values and individual transaction events, such as
of diagnostic detail versus overhead. Sampling a specific method invocation with a long latency.
a proportion of events from an event stream is Total Trace refers to a unique technology to
a common technique, which effectively reduces capture and record data for each event executed
overhead but loses the ability to reliably capture within instrumented code. It provides the most
a number of problems. If a problem occurs in an granular detail for diagnosing problems, such
event that isn’t sampled, or is due to a sequence as a method that is only slow when processing
of events, sampling misses the problem. a specific data value, a synchronization problem
Intermittent or sequence-related problems are when transactions contend for a resource, or
particularly intractable with this technique. memory problems, such as thrashing or leaks.
Aggregation captures and combines a sequence Total Trace includes automated techniques
of events into a single recorded data value, such to narrow the scope of instrumented code, to
as an average. This technique reflects the impact manage overhead.

5
DIAGNOSING PERFORMANCE PROBLEMS to the root cause for the full range of J2EE best suited to the performance needs of IT users
WITH MERCURY FOR J2EE performance problems. Total Trace allows through the lifecycle. Together, they provide the
Mercury for J2EE provides solutions for functional capturing of every event (including arguments) broadest and deepest performance testing, diag-
testing, performance testing, monitoring, and at low overheads and is distinguished from other nosis, and management capability available for
diagnosis of J2EE applications. It combines transaction tracing techniques, which use either J2EE applications. Though these products are
Mercury Interactive’s industry leading application a threshold for collecting only slow events from most effective when used together throughout
delivery and management solutions, including the event stream or a ‘tag and follow’ mechanism. the lifecycle, they are also available individually.
LoadRunner™ and Topaz™, with diagnostics The latter techniques can show slow method
J2EE Transaction Breakdown for LoadRunner
designed specifically for the J2EE environment. instances, but cannot show details of synchro-
The J2EE Transaction Breakdown module is
The solutions provide a common, consistent nization problems or complete information for
fully integrated with LoadRunner to expose and
foundation of shared assets, metrics, scripts, diagnosing arbitrary memory allocation problems.
diagnose the most common J2EE performance
and monitors, as well as specific solutions for
Mercury Interactive provides a combination and problems under load testing. The same J2EE
the differing requirements of application delivery
choice of instrumentation techniques, to provide transaction breakdown capability is included in
and application management.
both breadth of diagnostic information at low Topaz for J2EE, described in the following section.
Mercury for J2EE uses a combination of JMX, overhead and unmatched depth, with manageable
J2EE Transaction Breakdown first correlates end-
aggregation, and unique Total Trace technology, overhead. J2EE-specific solutions in the Mercury
user problems to the Web transaction tier, for
which can capture data to diagnose all of the suite include J2EE Transaction Breakdown, Topaz™
fast isolation and resolution, then pinpoints the
types of problems described previously. It is for J2EE, and J2EE Deep Diagnostics. Each one
J2EE problems. J2EE Transaction Breakdown
the only solution that can capture, under load, complements the others in providing functionality
analyzes the TCP/IP stack to break down a
necessary and sufficient information to get
transaction’s end-to-end response time to
determine whether poor transaction time is

DELIVERY MANAGEMENT caused by external network issues or by a specific


server tier. It then guides users through an
intuitive top-down analysis process across multiple
Performance Assurance Mercury Interactive
Management application layers, tracing business performance
Platform:
Monitoring, Problem problems from the end user all the way to the
LoadRunner , Identification:
Quick Test Professional, problematic component. It shows latencies
Test Director Topaz for J2EE for JSP/servlet, EJBs, classes, methods, and
JDBC connections, isolating and identifying
slow components. Aggregated data capture is
appropriate for monitoring continuously through
Mercury Interactive Foundation
a load test run.
Common Diagnostics Platform:

Transaction Breakdown Deep Diagnostics

Shared Scripts, J2EE Probe Technology

Figure 2: Mercury for J2EE combines J2EE-specific diagnostics with application delivery and management solutions.

6
J2EE Deep Diagnostics
J2EE Transaction Breakdown helps solve most
of the configuration and slow method problems
End-to-End Transaction
that occur in load testing and live production.
Response Time
But a significant number of the more complicated
J2EE performance problems will require deeper
diagnostics. Complex problems, such as finding

Web Page Database the cause of thread deadlocks or objects that


Breakdown Transaction aren’t deallocated and removed by Java Garbage
A App Server
Collection, are responsible for the majority of
• DNS lookup Web Server
• Time to Connect the time and cost spent in diagnosing the root
• Time to First cause of performance problems.
buffer Web Server App Server Database
• Network time Time Time Time
• Download time Client J2EE Deep Diagnostics uses Mercury Interactive’s
• Servlet • EJB • JDBC
• SSL handshake • Method • Method • Connect Total Trace data capture, which captures every
• FTP • JNDI lookup • Execute
authentication event in a selected area of the application with
• SQL Query
• Client time low overhead, by providing carefully tuned, pre-
• Error time
defined sets of byte-code instrumentation and
a GUI for custom selection and automatic
application of narrowly targeted instrumentation.
Figure 3. J2EE Transaction Breakdown provides response time statistics for all transactions.
It is not used for 24x7 production monitoring
or continuous capture in load testing runs, but
is an essential complement for focused, short-
Topaz for J2EE — Application Management in application performance and availability.
and Diagnostics in Production term, deep data capture when a tough problem
Agentless monitoring for most infrastructure
Topaz for J2EE addresses the needs of both is encountered. In production, a Topaz alert can
components can optimize the total cost of systems
operations and applications support teams by trigger a deep diagnostic data capture for offline
management. In addition, it can facilitate
combining real-time performance and availability analysis. This stops the common frustration of
capacity planning by ensuring that purchases
monitoring along with J2EE-specific diagnostics. persistently recurring production performance
of hardware and software are optimized.
Topaz for J2EE is designed specifically for problems that cannot be reproduced in a test
Topaz for J2EE provides correlation of end-user bed. The same J2EE Deep Diagnostics works
business processes and their J2EE components
performance with root cause in the infrastructure with LoadRunner when performance problems
with visibility across user, transaction, application
and application layers. Its J2EE-specific under load need better characterization for
component, and system tiers.
diagnostics identify problems involving EJB effective bug definition and rapid fixes.
The solution provides the industry’s broadest components, methods, and JDBC calls with SQL
monitoring capabilities, including server, J2EE Deep Diagnostics provides multi-layer
statements. J2EE diagnostics integrated with
application, and system monitoring, real-time correlation of HTTP, servlets, JSPs, EJBs/objects,
Topaz for J2EE provides the same transaction
rapid triage functionality, and proactive alerting. methods, and SQL calls. It correlates these
breakdown capabilities as LoadRunner, using
It allows 24x7 monitoring of the entire application internal component measurements with JMX
aggregated data capture, while optimized for
infrastructure, including the J2EE environment, and OS metrics to show problem details. It
low-overhead, real-time monitoring, triage, and
from a single Web-based console. Topaz for J2EE delivers graphical views of transaction traces, call
problem isolation, along with configuration tuning
also provides trending and correlation analysis chains, memory leaks and thrashing problems,
information such as heap utilization.
across all tiers, enabling continuous improvements synchronization details of locks held and threads

7
SUMMARY
With Mercury for J2EE, enterprises can improve
the readiness of their J2EE applications before
they are placed into production, and dramatically
accelerate problem identification, isolation, and
resolution. Mercury for J2EE allows companies
to reduce their costs of operations by providing
a business process view into the application
and by isolating and resolving problems before
business users and the bottom line are impacted.
The solutions can also help companies optimize
their existing infrastructure and avoid unnecessary
hardware or software expenditures.

The choice of the appropriate application delivery


Figure 4. J2EE Deep Diagnostics root cause analysis for memory problems. and management tools is critical for guaranteeing
application quality and ensuring that service-
level agreements can be met. Mercury for J2EE
blocked, latency charts, and source code views Additional drill-down screens show the lines of
is the industry’s first and most complete
of problem methods. J2EE Deep Diagnostics code where objects are being allocated.
application delivery and management suite
captures details of specific instances of method
For further examples and details on how for the J2EE ecosystem that improves the
invocations, including parameters passed and
synchronization problems, intermittent slow quality, performance, and scalability of J2EE
individual latencies, to pinpoint the source of
methods, and other J2EE performance problems applications across the entire application delivery
intermittent problems caused by specific user
are solved using the Mercury for J2EE solution, and management lifecycle.
data values or usage patterns.
contact your Mercury Interactive representative.
An example of the root cause analysis capability
J2EE Deep Diagnostics provides the level of infor-
is illustrated in Figure 4. This screen is showing
mation expected from a code profiler, collected
memory problems with the Live Object Distribution
selectively from an application under heavy load
report, selectively captured for any Java objects —
that makes code profilers unusable. This results
not just Java collections, as provided by another
in unique application visibility for diagnosing
vendor’s tool. It shows three methods that are
the toughest J2EE performance problems in
probably leaking and one that is thrashing.
load testing, staging, and production.

8
Mercury Interactive —The Global Leader in BTO Software
Mercury Interactive is the global leader in business technology optimization (BTO). Our Optane suite of enterprise testing,
production tuning, and performance management solutions enable companies to unlock the value of their IT investments
by optimizing business and technology performance to meet business requirements. With Mercury Interactive, customers
can measure the quality of their IT-enabled business processes, maximize technology and business performance at every
stage of the application lifecycle, and manage their IT operations for continuous optimization throughout the lifecycle.
Our leading-edge BTO solutions, complemented by technologies and services from our global business partners, are
used by over 30,000 customers—including 75% of the Fortune 500—to improve quality, reduce costs, and align IT
with business goals.

Mercury Interactive, Topaz, TotalTrace, and LoadRunner are registered trademarks or trademarks of Mercury Interactive Corporation or its wholly-owned subsidiaries,
Freshwater Software, Inc. and Mercury Interactive (Israel) Ltd. in the United States and/or other countries. All other product and company names are used herein
for identification purposes only, and may be trademarks of their respective companies. © 2003 Mercury Interactive Corporation. Patents pending. All rights reserved.
WP-0???-0903

M E R C U R Y I N T E R A C T I V E C O R P O R AT E H E A D Q U A R T E R S
1325 Borregas Avenue, Sunnyvale, CA 94089 U.S.A. Phone: 408-822-5200 or 800-837-8911
www.mercuryinteractive.com

Das könnte Ihnen auch gefallen