Implementing and Optimizing Sun’s ECperf Benchmark with BEA WebLogic Server Samuel D. Kounev Prof. Dr. Alejandro P. Buchmann

Slides:



Advertisements
Similar presentations
Technical University of Darmstadt J2EE Performance and Scalability – From Measuring to Predicting Samuel Kounev Databases and Distributed Systems Group,
Advertisements

Jonathan Maron Principal Product Manager Oracle Corporation.
Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
Performance Testing - Kanwalpreet Singh.
Web Performance Tuning Lin Wang, Ph.D. US Department of Education Copyright [Lin Wang] [2004]. This work is the intellectual property of the author. Permission.
Introduction to DBA.
Capacity Planning and Predicting Growth for Vista Amy Edwards, Ezra Freeloe and George Hernandez University System of Georgia 2007.
An architecture for webb applications, J2EE
Technical Architectures
1 James Lynn Hewlett-Packard Middleware Division EJB Architecture Design Strategies and Performance Optimizations.
Enterprise Applications & Java/J2EE Technologies Dr. Douglas C. Schmidt Professor of EECS.
Enterprise Java Beans Welcome to the world of “Distributed System” Presented By: Sameer Nanda Date: 12/17/03.
Transaction Management and Concurrency Control
Copyright W. Howden1 Lecture 19: Intro to O/O Components.
The Architecture of Transaction Processing Systems
J2EE Kenneth M. Anderson CSCI Web Technologies October 3, 2001.
Introduction to EJB INFORMATICS ENGINEERING – UNIVERSITY OF BRAWIJAYA Eriq Muhammad Adams J
© 2004 IBM Corporation BEA WebLogic Server Introduction and Training.
Transaction. A transaction is an event which occurs on the database. Generally a transaction reads a value from the database or writes a value to the.
February 11, 2003Ninth International Symposium on High Performance Computer Architecture Memory System Behavior of Java-Based Middleware Martin Karlsson,
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
Understanding and Managing WebSphere V5
Emmanuel Cecchet et al.  Performance Scalability of J2EE application servers.  Test effect of: ◦ Application Implementation Methods ◦ Container Design.
Computer System Lifecycle Chapter 1. Introduction Computer System users, administrators, and designers are all interested in performance evaluation. Whether.
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
Enterprise Java Beans CS-422. Application Servers In the late 1980s and though the mid 1990s a number of corporations (Broadvision, Netscape…) marketed.
PowerTier EJB in High-Performance Applications John Killoran European Technical Services Manager Persistence Software.
Enterprise Java Beans - (EJB)
Ing. Ignacio Roqueta ARTech GeneXus and J2EE.
Entity Beans BMP Celsina Bignoli
Middleware Technology (J2EE/EJB) Entity Bean. 2 Introduction to Entity Beans Persistence Concepts Entity beans are persistent objects that can be stored.
Container-Managed Persistence (CMP) Entity Beans Lesson 3A / Slide 1 of 42J2EE Server Components Objectives In this lesson, you will learn to: Identify.
The Triad of Beans I Oleh: Dini Addiati ( ) Fahrurrozi Rahman ( Y) Irfan Hilmy ( ) Salman Azis A ( ) Aziiz Surahman.
Enterprise JavaBeans. Lesson 1: Introduction to Server-Side Component Software.
EJB Framework.  As we know, EJB is the center of the J2EE architecture that provides a sturdy framework for building enterprise applications. The major.
JavaOne '99 Confidential Performance and Scalability of EJB-based applications Sriram Srinivasan Principal Engineer, BEA/WebLogic.
Enterprise Java Beans Java for the Enterprise Server-based platform for Enterprise Applications Designed for “medium-to-large scale business, enterprise-wide.
© Dennis Shasha, Philippe Bonnet – 2013 Communicating with the Outside.
Guide to Linux Installation and Administration, 2e1 Chapter 2 Planning Your System.
Software Performance Testing Based on Workload Characterization Elaine Weyuker Alberto Avritzer Joe Kondek Danielle Liu AT&T Labs.
Measuring Application Server Performance using ECperf David Lucas President Lucas Software Engineering, Inc
Hibernate Persistence. What is Persistence Persist data to database or other storage.  In OO world, persistence means persist object to external storage.
Collaborate Lesson 4C / Slide 1 of 22 Collaborate Knowledge Byte In this section, you will learn about: The EJB timer service Message linking in EJB 2.1.
Assignment of JAVA id : BSSE-F10-M-10-JAVA1 Overview of J2EE/Session 2/Slide 1 of 38.
EJB Overview: Constraint Types and Enforcement in JBoss Elissa Newman Fluid Meeting 6/3/04.
AMQP, Message Broker Babu Ram Dawadi. overview Why MOM architecture? Messaging broker like RabbitMQ in brief RabbitMQ AMQP – What is it ?
Java Message Service (JMS) Web Apps and Services.
Introduction to EJB. What is an EJB ?  An enterprise java bean is a server-side component that encapsulates the business logic of an application. By.
Java Programming: Advanced Topics 1 Enterprise JavaBeans Chapter 14.
13 Copyright © 2004, Oracle. All rights reserved. Managing Persistent Data in the Business Tier Entity EJBs.
Oracle Architecture - Structure. Oracle Architecture - Structure The Oracle Server architecture 1. Structures are well-defined objects that store the.
Enterprise JavaBeans. Lesson 1: Introduction to Server-Side Component Software.
Lock Tuning. Overview Data definition language (DDL) statements are considered harmful DDL is the language used to access and manipulate catalog or metadata.
EJB Enterprise Java Beans JAVA Enterprise Edition
Interstage BPM v11.2 1Copyright © 2010 FUJITSU LIMITED INTERSTAGE BPM ARCHITECTURE BPMS.
The Holmes Platform and Applications
Netscape Application Server
SPECjAppServer2004 Scott Oaks Java Enterprise Performance.
Web Technologies IT230 Dr Mohamed Habib.
Transaction Management and Concurrency Control
Introduction to J2EE Architecture
Migration Strategies – Business Desktop Deployment (BDD) Overview
Objectives In this lesson, you will learn to:
Understanding and Designing with EJB
Web Application Server 2001/3/27 Kang, Seungwoo. Web Application Server A class of middleware Speeding application development Strategic platform for.
Entity Beans B.Ramamurthy 2/17/2019 BR.
Knowledge Byte In this section, you will learn about:
Component-based Applications
Understanding and Designing with EJB
Transactions and Concurrency
Presentation transcript:

Implementing and Optimizing Sun’s ECperf Benchmark with BEA WebLogic Server Samuel D. Kounev Prof. Dr. Alejandro P. Buchmann Darmstadt University of Technology Department of Computer Science Databases and Distributed Systems Group

13. Nov. 2001© S. Kounev, A. Buchmann2 Agenda The ECperf Benchmark The ECperf Business Model The ECperf Application Design Our Deployment Environment The ECperf Persistence Bottleneck Eliminating the Persistence Bottleneck Evaluating the Performance Speedup Entity Bean Optimization Tips Other Optimization Tips Summary of Lessons Learned and Take-Away Points

13. Nov. 2001© S. Kounev, A. Buchmann3 The ECperf Benchmark Composed of a Specification and a Toolkit Measures Performance and Scalability of J2EE Appl. Servers Hosted on Built in conjunction with Appl. Server Vendors under the JCP Non-exhaustive list of ECperf Expert Group members:

13. Nov. 2001© S. Kounev, A. Buchmann4 MANUFACTURING DOMAIN Planned Lines Large Order Line Parts Widgets Transactions: - Schedule Work Order (TXs) - Update Work Order - Complete Work Order - Create Large Order CUSTOMER DOMAIN Order Entry Application TXs: - Place Order - Change Order - Get Order Status - Cancel Order - Get Customer Status Create Large Order CORPORATE DOMAIN Customer, Supplier, and Parts Info TXs: - Check Credit - Get Percent Discount - New Customer SUPPLIER DOMAIN TXs: - Send Purchase Order - Deliver Purchase Order Purchase Parts Deliver Parts The ECperf Business Model

13. Nov. 2001© S. Kounev, A. Buchmann5 The ECperf Application Design Benchmark Components: 1. ECperf EJBs - J2EE Application deployed on the System Under Test (SUT) 2. Supplier Emulator - a servlet simulating interactions with external Suppliers 3. ECperf Driver - a multithreaded Java Appl. running on a Client Machine RDBMS for Persistence - both Container Managed Persistence (CMP) and Bean Managed Persistence (BMP) supported Benchmark’s Throughput function of chosen Transaction Injection Rate - Ir Performance Metric provided is BBops/min = total number of business TXs completed in the Customer Domain + total number of workorders completed in the Manufacturing Domain, normalized per minute. EJB X BuyerSes EJB Container EJB Y EJB Z ReceiverSe s EJB Z SUT Web Container Supplier Emulator Emulato r Servlet Ecperf Driver Client JVM Internet

13. Nov. 2001© S. Kounev, A. Buchmann6 Our Deployment Environment Client PC running the ECperf Driver RedHat Linux 7.1, 192 MB RAM LAN RDBMS: Informix Dynamic Server ECperf Database Solaris 7, SUN Ultra Sparc II, Dual CPU, 2 GB MM ECperf Supplier Emulator Deployed on Web Logic Server 6.1 Solaris 7, SUN Ultra Sparc II, Single CPU, 1 GB MM SUT - System Under Test ECperf EJBs deployed on Web Logic Server 6.1 Solaris 7, SUN Ultra Sparc II, Dual CPU, 2 GB MM

13. Nov. 2001© S. Kounev, A. Buchmann7 The ECperf Persistence Bottleneck Deploying ECperf out-of-the-box we ran into the following problem: - There was extremely high data contention leading to data thrashing - Most transactions were being aborted either because of deadlocks or timeouts - As a result we couldn’t scale the benchmark beyond Ir = 2 Monitoring the database we observed that: - The scheduleWorkOrder transaction of the WorkOrderSes EJB was taking relatively long to complete - Most lock conflicts were occurring for the M_WORKORDER and S_PURCHASE_ORDER(LINE) tables and their indexes To reduce data contention and eliminate the bottleneck we: - Decreased the Locking Granularity - set record-level locking - Decreased the Transaction Isolation Level - configured all beans to use SQL COMMITTED_READ isolation - Applied Transaction Chopping - broke down the scheduleWorkOrder transaction into smaller transactions

13. Nov. 2001© S. Kounev, A. Buchmann8 Eliminating the Persistence Bottleneck Breaking down the scheduleWorkOrder transaction proved crucial scheduleWorkOrder proceeds as follows (simplified): –Create a new work order insert a new row in the M_WORKORDER table –Process the work order (stage 1 processing) get the Bill of Materials needed assign required parts from inventory –If new parts need to be purchased create a purchase order - PO insert new rows in the S_PURCHASE_ORDER(LINE) tables send the new purchase order to the Supplier Emulator (through HTTP) Problem 1: Sending the purchase order (the last step) delays the transaction while holding locks on the inserted table and index entries Problem 2: The sending step is not undoable. If transaction is aborted after sending the order, we later get components delivered for which no purchase order exists

13. Nov. 2001© S. Kounev, A. Buchmann9 Eliminating the Persistence Bottleneck (continued) Solution: Move the PO sending step into a separate transaction and make it execute asynchronously Two variants for sending purchase orders implemented: –Quick Fix: A new agent implemented which periodically checks for new purchase orders and sends them to the Supplier Emulator –Long-term Messaging-based Solution - the PO sending step in scheduleWorkOrder replaced by sending a message to a WebLogic JMS queue containing the ID of the new purchase order that needs to be sent. A message-driven bean created to process incoming queue messages by sending respective Pos (depicted below): Web Container Supplier Emulato r Web Logic EJB Container WorkOrderSes WebLogic JMS Server PO ID JMS Queue Message-driven Bean

13. Nov. 2001© S. Kounev, A. Buchmann10 Proposed changes eliminated the bottleneck and lead to astounding performance gains in terms of throughput and concurrency as shown below: Eliminating the Persistence Bottleneck - Evaluation Graph shows measured BBops/min relative to the BBops/min obtained when running ECperf out-of-the-box with Ir = 1. Note: Here app. server becomes the bottleneck and not the database! All tests were run with a single WLS instance. We expect even better results if a multi-instance WLS cluster is run on the same hardware.

13. Nov. 2001© S. Kounev, A. Buchmann11 Our work was submitted as an official proposal to the ECperf Expert Group (see link below) Why were these problems not noticed before? –Tests were conducted with Oracle, which uses an optimistic multi-version concurrency control (CC) protocol. By contrast, Informix utilizes pessimistic locking-based CC, which performs worse under this workload. Both with Informix and Oracle our optimizations lead to some significant performance and scalability gains Expert Group vowed to address the problems we raised in the next version of ECperf For further details see: –“  Publications Link Eliminating the Persistence Bottleneck - Evaluation (continued)

13. Nov. 2001© S. Kounev, A. Buchmann12 Lifecycle of an Entity Bean instance: Entity Bean Optimization Tips Introduction Web Logic Server reads and writes persistent fields of entity beans from/to underlying storage using calls to ejbLoad() and ejbStore() By default ejbLoad() is called at transaction begin when the entity bean is first accessed and ejbStore is called at transaction commit Does Not ExistPooledReady {newInstance(), setEntityContext()} ejbHome() OR ejbFind() {ejbCreate(), ejbPostCreate()} OR {ejbActivate(), ejbLoad()}... ejbLoad() Business Method ejbStore()... {ejbStore(), ejbPassivate()} OR ejbRemove() unsetEntityContext()

13. Nov. 2001© S. Kounev, A. Buchmann13 Minimize database access calls - i.e. ejbLoad() and ejbStore() WLS offers 3 different concurrency strategies for entity beans that can be set in “weblogic-ejb-jar.xml” - Exclusive, Database and ReadOnly: –Use ReadOnly for beans that are never modified by an EJB client - this eliminates calls to ejbStore(). –Use Database for Read-Write beans - this defers concurrency control to the database and usually performs better than Exclusive. –For beans that are only occasionally updated use the so-called Read-Mostly Pattern - implement a read-only bean for reading and a separate read-write bean for updating, mapping both of them to the same underlying data. Entity Bean Optimization Tips Utilizing Container’s Caching Services

13. Nov. 2001© S. Kounev, A. Buchmann14 Running ECperf with Bean-Managed (as opposed to Container- Managed) Persistence) we observed much worse performance Reason: Entity bean’s data was being written to the database at every transaction commit, even if no changes had been made After adding code to check if data has been modified before accessing the database, throughput soared by at least a factor of 3 ! Further BMP Optimization Tips: –Always prepare SQL statements - the database caches prepared statements in compiled form and this leads to a significant performance speedup –Make sure all statements are closed properly - so that respective database cursors are closed and resources freed –When reading large amounts of data mainly for listing purposes, consider bypassing entity beans and reading directly through JDBC in session beans Entity Bean Optimization Tips Bean Managed Persistence (BMP)

13. Nov. 2001© S. Kounev, A. Buchmann15 Even after optimizing the BMP code, we were still getting lower performance than with CMP - difference reached up to 50%. Reason: WLS provides some automatic optimizations such as: –Individual beans are loaded with one database call as opposed to two (ejbFind and ejbLoad) with BMP –Loading a collection of N beans requires N+1 database calls with BMP, while with CMP the container can combine those calls into a single database call –The container minimizes database access at transaction commit - i.e. only modified entity bean fields are written to the database Therefore, as a general rule of thumb, use CMP instead of BMP whenever possible Entity Bean Optimization Tips Container Managed Persistence (CMP)

13. Nov. 2001© S. Kounev, A. Buchmann16 When multiple beans are involved in a transaction it is usually assumed that the container will invoke the database access calls for the beans in the same sequence as the respective beans are first accessed within the transaction. Accessing entity beans in different orders within different transactions could lead to deadlocks ! For example with ECperf deadlocks were detected when reading order items in different orders in the Change Order and Order Status transactions This problem was fixed in Update 1 of ECperf by making sure that order items are always stored and accessed in sorted order Take Away Point: To avoid deadlocks make sure that entity beans are always accessed in the same order throughout the whole application ! Entity Bean Optimization Tips Watch Out for Deadlocks

13. Nov. 2001© S. Kounev, A. Buchmann17 To improve initial response times: –Tune JDBC Connection Pool Size - set initial-capacity to the average number of concurrent client sessions that require JDBC connections –For every EJB tune the setting in the respective weblogic-ejb-jar.xml deployment descriptor Use the WLS Administration Console to monitor connection pools, bean pools, threads, transactions and other resources used during operation. At the same time use available tools and facilities to monitor all database servers in use. This might help you to discover subtle processing inefficiencies and scalability bottlenecks. Take a look at the Web Logic Performance and Tuning Guide for further tuning and optimization tips that are outside the scope of this presentation. Other Optimization Tips

13. Nov. 2001© S. Kounev, A. Buchmann18 Use CMP instead of BMP whenever possible Use the lowest isolation level that does not compromise data integrity Configure the database locking granularity properly Exploit container’s caching services to their full extent Always access entity beans in the same order in all transactions throughout the application Summary of Lessons Learned & Take Away Points

13. Nov. 2001© S. Kounev, A. Buchmann19 Make transactions as short as possible –Don’t allow a transaction to span user interactions, network communications or any other activities that might potentially take a long time. Execute long operations asynchronously. –With CMP, use WLS monitoring facilities to make sure that transactions are demarcated correctly - check the transaction attribute settings. Use Asynchronous Processing and Messaging instead of traditional Request-Reply Processing whenever possible - Messaging brings significant performance, scalability and reliability benefits. DON’T GIVE UP UNTIL YOU HAVE EXPLOITED YOUR PLATFORM TO ITS FULL POTENTIAL ! Summary of Lessons Learned & Take Away Points

Acknowledgements Samuel Kounev and Alejandro Buchmann acknowledge the many fruitful discussions with: Shanti Subramanyam, ECperf Specification Lead at Sun Microsystems, Inc. Akara Sucharitakul, ECperf group at Sun Microsystems, Inc. Dan Fishman, Head of BEA’s Research Lab Steve Realmuto, BEA’s Representative to the ECperf Expert Group Chris Beer, vice-chair of the Java subcommittee at SPEC and Compaq’s Representative to the ECperf Expert Group