Hands-on with PTT
The best way to learn about a tool is by using it. This tutorial replicates few performance bottleneck scenarios and shows how those issues can be resolved using PTT. PTT can monitor the entire WebSphere Application Server cluster, but for simplicity this tutorial uses a single server instance of WebSphere Application Server. As part of the tutorial, you install a standard sample performance application on this WebSphere Application Server and introduce a performance bottleneck into the application. You then use PTT in conjunction with other tools to investigate the problems.
- PTT is the primary tool to detect performance problems. Download and install the toolkit.
- DayTrader Performance Application is an end-to-end sample Web application that is modeled on on-line stock brokerage. DayTrader leverages JEE components such as servlets, JSP files, enterprise beans, message-driven beans (MDBs) and Java database connectivity (JDBC) to provide a set of user services such as login/logout, stock quotes, buy, sell, account details, and so on HTTP and web service protocols. DayTrader provides configurable parameters that are used to induce different performance bottlenecks. To learn more about DayTrader Performance application, see the Resources. Scripts to install the DayTrader application on a single server instance are available under Downloads section.
- The Apache JMeter Load testing tool is designed to load test functional behavior and measure performance. It is used to simulate requests on the DayTrader application. See the Resources for the installation image.
- IBM Support Assistant 5 Tech Preview is used to aid problem determination. It provides a Case Manager which helps to collect the data for problem determination investigation and also a suite of tools that help in diagnosing the problems. See the Resources for information how to get IBM Support Assistant.
- Install PTT by unzipping the installable archive. Then run executable. The workbench shown in Figure 2 is displayed.
Figure 2: Performance Tuning Toolkit Workbench
- To configure PTT, you must add a host. Click the Add a new Host button in the toolbar of Host pane. In the New Host window (see Figure 3), specify the IP address and SOAP port of the deployment manager in case of a WebSphere Application Server ND installation or of the server in case of a single server environment. If security is enabled, you must also specify the user name and password.
Figure 3: Adding a new Host
- To install the DayTrader application, select Help -> Case Study from the PTT workbench menu bar to import the sample application and script files to the Scripts view. These sample scripts are for a clustered environment; the additional scripts required for single server setup are provided in the download section of this tutorial. Copy the scripts from the download archive and place it under <PTT install path>/ workspace/Scripts/sample folder.
- Open settings_SingleServer.py in the Sample folder and change the node name to the node in your environment. You also need to provide the security details if WebSphere Application Server security is enabled. Select the host in the host view, and right click installDaytrader_singleServer.py in the sample folder of the scripts view and select Run Scripts in the context menu to run the script against your server. The script performs the entire required configuration and then installs the DayTrader application to the specified server.
The Log Console (see Figure 4) in PTT shows that the application was installed successfully.
Ensure that the verbose garbage collection is turned on for the server. The garbage collection can be enabled through the application server administration console. Choose your server, click on Process definition and click Java Virtual Machine as shown in Figure 5.
Figure 5: Enabling Garbage Collection on the server
Restart the application server and to verify the installation, open the DayTrader application at
http://<host>:default_port/daytrader/scenario (see Figure 6).
Figure 6: DayTrader Home Screen
Use the JMeter tool to simulate requests for DayTrader application. Launch JMeter and open the daytrader.jmx file in the sample folder of the Scripts pane. Change the values of the hostname and portnumber variables as per your environment.
Figure 7: JMeter configuration screen
To verify the configuration, run the JMeter tool for 10 minutes and ensure that the tool is able to work with the application. This also ensures that the environment is set up properly.
To start IBM Support Assistant, start the server with ISA5/start_isa.bat. It can be accessed via URL: http://localhost:port/isa5/. The port number is displayed as an output when start_isa.bat batch is run.
This completes all the setup required for this tutorial.
Now that all the required software is installed and configured, let's take a closer look at the PTT tool. The User Interface consists of views that present information in a concise and logical manner. Figure 8 below shows a sample overview screen.
Figure 8: PTT Workbench Overview
Notice that it presents the summary information about the server. To view the Dashboard, click the Open Monitor Page button on the overview screen.
Figure 9: The PTT Dashboard