performance modeling and prediction of enterprise javabeans with layered queuing network templates

22
Performance Modeling and Prediction of EJBs based on LQN Templates SAVCBS’05 06 Sep 2004 Performance Modeling and Prediction of Enterprise JavaBeans with Layered Queuing Network Templates Jing Xu Alexandre Oufimtsev Murray Woodside Liam Murphy Carleton University University College Dublin University College Dublin An Coláiste Ollscoile, Baile Átha Cliath

Upload: seda

Post on 24-Jan-2016

33 views

Category:

Documents


0 download

DESCRIPTION

University College Dublin An Coláiste Ollscoile, Baile Átha Cliath. Performance Modeling and Prediction of Enterprise JavaBeans with Layered Queuing Network Templates. Jing XuAlexandre Oufimtsev Murray WoodsideLiam Murphy Carleton UniversityUniversity College Dublin. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Performance Modeling and Prediction of Enterprise JavaBeans with Layered Queuing Network Templates

Performance Modeling and Prediction of EJBs based on LQN Templates SAVCBS’05 06 Sep 2004

Performance Modeling and Prediction of Enterprise

JavaBeans with Layered Queuing Network Templates

Jing Xu Alexandre OufimtsevMurray Woodside Liam MurphyCarleton University University College Dublin

University College DublinAn Coláiste Ollscoile,Baile Átha Cliath

Page 2: Performance Modeling and Prediction of Enterprise JavaBeans with Layered Queuing Network Templates

Performance Modeling and Prediction of EJBs based on LQN Templates SAVCBS’05 06 Sep 2004 page 2

Motivation and Approach

Motivation: Performance analysis should be done in early stage of

design (otherwise you going to pay for it…) Modeling J2EE is non-trivial

Approach: Define LQN templates for different types of EJBs Construct a model of real-life application by instantiating

the templates and composing them Profile and calibrate the model from app. traces Perform measurements on the real running application Compare model prediction with measurement results

Page 3: Performance Modeling and Prediction of Enterprise JavaBeans with Layered Queuing Network Templates

Performance Modeling and Prediction of EJBs based on LQN Templates SAVCBS’05 06 Sep 2004 page 3

LQN: what and why?

LQN ( Layered Queuing Network) Is a performance modeling language Models system resources and behaviour in an intuitive way Allows nested software structure and composition with

component concepts Captures resource contentions effectively Does not suffer from state explosion problem Provides Analytical & Simulation solver

Ref on LQN

http://www.sce.carleton.ca/rads/lqn/lqn-documentation/

Page 4: Performance Modeling and Prediction of Enterprise JavaBeans with Layered Queuing Network Templates

Performance Modeling and Prediction of EJBs based on LQN Templates SAVCBS’05 06 Sep 2004 page 4

A LQN model of a 3-tier System

Client (1-20)

CustomerBean

Databaseread

[$read]

CustomerControllerBean

update[$update] DBCPU

AppCPU

invokeSetEmailfindstore

updateEmail

Client [$ThinkTime] ClientCPU

Client

Application Server

Database

Page 5: Performance Modeling and Prediction of Enterprise JavaBeans with Layered Queuing Network Templates

Performance Modeling and Prediction of EJBs based on LQN Templates SAVCBS’05 06 Sep 2004 page 5

Introduction of EJB

Core technology of J2EE Server-side component architecture

Container

Bean

Database

Home Interface

Component Interface

m

Function request

Entity Bean

Session Bean (Stateful/Stateless)

Message Driven Bean

Page 6: Performance Modeling and Prediction of Enterprise JavaBeans with Layered Queuing Network Templates

Performance Modeling and Prediction of EJBs based on LQN Templates SAVCBS’05 06 Sep 2004 page 6

LQN Component Model Template for Session Bean (Stateless)

Container (inf)

prepareBean [$s_prepareBn]

Bean Thread Pool ($M)

getThread [$s_getThread]

ContServ (1)

invokeMethod [$s_checkAccess]

activebean (inf)

busiMethod [$s_method]

methodInvoke

transactionService serviceRequest

($ptranx) ($pextServ)

Page 7: Performance Modeling and Prediction of Enterprise JavaBeans with Layered Queuing Network Templates

Performance Modeling and Prediction of EJBs based on LQN Templates SAVCBS’05 06 Sep 2004 page 7

LQN Component Model Template for Session Bean (Stateless)

Container (inf)

prepareBean [$s_prepareBn]

Bean Thread Pool ($M)

getThread [$s_getThread]

ContServ (1)

invokeMethod [$s_checkAccess]

activebean (inf)

busiMethod [$s_method]

methodInvoke

transactionService serviceRequest

($ptranx) ($pextServ)

Page 8: Performance Modeling and Prediction of Enterprise JavaBeans with Layered Queuing Network Templates

Performance Modeling and Prediction of EJBs based on LQN Templates SAVCBS’05 06 Sep 2004 page 8

LQN Component Model Template for Session Bean (Stateless)

Container (inf)

prepareBean [$s_prepareBn]

Bean Thread Pool ($M)

getThread [$s_getThread]

ContServ (1)

invokeMethod [$s_checkAccess]

activebean (inf)

busiMethod [$s_method]

methodInvoke

transactionService serviceRequest

($ptranx) ($pextServ)

Page 9: Performance Modeling and Prediction of Enterprise JavaBeans with Layered Queuing Network Templates

Performance Modeling and Prediction of EJBs based on LQN Templates SAVCBS’05 06 Sep 2004 page 9

LQN Component Model Template for Session Bean (Stateless)

Container (inf)

prepareBean [$s_prepareBn]

Bean Thread Pool ($M)

getThread [$s_getThread]

ContServ (1)

invokeMethod [$s_checkAccess]

activebean (inf)

busiMethod [$s_method]

methodInvoke

transactionService serviceRequest

($ptranx) ($pextServ)

Page 10: Performance Modeling and Prediction of Enterprise JavaBeans with Layered Queuing Network Templates

Performance Modeling and Prediction of EJBs based on LQN Templates SAVCBS’05 06 Sep 2004 page 10

LQN Component Model Template for Session Bean (Stateless)

Container (inf)

prepareBean [$s_prepareBn]

Bean Thread Pool ($M)

getThread [$s_getThread]

ContServ (1)

invokeMethod [$s_checkAccess]

activebean (inf)

busiMethod [$s_method]

methodInvoke

transactionService serviceRequest

($ptranx) ($pextServ)

Page 11: Performance Modeling and Prediction of Enterprise JavaBeans with Layered Queuing Network Templates

Performance Modeling and Prediction of EJBs based on LQN Templates SAVCBS’05 06 Sep 2004 page 11

LQN Component Model Template for Session Bean (Stateful)

Passivate/Activate [$s_callback]

(1-$p)

prepareBean [$s_prepareBn]

ContServ (1)

CallBack (1)

Container (i)

homeRemove [$s_cremove]

busiMethod [$s_method]

create [$s_create]

remove [$s_remove]

homeCreate [$s_ccreate]

invokeMethod [$s_checkAccess]

Bean Thread Pool ($M)

($pextServ)

($ptranx)

Page 12: Performance Modeling and Prediction of Enterprise JavaBeans with Layered Queuing Network Templates

Performance Modeling and Prediction of EJBs based on LQN Templates SAVCBS’05 06 Sep 2004 page 12

LQN Component Model Template for Entity Bean

Container (inf)

invokeMethod [$s_checkAccess]

Instance (1)

instanceMethod [0] }$I replicas

Bean Thread Pool ($M)

(1-$p)

prepareBean [$s_prepareBn]

ContServ (1)

1

(1/$I)

getThread [$s_getThread]

1

busiMethod [$s_method]

activebean (inf)

passivate [$s_passiv]

activate [$s_activ]

load [$s_load]

store [$s_store]

(1-$p)

homeFinder [$s_cfind]

homeCreate [$s_ccreate]

homeRemove [$s_cremove]

instanceRemove [0]

getThreadForR [$s_getThreadR]

getThreadForC [$s_getThreadC]

1/$I

1

1

1 1

(1-$p)

remove [$s_remove]

create [$s_create]

1 1 1

store

serviceRequest

methodInvoke remove create find

updateDB

readDB

storeEntity [$s_cstore]

1 1

Page 13: Performance Modeling and Prediction of Enterprise JavaBeans with Layered Queuing Network Templates

Performance Modeling and Prediction of EJBs based on LQN Templates SAVCBS’05 06 Sep 2004 page 13

Example Application – Duke’s Bank

Standard J2EE sample application by Sun’s Microsystems, shipped with every J2EE tutorial

Modifications CMP instead of BMP; multiple users support; stateful SB converted to stateless SB; artificial congestion at the pool/cache

Running on MySQL, JBoss, Sun’s JVM

Page 14: Performance Modeling and Prediction of Enterprise JavaBeans with Layered Queuing Network Templates

Performance Modeling and Prediction of EJBs based on LQN Templates SAVCBS’05 06 Sep 2004 page 14

Testing Scenario: Update Customer Information

Client <<Stateless Session Bean>>CustomerController

updateEmail(…)

sd updateCustomerInfo

<<Entity Bean>>Customer

findByPrimaryKey()

setEmail()

Page 15: Performance Modeling and Prediction of Enterprise JavaBeans with Layered Queuing Network Templates

Performance Modeling and Prediction of EJBs based on LQN Templates SAVCBS’05 06 Sep 2004 page 15

Testing Scenario

Data access pattern: Sequential access vs. Random access

Scenario:

Gradually increasing workload from 1 to 20 users with step size 1. Each user: Updates each customer record in ascending order (300

records in total); Waits for other clients to finish; Updates a random customer record 300 times; Waits for other clients to finish.

Page 16: Performance Modeling and Prediction of Enterprise JavaBeans with Layered Queuing Network Templates

Performance Modeling and Prediction of EJBs based on LQN Templates SAVCBS’05 06 Sep 2004 page 16

High Level LQN Model for the Scenario

Client (1-20)

CustomerBean

Databaseread

[$read]

CustomerControllerBean

update[$update] DBCPU

AppCPU

invokeSetEmailfindstore

updateEmail

Client ($ThinkTime) ClientCPU

Page 17: Performance Modeling and Prediction of Enterprise JavaBeans with Layered Queuing Network Templates

Performance Modeling and Prediction of EJBs based on LQN Templates SAVCBS’05 06 Sep 2004 page 17

LQN Component Model for Customer Controller

Stateless Session Bean

Container (inf)

prepareBean[$s_prepareBn]

Bean Thread Pool ($CntrM)

getThread[$s_getThread]

ContServ (1)

invokeSetEmail[$s_checkAccess]

CustomerControllerBean

updateEmail

setEmailfindCustomer

setEmail[$s_setEmail]

activebean (inf)

transactionService

Page 18: Performance Modeling and Prediction of Enterprise JavaBeans with Layered Queuing Network Templates

Performance Modeling and Prediction of EJBs based on LQN Templates SAVCBS’05 06 Sep 2004 page 18

LQN Component Model for Customer

Container (inf)

prepareBean[$s_prepareBn]

Bean Thread Pool ($M)

1

getThread[$s_getThread]

ContServ (1)

invokeSetEmail[$s_checkAccess]

1

activebean (inf)

SetEmail[$s_setEmail]

1

CustomerBean

findByPK[$s_cfind]

Instance(1)

instanceSetEmail[0] }$I

1/$I

storeEntity[$s_cstore]

activate[$s_activate]

passivate[$s_passivate]

load[$s_load]

store[$s_store]

Entity Bean store find invokeSetEmail

updateDB

readDB

Page 19: Performance Modeling and Prediction of Enterprise JavaBeans with Layered Queuing Network Templates

Performance Modeling and Prediction of EJBs based on LQN Templates SAVCBS’05 06 Sep 2004 page 19

Profiling and Model Calibration

Tool: JProbe profiler Calibration done using single-user profiling data 2 factors used for adjusting execution demand

parameters Profiling Ratio Factor (PFC): to remove overhead

introduced by the profiling tool Warm System Factor (WSF): to adjust the parameter

values obtained in cold system status to reflect the warm system behavior

Page 20: Performance Modeling and Prediction of Enterprise JavaBeans with Layered Queuing Network Templates

Performance Modeling and Prediction of EJBs based on LQN Templates SAVCBS’05 06 Sep 2004 page 20

System Measurement and Comparing with Model Prediction

Measured and predicted response times

0

20

40

60

80

100

120

0 5 10 15 20 25

no of clients

response time, msMeasurement - Sequential access Measurement - Random access

LQN - Sequential access LQN - Random access

Page 21: Performance Modeling and Prediction of Enterprise JavaBeans with Layered Queuing Network Templates

Performance Modeling and Prediction of EJBs based on LQN Templates SAVCBS’05 06 Sep 2004 page 21

Conclusion and Future Research

A procedure for constructing, calibrating, solving and analyzing models of real-life J2EE applications;

Investigate if the similar approach can be applied to other technologies such as .NET;

Extend our work to incorporate crucial parts of underlying software layers into models (JVM, OS).

Page 22: Performance Modeling and Prediction of Enterprise JavaBeans with Layered Queuing Network Templates

Performance Modeling and Prediction of EJBs based on LQN Templates SAVCBS’05 06 Sep 2004 page 22

Appendix A: System Measurement of Throughput

0

50

100

150

200

250

300

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

No of Clients

Throughput, cps