Srini Rangaswamy

Subscribe to Srini Rangaswamy: eMailAlertsEmail Alerts
Get Srini Rangaswamy: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Related Topics: WebSphere

IBM WebSphere software products: Article

Tuning WebSphere 5.0 Using the Performance Advisors

Tuning WebSphere 5.0 Using the Performance Advisors

In today's Internet environment, performance is critical for a successful Web site. Identifying the causes of poor performance and tuning the system accordingly is challenging and often requires expert knowledge of available monitoring data. The Performance Monitoring Infrastructure (PMI) in IBM's WebSphere Application Server 5.0 provides more than 150 performance metrics describing runtime and application resources. As part of IBM's autonomic computing initiative, the performance advisors provide a starting point to the application server tuning process. This article is an introduction to those performance advisors and their role in tuning WebSphere 5.0 for optimal performance.

Performance Advisors - Overview
Tuning WebSphere Application Server involves analyzing performance data and determining the optimal server configuration. This requires considerable knowledge about the various components in the application server and their performance characteristics. The performance advisors encapsulate this knowledge, analyze the performance data, and provide configuration recommendations to improve the application server performance.

The performance advisors analyze WebSphere PMI data using general performance principles, best practices, and WebSphere-specific rules of thumb. The goal of both performance advisors is to identify common performance problems such as misallocation of resources. For example, the performance advisors check the ORB (object request broker) thread pool size. If it is too small, the thread pool can be a bottleneck, unnecessarily restricting concurrency in the system. If it is too large, the additional memory needed and the extra context switching can hurt overall performance.

The performance advisors are technology previews for WebSphere Application Server version 5, on Windows and Linux platforms. There are two performance advisors: the runtime performance advisor and the performance advisor in Tivoli Performance Viewer (TPV advisor).

The runtime performance advisor runs in the application server process, and the TPV advisor runs in the Tivoli Performance Viewer client. Figure 1 shows a simplified architecture view of the performance advisors. Both advisors provide advice on the following application server resources: thread pools, connection pools, HttpSession size and cache, prepared statement cache, and JVM heap size. The performance advisors can be downloaded from www7b.software.ibm.com/wsdd/ downloads/performance_advisors.html.

Runtime Performance Advisor
Running in the background of the application server, this advisor gathers the necessary performance data from PMI, analyzes it, and provides recommendations based on the current system load. Since the advisor uses PMI data, you must first enable the performance monitoring service on the application server; then the runtime advisor automatically enables the individual PMI counters required. The runtime advisor is configured using the WebSphere administrative console. Some of the primary settings include enabling the runtime advisor itself, setting the number of CPUs on the application server machine, and setting the frequency at which the advisor is run. It is also possible to enable and disable specific advice. Figure 2 shows the runtime advisor configuration in the WebSphere administrative console.

The recommendations from the runtime performance advisor are issued as standard WebSphere warning messages. These warnings appear both in the WebSphere Status panel in the administrative console under WebSphere Runtime Messages, and in the SystemOut.log file in the appserver log directory (e.g., c:\WebSphere\AppServer\logs\server1). The runtime advisor is designed to have a minimal performance impact so it can be used in a production environment. In our lab tests, the impact of running the runtime advisor is around 1% on top of any PMI overhead.

TPV Advisor
The second performance advisor in the technology preview is integrated with the Tivoli Performance Viewer (TPV), which is a stand-alone performance monitoring tool that retrieves and displays the PMI data. The performance advisor in TPV uses this PMI data and displays its recommendations in the TPV GUI. After-the-fact analysis can be obtained by running the advisor on a recorded TPV log.

Unlike the runtime advisor, the TPV advisor is run manually by the user at a specific point in time. Because it runs in the TPV JVM and not during the application server process, this advisor has more freedom than the runtime advisor to do computationally intensive analysis without impacting server performance. In addition to the advice provided by the runtime advisor, the TPV advisor checks the WebSphere configuration for settings that deviate significantly from the norm. The TPV advisor also provides a performance summary of various runtime resources in a graphical format. This performance summary includes average response time and throughput for the Web and EJB containers, CPU utilization, and pool utilization for Web container threads, ORB threads, and database connections. Figure 3 shows a typical screen shot from the TPV advisor.

Performance Advisors - A Detailed Look
The performance advisors are based on the principle that getting the best performance from an application server requires optimal utilization of the runtime resources. The advisors use the PMI data to calculate the current resource utilization level and provide recommendations to achieve optimal resource utilization.

Let's look at some examples in detail. Consider the data source prepared statement cache, which helps to decrease the cost of executing a prepared statement by caching the compiled statement. If the cache is full, an old entry in the cache is discarded to make room for the new one. Best performance is generally obtained when the cache is large enough to hold all of the statements used in the application. The PMI counter "prepared statement cache discards" indicates the number of statements that have been discarded from cache. The advisors check this counter and provide recommendations to minimize the cache discards.

Now let's look at the pools in the application server. The idea behind pooling is to use an existing thread/connection from the pool instead of creating a new instance for each request. Since each thread/connection in the pool consumes memory and increases the context-switching cost, the pool size can be an important configuration parameter. A pool that is too large can hurt performance as much as a pool that is too small. The advisors use PMI information about current pool usage, pool minimum/maximum size, and application server CPU utilization to recommend efficient values for the pool sizes.

A third area of concern is HttpSession. The HttpSession cache can be configured to be bounded or unbounded. If it is bounded (the "Allow Overflow" flag is false), then sessions may not be available when the application needs them. When this happens, the performance advisors check the PMI counter "no room for new session" and recommend increasing the cache size. Another common performance problem occurs when the individual sessions become too large. When using persistent sessions, the advisors track the average session size and warn when the size gets too large.

Using the Performance Advisors
In this section, we walk through an example that shows how the performance advisors help in improving the performance of an application. We use the Trade3 application with WebSphere Application Server version 5, running on a four-way Microsoft Windows NT system. First, we run the application with the out-of-the-box WebSphere settings. In the second run we use the recommendations from TPV advisor.

Figure 4 shows the output from the TPV advisor when running the application using out-of-the-box settings with 50 users. The TPV advisor recommendations are to decrease the maximum number of threads in the ORB pool from 10 to 3, increase the maximum pool size of jdbc/TradeDataSource from 10 to 13, and increase the prepared statement cache size of jdbc/TradeDataSource from 10 to the number of prepared statements in the application. During this test, the Web container throughput is 1,584 requests/sec., with an average response time of 61 ms.

Now let's apply the recommendations by setting the ORB thread pool maximum size to 3, the jdbc/Trade DataSource maximum pool size to 13, and the jdbc/TradeDataSource prepared statement cache size to 25. We restart the application server and rerun the 50-user test. Figure 5 shows the results. The throughput increases by 15%, and average response time decreases slightly.

These performance advisors base their recommendations on the current system load. In a production environment, you should run the advisors several times to see how the advice changes with normal load fluctuations. In a test environment, run the advisors with a load that closely resembles the expected production load. For further information about using the performance advisors, refer to the documentation that comes with the download package.

Summary
Tuning your WebSphere Application Server correctly is a critical part of getting the best performance from your Web site. These performance advisors help you to do this without requiring you to become a product expert. performance advisors provide a starting point to the application server tuning process. This article is an introduction to those performance advisors and their role in tuning WebSphere 5.0 for optimal performance.

More Stories By Carolyn Norton

Carolyn Norton is manager of the WebSphere Solutions Performance Technology department. Prior to that she was chief technical officer for the Sydney Olympics, and part of the Worldwide Olympic Technology Team in Nagano. Carolyn, a member of the IBM Academy of Technology, holds a PhD in mathematics from MIT and an AB from Princeton University.

More Stories By Srini Rangaswamy

Srini Rangaswamy is a software engineer in the IBM WebSphere performance
development group. He is responsible for the design and development of Tivoli Performance Viewer. He holds a master's degree in software systems from BITS Pilani, India.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.