28
Performance evaluation of J2EE Presented by: Presented by: Huahao Zhang (20256751) Huahao Zhang (20256751) Henry Xu (20198718) Henry Xu (20198718) July 12, 2007 ECE750 Topic 11 Component-Based Software Systems Instructor: Ladan Tahvildari

Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

Performance evaluation of J2EE

Presented by:Presented by:Huahao Zhang (20256751)Huahao Zhang (20256751)

Henry Xu (20198718)Henry Xu (20198718)July 12, 2007

ECE750 Topic 11Component-Based Software Systems

Instructor: Ladan Tahvildari

Page 2: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

Outline

1. IntroductionRelated background and terminologyThe problems and our study case

2. Our ApproachIntroduce the tools and environments The methods we used in the research

3. ResultsCurrent results we have achieved

4. SummarySummary of the methods and achieved results

Page 3: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

1. Introduction

J2EEJ2EE 5ProblemsPetStore

Page 4: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

J2EE

What is J2EE A standard Java platform for developing N-tier enterprise and component-based applications

Page 5: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

J2EE 5

What is new in J2EE 5A simplified programming model More XML and JavaScript (Ajax)JPA (Java Persistence API )

Page 6: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

Problems

Why J2EE1. Reduces development time2. Improves application performance (Really?)

Questions1. Does J2EE 5 improve application performance?2. What are the performance bottlenecks in J2EE5?

Page 7: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

Study Case: Pet Store

What is Pet StoreAn online shopping demo built based on Java EEplatform

Why Pet Store1. The most popular J2EE

project for evaluation2. Source code available

Page 8: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

2. Our approach

1. Setup J2EE 5 and deploy PetStore2.02. Analyze the MVC and other patterns3. Study the new Web2.0 techniques

Step 2 & 3 have been done by tracing the source code manually

4. Set up load testing environment5. Create test script and run load test6. Evaluate performance and find out the

bottlenecks in J2EE 5

Page 9: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

Step1: Setup J2EE and deploy PetStore

Download and install the Java EE5 SDK The SDK includes Sun Java System Application Server 9

Install NetBeans 5.5.1 IDEDownload and deploy Pet Store 2.0 (jar file)Open the PetStore project in NetBeans, modify the configuration files and then build the projectAfter the Java database and J2EE app server have been started, we can access the PetStore through http://localhost:8080/petstore

Page 10: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

Configuration files in PetStore

bp-project/build.properties (jdbc, j2ee home, username, password)

Page 11: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

Step2 & 3: Analyze the MVC pattern and study the new Web2.0 techniques

NetBeans IDE debug mode

User accesses the PetStore through a web browser

User clicks some links or input some text

Web browser client sends HTTP requests to the PetStore web server

Since the PetStore is run under debug mode in the NetBeans, we can debug the code step by step

Page 12: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

How to trace the source code

Set break points in source codeClick a link (e.g. Map), then the application will hit the break pointsUse the “step into”, “step over”and “run to cursor” options to trace the code step by stepUse the “New Watch” to trace the value of variantsDraw diagrams by using the UML2.0 provided by NetBeans to help understand the relationship between each component or Java class

Page 13: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

Step4: Setup load testing environment

Setup Load Runner 8.1Install Java profiler for NetBeans IDE

Page 14: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

Step5: Create scripts and run load testing

Create the testing scriptsRun load testCollect testing results

Page 15: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

Step6: Evaluate performance and find out bottlenecks

Analyze testing results of web performance testing (from Load Runner)Analyze testing results of JavaBeans and Java components (from Java profiler)Draw diagrams and summarize test resultsFind out the bottlenecks in J2EE

Page 16: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

3. Current results

MVC architecture and Session Façade patternAjax (Asynchronous JavaScript and XML) JSF (Java Server Faces)JTA (Java Transaction API )JPA (Java Persistence API )

Page 17: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

Model-View-Controller

Why MVC architecture?MVC is well-suited for interactive Web applicationsThe purpose of MVC is to separate the model from the viewChanges to the view can be implemented or even creates additional views

Page 18: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

①HttpRequest

② mb.categories

③cf.getCategories

④getCategory()

⑤getItem()

⑥ge

tAddre

ss()

⑦ getResultList⑧

Category, Addr

⑨ Select .JSP

⑩HttpResponse (HTML)

View Controller

Model

Page 19: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

Session Facade

Before Catalog Façade

After Catalog Façade

Page 20: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

DemoModel View Controller applied in PetStore2.0

http://129.97.121.188:8080/petstore2.0

Page 21: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

Web2.0 new feature: Ajax

What is AjaxA new web development technique for creating interactive web 2.0 applications

Why AjaxEnhances user experience( no waiting time)Client and server split MVC responsibilities

Internet services using AjaxGoogle, Youtube, Flickr, Amazon, etc

Page 22: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

Ajax: Thin client and rich client

Classic web application model1. Thin client2. The server renders every-

thing

Ajax application model1. A new Ajax engine is added

between the browser UI and the web server

2. A rich client, more logic is coded in JavaScript and run on the browser client

Page 23: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

Ajax: Synchronous and Asynchronous

Synchronous mode1. Browser sends requests to server2. When server is processing the request, client is waiting for response3. The whole page is refreshed

Ajax asynchronous model1. The Ajax engine creates requests 2. When server is processing, the User can continue other activities3. Only parts of the page is refreshed.

Page 24: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

DemoAjax: Autocomplete in PetStore

http://129.97.121.188:8080/petstore2.0

Page 25: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

Ajax: Autocomplete sequence

FacesServlet AutoCompleteBean

Ajax Engine

Send a HTTP request

WebBrowser Database

Search cities with ‘w’ being the first letter

Return results

The keyup() event

User

User types a ‘ w’

Continue other activies

Dispatch requests

City:

Return resultsHTTP

response in XML formatDecodes and

renders the XML results Display

cities

City:

Page 26: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

4. Summary

Setup the J2EE 5 and deploy PetStore2.0Analyze the MVC model and patternsStudy the new Web2.0 techniquesSet up load test environmentCreate test script and run load testEvaluate performance and find out the bottlenecks in J2EE 5

Page 27: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

References1. An Integrated Network Component Architecture Israel Ben-

Shaul, James W. Gish, and William Robinson, IEEE Software, Volume 15, Issue 5, pp. 79-87, September 1998

2. Introducing the Java Pet Store 2.0 Application, Early Accesshttp://java.sun.com/developer/technicalArticles/J2EE/petstore

3. Designing Enterprise Applications with the J2EE Platform, 2nd Edition, Sun Microsystems, 2002.

4. Designing Web Services with the J2EE 1.4 Platform: JAX-RPC, SOAP, and XML Technologies, Sun Microsystems, 2004.

5. Pro JSF and Ajax: Building Rich Internet Components, Jonas Jacobi and John R. Fallows, Apress, 2006.

6. Sun Developer Network (SDN) Referencehttp://java.sun.com/reference/blueprints/index.html

Page 28: Performance evaluation of J2EE - University of Waterlooltahvild/courses/ECE750-11-S07/... · Performance evaluation of J2EE Presented by: Huahao Zhang (20256751) Henry Xu (20198718)

Q&A

Thank you!