Running WebSphere Benchmark Sample Trade3 with Web Performance Tool (WPT) Using WebSphere Version 5 and IBM DB2 Universal Database Version 8.1 on Windows 2000 Tony Lau Yongli An IBM Toronto Lab, IBM Canada March 2003-1
Trademarks The following items are trademarks or registered trademarks of International Business Machines Corporation in the United States, other countries, or both: DB2 DB2 Universal Database WebSphere Microsoft and Windows are registered trademarks of Microsoft Corporation in the United States, other countries, or both. Acknowledgements The authors would like to thank the great contribution of the WebSphere performance team including Stan Cox, and other developers in IBM who are working on the IBM products used in this paper. The authors also want to thank Peter Shum and Johnny Huynh for reviewing the manuscript and their valuable comments. - 2
Abstract Trade3 is the third generation of the WebSphere end-to-end benchmark and performance sample application (the previous one is called Trade2). The new Trade3 benchmark has been re-designed and developed to cover WebSphere's significantly expanding programming model. It provides a real-world workload driving WebSphere's implementation of Java 2 Platform, Enterprise Edition (J2EE) 1.3 and Web Services, including key WebSphere performance components and features. This article shows the series of simple steps for installing all the components needed to get Trade3 up and running using WebSphere Version 5 and DB2 UDB Version 8.1. The goal of this article is to lead new users through some simple steps to quickly get an environment running without spending lot of time going through the lengthy manuals and readme files. Furthermore, the article also shows the reader how to install and configure a powerful performance testing tool (Web Performance Tool, or WPT) to drive and test the Trade3 application. By following some straightforward instructions, this article will show you Trade3 and WPT in a WebSphere and DB2 UDB environment. - 3
Contents ACKNOWLEDGEMENTS...2 ABSTRACT...3 CONTENTS...4 CONTENTS...4 1. INTRODUCTION...5 1.1 OVERVIEW... 5 1.2 PURPOSE... 5 1.3 INTENDED AUDIENCE... 5 2. REQUIREMENT...6 2.1 SOFTWARE USED... 6 2.2 OTHER MINIMUM REQUIREMENTS... 6 3. INSTALLING DB2 UDB VERSION 8.1...7 3.1 INSTALL DB2 UDB... 7 3.2 TEST THE INSTALLATION... 7 4. INSTALLING WEBSPHERE APPLICATION SERVER VERSION 5...8 4.1 INSTALL WEBSPHERE... 8 4.2 TEST THE WEB SERVER... 9 4.3 TEST THE APPLICATION SERVER... 10 5. INSTALLING WPT...12 5.1 SETUP WPT... 12 5.2 TEST THE INSTALLATION... 12 6. SETTING UP TRADE3 APPLIC ATION...14 6.1 INSTALL TRADE3 APPLICATION... 14 6.2 LOAD TRADE3 DATABASE... 15 6.3 TEST TRADE3 SETUP... 16 6.4 DATABASE TUNING... 17 7. TEST DRIVE...18 8. CONCLUSION...19 9. REFERENCES...19 APPENDIX A TRADE3.ACF...20-4
1. Introduction 1.1 Overview Trade3 is the third generation of the WebSphere end-to-end benchmark and performance sample application. The Trade3 benchmark models an online stock brokerage application and has been re-designed and developed to cover WebSphere's significantly expanding programming model. This provides a real-world workload driving WebSphere's implementation of J2EE 1.3 and Web Services, including key WebSphere performance components and features. Trade3's new design spans J2EE 1.3 including the new Enterprise Java Beans (EJB) 2.0 component architecture, Message Driven beans, transactions (1-phase, 2-phase commit) and Web Services (SOAP). Trade3 also highlights key WebSphere performance components such as DynaCache, WebSphere Edge Server and Web Services [1]. 1.2 Purpose This article focuses on the steps used to install Trade3 and configure the supporting software, which includes DB2 Version 8.1 and WebSphere Application Server Version 5. It provides an excellent starting point for those who are new to administrating and running WebSphere applications in the WebSphere and DB2 environment. For those new to this area, instead of studying the multitude of instructions in the lengthy manuals from different products, it s good to have all the needed instructions in one place in order to get this Trade3 sample application up and running quickly. Furthermore, this article introduces a powerful testing tool called Web Performance Tools (WPT). Instructions are provided to install and use WPT to drive performance tests against the Trade3 application. Web Performance Tools (WPT) [2] is a set of applications allowing a user to test a Web application. The application is a highperformance, simple, threaded HTTP engine that is capable of simulating hundreds of HTTP clients using a highly configurable set of directives in a human readable and easily modified configuration file. 1.3 Intended audience This article is intended to be the central place for providing instructions for a new user who is interested in trying out WebSphere Application Server Version 5 and DB2 UDB Version 8.1 by experimenting with WebSphere Performance Benchmark Sample Trade3 and WPT. - 5
2. Requirements The minimum requirements for running WebSphere Application Server and DB2 UDB database server are available from the respective user manuals. Consult the documentation to plan your installations. The sections below show the software information used in this article and the other minimum requirements for setting up a functional test bed. 2.1 Software used Windows 2000 Advanced Server, Service Pack 3 WebSphere Application Server Version 5 DB2 Enterprise Server Edition Version 8.1 WebSphere Performance Benchmark Sample, Trade 3 Web Performance Tools (WPT) 2.2 Other minimum requirements When starting your installation, please make sure your systems meet the following requirements. Software: Windows NT Server 4.0 SP6a, or Windows 2000 Advanced Server 2000 SP3, or Windows 2000 Server 2000 SP3; Using Windows 2000 Professional might be also functionally OK, but is not recommended Internet Explorer 5.5 SP 2 or 6.0, or Netscape Communicator 4.79 Using IBM HTTP Server as the Web Server (provided in the installation) DB2 Enterprise Edition Version 7.2 FP7 is included in the installation package, but DB2 Enterprise Server Edition 8.1 is used in this paper Hardware: Intel Pentium processor at 500 MHz or faster Minimum 520 MB free disk space for installation (includes SDK) Minimum 256 MB memory; 512 MB recommended CD-ROM drive - 6
3. Installing DB2 UDB Installing DB2 UDB is very straightforward. For our purpose to set up WebSphere running Trade3 benchmark, we will use the Typical installation and run a simple test. 3.1 Install DB2 UDB Run the setup.exe program. At the Launchpad, click on Install Products. Accept the default DB2 UDB Enterprise Server Edition to install. Select I accept the terms in the license agreement to accept the license agreement. Accept the default Typical installation type. Accept the default Install DB2 Enterprise Server Edition on this computer. Enter the Installation folder. Enter DB2 administrator user name and password, and keep the default use the same user name and password for the remaining DB2 services. Accept the default Local Create a contact list on this system for the administration contact list setup. Accept the default settings (Protocols and Startup) for DB2 instances configure. Accept the default Do not prepare the DB2 tools catalog on this computer. Select Defer the task until after installation is complete to defer the contact list creation. On the window Start copying files, after verifying the current settings, click install button to start the installation. Click Finish on the Setup is complete window. Note: Along the way, if you encounter any warning windows, read them carefully and click OK if you want to continue with the installation process. 3.2 Test the installation To do a quick test on the DB2 installation, start the DB2 command window by running db2cmd.exe. Then issue the following commands from a DB2 command window: db2sampl db2 list db directory If the commands above are executed successfully, a database named sample is created and the database directory is listed. Database alias = SAMPLE Database name = SAMPLE Database drive = C:\DB2 Database release level = 9.00 Comment = Directory entry type = Indirect Catalog node number = 0-7
4. Installing WebSphere Application Server WebSphere Application Server provides flexible configurations and deployment options for J2EE applications. For the purpose of demonstrating Trade3 application in a WebSphere environment, the simplest single server topology is used. The following sections describe how to install the WebSphere Application Server on a single machine, and then how to test it to make sure the installation is successful. This standalone configuration is typically for developer desktops or standalone production computing, which involve a single application server instance operating independently of any other applications. 4.1 Install WebSphere This section will describe the steps for installing WebSphere Application Server. The default installation method for Windows platform is to click Install the product on the LaunchPad tool. This action launches the installation wizard GUI. If you don t have the LaunchPad automatically shown on your screen, you can navigate to the directory on the installation CD, and run the program named Install.exe. Then follow these instructions: Select a language for the wizard GUI and click Next. The installation wizard opens and a welcome page appears. Click Next to continue. The license agreement appears for you to read. Click the radio button beside the I accept the terms in the license agreement message if you agree to the license agreement and click Next to continue. Choose the default setup type Full to install everything you need to run web applications on this server. After selecting a full installation, the wizard prompts you to select the directory for the program code. Use the default or change them to other places as you want, then click Next to continue. Specify node name and host name information. Take the default (the machine name for both) and click Next to continue. Uncheck Run WebSphere Application Server as a service and check Run IBM HTTP Server as a service so that we will explicitly start and stop WebSphere Application Server from command line. Click Next to continue Review the summary information and click Next to install the product code or Back to change your specifications Click Next to register the product, or deselect the check box and click Next to register at a later time. Click Finish to exit the Installation Wizard. The First Steps Window will show up. - 8
4.2 Test the Web server After installation, the first step is to test the Web server. Make sure the Web server is started. If not, do the following to start the IBM HTTP server: net start IBM HTTP Server 1.3.26 To verify the installation of IBM HTTP server, use the following steps: Open a Web browser. Enter the Web address http://<hostname>/, where <hostname> is the hostname of the WebSphere machine. The message "Welcome to IBM HTTP Server" indicates that the IBM HTTP server is installed correctly and running (Figure 1). Figure 1: IBM HTTP server welcome page - 9
4.3 Test the application server We will use First Steps panel to test the application server installation. First Steps starts automatically at the end of the installation. If it is not running, start First Steps from the command line on Windows NT or Windows 2000: %WAS_INSTALL_ROOT%\bin\firststeps.bat First Steps is a post-installation ease-of-use tool for directing WebSphere Application Server elements from one place. With all options present, you can use First Steps to start or stop the application server, verify the installation, access the InfoCenter, and some other options (Figure 2). Select Verify Installation from the First Steps panel and observe the results in the First Steps status window. A log file for the installation is created and stored in the logs directory with the name of ivt.log. You can also start the IVT tool from the bin directory on Windows NT or Windows 2000 platform: ivt. The IVT program starts the server automatically if the server is not running. Once the server initializes, the IVT runs a series of verification tests and reports pass or fail status in a console window. It also logs results to the install_root\logs\ivt.log file. If everything is installed properly and working fine, you will see output in the First Steps message window similar to the sample shown below: OS: Windows 2000 locale: en_ca hostname: saptemp cmd.exe /c "E:\Program Files\WebSphere\AppServer\bin\ivt" IVTL0095I: defaulting to host saptemp and port 9080 IVTL0010I: Connecting to the WebSphere Application Server saptemp on port: 9080 IVTL0020I: Could not connect to Application Server, waiting for server to start IVTL0025I: Attempting to start the Application Server osname = Windows 2000 IVTL0030I:Running cmd.exe /c "E:\Program Files\WebSphere\AppServer\bin\startServer" server1 >ADMU0116I: Tool information is being logged in file E:\Program > Files\WebSphere\AppServer\logs\server1\startServer.log >ADMU3100I: Reading configuration for server: server1 >ADMU3200I: Server launched. Waiting for initialization status. >ADMU3000I: Server server1 open for e-business; process id is 2668 IVTL0050I: Servlet Engine Verification Status - Passed IVTL0055I: JSP Verification Status - Passed IVTL0060I: EJB Verification Status - Passed IVTL0070I: IVT Verification Succeeded IVTL0080I: Installation Verification is complete - 10
Figure 2: WebSphere Application Server First Steps - 11
5. Installing WPT Web Performance Tools (WPT) is a set of applications that allow a user to test a Web application. The application is a high-performance, simple, threaded HTTP engine capable of simulating hundreds of HTTP clients using a highly configurable set of directives in a human readable and easily modified configuration file. This section describes how to install and test drive the tool. 5.1 Set up WPT The installation of WPT is relatively straightforward. Just run the downloaded install program, WPT-1.9.3.2.exe, and follow the InstallShield wizard. 5.2 Test the installation To test the WPT installation, start the HTTP server and run the test script that comes with the installation against the server. net stop IBM HTTP Server 1.3.26 net start IBM HTTP Server 1.3.26 cd %WPTHome%\bin stress -config..\config\stress.acf -host %Hostname% After the run, statistic summary will be generated. The sample output below shows a run duration of 25 seconds and a throughput of 80 pages per second without any errors. AKstress Process Statistics Uptime: 0 hours 0 minutes 25 seconds Number of Clients: 1 Pages Attempted: 2000 Pages To Be Attempted: 2000 Pages per second: 80.00 Requests completed: 2000 Requests per second: 80.00 Failed Connections (*): 0 Incorrect response codes (!): 0 Content verification failed (#): 0 Request write failures (?): 0 Number of early server closes (C): 0 Number of timeouts (^): 0 SSL handshake failures (): 0 Page statistics for page Page1 Successes: 1 Min time (milliseconds): 41 Max time (milliseconds): 41 Mean time (milliseconds): 41 Page statistics for page Page2 Successes: 1999 Min time (milliseconds): 10-12
Max time (milliseconds): 40 Mean time (milliseconds): 12 Request statistics for request /index.html (cverifyrequest1) Successes: 2000 Connects: 2000 Return Code Failures: 0 Early Server Closes: 0 Content Verification Failures: 0 Timeouts: 0 Connect Min time (milliseconds): 0 Connect Max time (milliseconds): 31 Connect Mean time (milliseconds): 3 Min time (milliseconds): 0 Max time (milliseconds): 40 Mean time (milliseconds): 8 Mean time (second calc) (milliseconds): 8.75 Standard Deviation (milliseconds): 3.44 stress - execution complete The WPT installation comes with a test script, stress.acf, which is put under the config directory. The script simply simulates a single client issuing 2000 HTTP requests to the default index.html page. - 13
6. Setting up Trade3 This section covers the steps used to install the Trade3 application, populate the Trade3 database and then test Trade3 from the browser. 6.1 Install Trade3 After you download the Trade3 kit [1] and unzip the kit to a local directory, perform the following procedures in order to set it up properly: REM Step 1 - Prepare for installation cd %WasHome%\bin stopserver server1 startserver server1 REM Step 2 - (DB2) Create the DB2 database for Trade3 cd %Trade3KitHome% db2 -v db2stop db2 -v db2start db2 -v drop db trade3db db2 -v create db trade3db db2 -v connect to trade3db user %Login% using %Pwd% db2 -tvf DB2\Table.ddl db2 -v terminate cd %Db2Home%\bnd db2 -v connect to trade3db user %Login% using %Pwd% db2 -v bind @db2cli.lst blocking all grant public db2 -v terminate REM Step 3 - Install, configure and start Trade3 application and resources cd %Trade3KitHome% REM Create Resources %WasHome%\bin\wsadmin -f createtrade3jmsresources.jacl %NodeName% %WasHome%\bin\wsadmin -f createtrade3rdbmsresources.jacl db2 %NodeName% %Db2Home%/java/db2java.zip %Login% %Pwd% REM Install the Trade application %WasHome%\bin\ws_ant -f Trade3.xml uninstall %WasHome%\bin\ws_ant -f Trade3.xml installapp %WasHome%\bin\stopServer server1 %WasHome%\bin\startServer server1 The first step prepares the application server for the installation. In the example, the default server, server1, is started (Trade3 will be installed on server1). You must start the application server before the application can be installed. - 14
The second step creates the Trade3 backend database. In our example, the database created is trade3db, and the tables are created from the Table.ddl file provided by the Trade3 kit. The bind command binds the necessary packages to the database, although most environments have auto binding enabled. The last step installs the Trade3 application and the required resources. The Trade3 kit includes a collection of Jacl and Ant scripts to simplify the Trade3 installation. In the example above, WebSphere administration tool, wsadmin, is used to create the Trade3 resources (data source and JMS factories) from the Jacl scripts. Note that forward slash is used to specify the location of the DB2 database driver db2java.zip. WebSphere Ant tool is used to install Trade3 from the Ant script. Please make sure that during each step, there is error free in the run output. If an error is detected, the install script can be re-run when the problem is resolved. For more detailed instructions, please refer to the Readme.html file in the trade3 installation package. At this point, Trade3 application should be also started successfully. 6.2 Load Trade3 database To load the Trade3 database, navigate to http://localhost:9080/trade/, follow the Configuration link, and select (Re)-populate Trade Database. Trade3 provides a very good Web interface for benchmark administration. This link is used initially to populate or re-populate the Trade database with fictitious users (such as uid:0, uid:1,...) and stocks (such as s:0, s:1,...). By default, Trade3 creates 500 users and 1000 stocks. All existing users and stocks are deleted if necessary. The database is then populated with a new set of test data. You should become familiar with other Trade3 configuration utilities, and understand other configuration parameters. You can do this by reading the pages at http://localhost:9080/trade/, as shown in Figure 3. - 15
Figure 3: Trade3 configuration page 6.3 Test Trade3 set up To test the Trade3 setup, navigate to http://localhost:9080/trade/, follow the Go Trade link, and click the Log in button. At this point all of the trading operations can be tested such as buy, sell, get quote, etc. - 16
Figure 4: Trade3 Login page to start testing 6.4 Database tuning Database tuning must be done in a case-by-case basis. The Trade3 readme documentation provides an important piece of tuning advice, performing a reorgchk after database population. You should consult DB2 OLTP Tuning Tips [3], written by IBM DB2 performance experts, for more advanced tuning techniques. - 17
7. Test drive At this point, the system is all set to go. To quickly kick off a run, issue the following commands from a command window. %WasHome%\bin\stopserver server1 db2 -v db2stop %WasHome%\bin\startserver server1 db2 v db2start cd %WPTHome%\bin stress -config..\config\trade3.acf -host %Hostname%:9080 The trade3.acf WPT script (listed in the appendix) simulates two concurrent users with one-second think time for a run duration of 300 seconds. The parameters in the script are for test drive purpose only and can easily be modified to suit different workload requirements. You can find more information about the directives in the configuration file in the user documentation. The script defines a single URL pointing to the /trade/scenario alias. When a request is sent to the alias, the trade scenario servlet will randomly pick an action to perform, which is generic to any traffic generator. The HTTP port 9080 is used to address the embedded web server inside WebSphere. In a high-performance environment, it would be more desirable to use the external IBM HTTP Server running on port 80. After a benchmark run, the "Reset" link on the Trade3 configuration page should be clicked. This link performs various verification tests on the Trade3 database to ensure performance consistency. The link also resets the database data to a correct starting point for the next benchmark run. The Trade3 documentation included in the Web application describes in detail this and other Trade3 configuration settings and parameters for performance and verification testing. - 18
8. Conclusion The WebSphere performance benchmark sample provides a suite of IBM-developed workloads for characterizing performance of the WebSphere Application Server. The workloads consist of an end-to-end Web application and a full set of primitives. They provide versatile and portable test cases designed to measure aspects of scalability and performance. Trade3 is the third generation of the WebSphere end-to-end benchmark and performance sample application. The new Trade3 benchmark has been re-designed and developed to cover WebSphere's significantly expanding programming model. This article explains the process of getting Trade3 up and running with WebSphere Application Server DB2 UDB Enterprise Edition in a single-node topology. This article provides users with clear and simple instructions in one place to install all the products needed to get a running Trade3 application. Further, this article introduces a powerful performance testing tool (WPT), and briefly demonstrates how to use and configure this testing tool to drive Trade3. The focus of this article is to help such readers get a functionally running application (Trade3) in the WebSphere and DB2 environment, using the minimum required resources. Performance tuning is not covered in this paper. For more information in capacity planning, performance tuning and evaluation, please refer to the respective product manuals and other related publications. 9. References [1] IBM, IBM WebSphere Performance Benchmark sample Trade3, at http://www-3.ibm.com/software/webservers/appserv/benchmark3.html [2] IBM, WPT, at http://www.alphaworks.ibm.com/tech/wptools [3] Yongli An and Peter Shum, DB2 Tuning Tips for OLTP Applications at http://www7b.boulder.ibm.com/dmdd/library/techarticle/anshum/0107anshum.html - 19
Appendix A Trade3.acf global_settings Clients 2 ThreadsPerClient 4 # TotalPageRequests 25000 TimedRun 300 (seconds) RampUp ThinkMinimum 1 seconds ThinkMaximum 1 seconds ErrorLog error.log CookieCache on PurgeCookieCache off CookieIgnoreDefaultExpires on RequestTimeout 30 seconds end_global_settings stats_definition RequestStatistics on PageStatistics on PageLog page.log RequestLog request.log SummaryLog summary.log end_stats_definition security_definition # SSLKeyfile key.kdb # SSLStashfile key.sth end_security_definition header_definition header0 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */* Referer: http://pizza26:9080/trade/app?action=logout Accept-Language: en-us Content-Type: application/x-www-form-urlencoded Connection: Keep-Alive User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) Host: <<HOST>> Pragma: no-cache end_header_definition request_definition request0 Header header0 Method POST URI /trade/scenario Protocol HTTP/1.0 ResultCode 200-20
end_request_definition start_page page0 Request request0 end_page_definition About the authors Yongli An, DB2 UDB Performance Engineer, IBM Certified Solutions Expert DB2 UDB 7.1 Database Administration for UNIX, Windows and OS/2, and DB2 7.1 Family Application Development. Yongli is experienced in TPC-C and WebSphere benchmarking. His current focus is DB2 performance for WebSphere Advanced Server and e-business applications. You can reach him at yongli@ca.ibm.com Tony Lau is an IBM certified Systems Expert. He earned his Bachelor Degree of Applied Science in computer engineering from the University of Waterloo. He is an active member in UW Alumni. His current focus is DB2 performance for WebSphere and e- business applications. You can reach him at t3lau@alumni.uwaterloo.ca. Trademarks The following terms are trademarks or registered trademarks of the IBM Corporation in the United States and/or other countries: IBM, DB2, DB2 UDB, DB2 Universal Database, OS/2, WebSphere, xseries. Windows and Windows-based trademarks and logos are trademarks or registered trademarks of Microsoft Corp. Unix and Unix-based trademarks and logos are trademarks or registered trademarks of The Open Group. Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. Other company, product or service names may be the trademarks or service marks of others. - 21