J2EE environment tuning
Java System Web Server Application: Java is increasingly popular as a programming language in the enterprise IT environment. Many companies have invested substantial time and money in terms of hardware, application server software, and databases. This article is the first of two that present a systematic technique for optimizing Java code, specifically addressing a three-tier architecture that is extensible to any multi-tier environment. Read this article first, then move to J2EE Application Tier Tuning.

from Intel Corp.

Java is increasingly popular as a programming language in the enterprise IT environment. Many companies have invested substantial time and money in terms of hardware, application server software, and databases. Yet most of these companies are not getting full use of the equipment and software that they have purchased or the full use of the software they have developed for those products. This is because all of these components usually require some amount of tuning before they communicate efficiently, and tuning several interdependent components is difficult and time consuming without a proper approach. This article is the first of two that present a systematic technique for optimizing Java code, specifically addressing a three-tier architecture that is extensible to any multi-tier environment. Read this article first, then move to J2EE Application Tier Tuning.

To better illustrate the discussion, we'll use a fictitious online pet store as an example. All implementation details refer to a Windows 2000 environment, but should be applicable with few or no changes to a Windows NT or XP environment. All concepts will apply equally to a Linux environment, but no specific Linux resources will be suggested.

This document is intended for software developers who have a minimum of one year of Java development experience, familiarity with developing test workloads, and use of performance and monitoring tools. Your environment, however, may require advanced techniques not covered in this document and may require professional services, such as Intel® Solution Services, which has extensive experience assisting independent software vendors on all Intel-based platforms.

Before you begin
Before beginning there are several points to consider. First of all, undertaking a proper tuning project is not a small task. At a minimum, the tuning project will likely occupy two engineers full time for two months. Additional engineers will be required at various points when their area of the product falls under the microscope. That being said, once the initial investment is made, subsequent tuning projects can be accomplished more swiftly.

You must also determine the right time to start the tuning process. Preparation for tuning will probably take you about one month, possibly more depending on the complexity of the product. The tuning itself will take at least one month for a team that is inexperienced in performance tuning. This must all be timed so that the tuning can take place on code that is near ready for release or code that has recently been release but can be easily patched for your customers. Don't invest resources tuning code that will be replaced before it is ever used in production.

Define the scope
As with any project, the first step is to define the problem. What performance problem are you trying to solve? For most applications the goal will be to tune performance for the common usage case. It is not a good idea to try to tune the application for every usage scenario. In our pet store example, users are more likely to buy puppies than they are fish, so it makes sense not to spend as much time optimizing the nuances of fish purchases. With your priorities clearly in mind you can more easily manage the scope of the project and get better results for your efforts.

Define the workload
Now that we have limited the general scope of the activity, we need to take the definition a step further. In order to tune the application we must see how it behaves when stressed. The mechanism to stress an application is called a workload. Creating the workload is the single most important part of the tuning project. How you tune your application will depend entirely on how it is stressed. A proper workload must be:

  1. Representative
  2. Measurable
  3. Static
  4. Reproducible.
Representative
In the case of a Web application, the concept of the workload is straight forward, but there are still some pitfalls. The easiest way to make a workload is to select a set of URLs. This can be done by identifying common user patterns. For example:
  1. A user accesses the home page
  2. Surfs through the available pets
  3. Adds one to the shopping cart
  4. Goes to checkout
  5. Arrives at the order confirmation page.
Another way of creating a workload is to record a portion of a day's activity. The http requests can then just be played back. Either method you use will require a harness to submit the requests, maintain sessions, simulate think time, and so forth. There are several commercial load generation tools available that supply the necessary functionality. Selecting the tool for your company will depend on your budget (some products are licensed at a cost per virtual user and per day) and the amount of load capacity that you need to generate.

Consider these factors when creating a workload manually:

  • You may want to create weighted URLs. In step 2 of the user scenario described previously, 50 percent of the users may surf through puppies, 40 percent through kittens, and 10 percent through your rare turtle collection.
  • Not all of your users will go all the way from start to finish. That is, not all users will actually buy a pet. You may find that many users never complete the checkout stage.
  • Actual users don't all choose the same item to buy. If every user in your workload tries to update the same record in the database, you will not get an accurate picture of your database query efficiency.

Subscribers who liked this article also read:
Lowering costs with BEA WebLogic Server and Intel-based servers
by Allan McNaughton, president, Technical Insight LLC. Intel Corp. ...
Optimizing the SciMark 2.0 Benchmark: How Intel Tools Measure Up
SciMark 2.0 is a floating-point benchmark from the National Institute ...

If you're interested in this topic, these articles may be helpful:

J2EE application tier tuning
by Dan Middleton, Intel Corp. This article is the second of two tha...
Download: WebSphere Application Server V7.0
WebSphere® Application Server is an application server platform ba...
Hello World: Create a Java Web application without knowing Java using Rational Business Developer Extension
Enterprise Generation Language (EGL) and Rational Business Developer E...
Download: Rational Business Developer Extension
IBM Technical Briefings: Coming to these cities in May: Taipei, GCG (2...
Mercury Diagnostics Profiler: free software download
from Mercury Diagnostics. Mercury Diagnostics Profiler is a lightwe...

Related Jobs:

Software Developer 2 #IRC280770 - CA - Redwood Shores - Oracle
Oracle is making waves in the real-time collaboration and communicatio...
Programmer Analysts #20276 - PA - Pittsburgh - iGate Mastech
Job Description: iGate Mastech, Inc. seeks Programmer Analysts (m...
Senior .NET Software Developer #46894 - TX - Houston - Siemens AG
Senior .NET Software Developer Company Siemens Energy and Automatio...
Web Developer - IL - Bloomington - York Enterprise Solution
Job Description Job Description: Design, build, test, manage and ma...
Sr. Programmer Analyst #47926 - FL - Celebration - The Walt Disney Internet Group
Sr. Programmer Analyst 47926 posted 11/2/2006 Celebration, FL ...
Software Engineer I #T05-4365 - MA - Needham - General Dynamics C4 Systems
Job Title Software Engineer I Location Needham MA Relocation Avail...
Developer II - Java #15 SG - FL - Orlando/Lake Mary - SunGard
Reference No.: # 15 SG Opening Date: January 20, 2006 Job Title: D...
Program Manager #11.06.05 - CA - Redwood Shores - VISTO, Inc.
Program Manager - 11.06.05 Dec 16, 2005 Redwood Shores,California ...
Solutions Architect #141484 - WA - Redmond - Microsoft Corporation
The Communications Sector’s core mission is to accelerate the growth o...
Sr. Java Developer #8 SG - FL - Fort Lauderdale - SunGard
Reference No.: #8 SG Opening Date: January 12, 2006 Job Title: Sr....