performance tuning of mda based platform & product niraj trivedi [email protected]

41
Performance Tuning of MDA Based Platform & Product Niraj Trivedi [email protected]

Upload: randolph-wilfred-manning

Post on 21-Dec-2015

216 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

Performance Tuning of MDA Based Platform & Product

Niraj Trivedi

[email protected]

Page 2: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

• Introduction to MDA based development platform

• Major performance issues encountered

• Setup of Performance Engineering Lab

• Categorization of Major performance issues

• Reference Model for Application Profiling & Tuning

• Root Cause Analysis

• Trade offs between ease of development and product

performance

Agenda

Page 3: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

Context / Introduction

We are going to talk about a platform that has resulted in..

Page 4: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

STG Insurance Suite – Analyst Recognition

Page 5: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

Market Recognition

5

Page 6: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

Platform (Design & Development Perspective)

Page 7: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

Platform – Design time components

4

Rules Engine

Object Modeler

Workflow Engine

UI Designer

Release Manager

Rate Builder

Product Modeler

EclipseJBOSS Rules

YAWLFlash

BuilderSVN

Editor Editor Plug In Plug In Plug In

ICM

ICD

CLM

Identify Modules to Build

Leverage Open Source Components

Build Plug Ins & Editors

Package to form ICM and ICD

Page 8: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

Platform – Runtime Components – Simplified View

8

Application Server

OS (AIX / Linux / Windows)

App Server (Jboss / WebSphere/…)

ICD/ICM Runtime Engine

(Uses Servlet Threads)

ICD/ICM Content

Database Server

OS (AIX / Linux / Windows)

RRDBMS(Oracle/ SQL Server/…)

Base Schemas

DatabaseConnectionPool

UI / Interface Components

SOAP, RESTful, Adobe Blaze

Page 9: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

Content & Runtime – Component details

9

ICD / ICM Content

Model Definition(XML)

Rules Definition (XML)

Workflow Definition (XML)

Instruction Step Defn(XML)

Runtime Engines

Model Load/Save/Map(ICD Engine)

Workflow Executor (YAWL Engine)

Rule Executor (Jboss/Drools)

Instruction Step Exec(ICD Engine)

UI Model Rendering(Flash Player)

UI Model Defn(MXML)

Page 10: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

MAJOR PERFORMANCE ISSUES

10

Page 11: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

Major Performance Issues

Performance of Business Process Execution (Single user mode)

Performance of Business Rules Execution (Single user mode)

Performance of Model Load and Save (Single user mode)

System unable to support required concurrency

System not able to scale horizontally and / or vertically

Page 12: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

SETUP OF PERFORMANCE ENGINEERING LAB

12

Page 13: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

13

Holistic Performance Engineering

ObjectivesRespTime Throughput Workload Utilization

Performance ModelingWorkload Service Time Q-Size Capacity Txns

Architecture & DesignAnti-Patterns Patterns Principles Frameworks Measuring, Testing, Tuning

Measuring Testing Tuning-Resp. Time - Load, - Demand-Throughput - Stress, - ServcTime- Workload - Endurance -

Capacity- Utilization -Ramp Up

Role

sA

rch

itect

D

evelo

per

Perf

En

gr

Test

En

gr

Life

Cycl

eR

eq

uir

em

en

ts

Desi

gn

Develo

p

Test

M

ain

tain

Page 14: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

Performance Engineering Lab - Resources

14

Platform Resources

Hardware IBM Power5,IBM Power7,DELL XEON,DELL R-810, R-820

OS AIXOracle Enterprise LinuxRedhat LinuxWindows Server

Application Server WebSphere, Weblogic,Jboss,Tomact

RDBMS Oracle,SQL Server

Load Generator Neoload, Loadrunner

Page 15: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

Performance Engineering Lab – Profiling & Investigation Tools

15

Category Tools

Application Profiling Jprofiler, JvisualVM,Hprof

Database Profiling Oracle AWR,Oracle Statpack,SQL Server Developer Studio

OS Level Nmon,Perfmon,Vmstat,Iostat,Netstat

Heap and Thread dump analysis

IBM Support Assistant

UI Profiling HttpWatch, Adobe Flex Premium Licenses

Page 16: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

Performance Engineering Lab - Roles

16

▪ Head, Performance Engineering Lab− Owns System Performance for product and product implementations− Ensure reasonable TCO by making system exhibit desirable performance

on reasonably sized hardware

▪ Performance Architects / Engineers− Performance Modeling − Performance Profiling, Investigation and Tuning− Create architecture, design and development guidelines for performance− Sizing for implementation

▪ Performance Test Managers− Manage end to end performance test− Transaction Matrix conversion to overall test plan

• Unit, Normal & Peak Load, Stress, Ramp-up etc.

▪ Performance Test Engineers− Deep expertize with Load generator tools – scripting and execution

Page 17: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

CATEGORIZATION OF PERFORMANCE ISSUES

17

Page 18: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

Categorization of Performance Issues

Platform Architecture & Design

Platform Code / Code Generation Related

Content - Platform Usage Related

Application Configuration

Environment Configuration & Sizing

Page 19: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

REFERENCE MODEL FOR PERFORMANCE PROFILING AND TUNING

19

Page 20: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

20

First Cut Performance Model Showing All Service Centers (1)

Network between FE and APP Tier

CPU Memory Disk

Network between App and DB Tier

CPU Memory Disk

CPU Memory Disk

FE Desktop

Web + AppServer

DBServer

Page 21: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

21

Revised Performance Model Showing Significant Service Centers (2)

Network between FE and APP Tier

CPU

Network between App and DB Tier

CPU

CPU Disk

FE Desktop

Web + AppServer

DBServer

Page 22: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

22

Revised Performance Model Showing Significant Service Centers (3)

Network between FE and APP Tier

CPU

Network between App and DB Tier

CPU

CPU Disk

FE Desktop

Web + AppServer

DBServer

App to APP Calls (local

Host)

Page 23: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

Content & Runtime – Component details

23

ICD / ICM Content

Model Definition(XML)

Rules Definition (XML)

Workflow Definition (XML)

Instruction Step Defn(XML)

Runtime Engines

Model Load/Save/Map(ICD Engine)

Workflow Executor (YAWL Engine)

Rule Executor (Jboss/Drools)

Instruction Step Exec(ICD Engine)

UI Model Rendering(MXML/FE)

Page 24: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

ROOT CAUSE ANALYSIS & SOLUTIONS

(A FEW CASE-STUDIES BRIEF)

24

Page 25: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

Root Cause Analysis – NB/Policy Issuance process is slower than expected

25

▪ Profiling tools used & Observations− Oracle OEM : No database related issues− Jprofiler: A lot of time spent in serialization/de-serialization of payload

objects

▪ Root Cause Determination− High number of Inter – JVM Calls between YAWL Engine and ICD Engine− High CPU time spent on serialization / deserialization of objects for

making inter jvm calls using http/SOAP protocol

▪ Solution− Convert YAWL engine based workflow to POJO− Make this part of ICD Engine

▪ Outcome− Designer has the flexibility to use YAWL engine editor to design the

workflow− Inter-JVM Calls eliminated− Need for serialization / deserialization eliminated− A new business process which used take a time upwards of 2 minutes

now completes in 3-5 seconds

Page 26: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

App Server In Process Workflow Engine

Use of External BPEL Engine for Technical Workflow

App ServerWorkflow/ BPEL

Engine

Initiate Process

Call Service 1

Call Service 2

Call Service 3

Call Service n

End Process

A Lot of calls across JVM boundary, N/W

Page 27: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

27

Link Performance

Typical Examples

Note Evaluation

WAN Low SOAP, REST, BlazeDS, RemoteEJB,RPC…

Protocol Having Less overhead

• Reduce Size of payload

• Reduce number of calls

LAN Medium SOAP, REST, BlazeDS, RemoteEJB,…

Protocol overhead for a single call not that significant

• Reduce Size of payload

• Reduce number of calls

Local host FAST SOAP, REST, BlazeDS, RemoteEJB,…

Protocol overhead for a single call not that significant

• Reduce Size of payload

• Reduce number of calls

IN PROC BEST IN CLASS

Function Call

FASTEST • Size of payload does not matter

• No of calls matters only if extra large

• Clone may be single largest issue

Evaluation Tips - Communication Link as a Service Center

Page 28: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

28

Learnings

▪ Use of External BPEL / Workflow engine is recommended for integration between disparate systems

▪ If you start using it for process orchestration / workflow design using a single enterprise class system' various servicing stages you are bound to run into performance issues

Page 29: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

Root Cause Analysis – Rule Execution is slower than expected

29

▪ Profiling tools used & Observations− Oracle OEM : No database related issues− Jprofiler:

► A lot of time spent in creation of java objects from SQL-Result Set► A lot of time spent in insertion and retrieval of large number of objects in agenda execution working

memory

▪ Root Cause Determination− At times rules are defined on coarse grained objects− It takes more time to fetch such objects from database and create corresponding

java objects to supply as input to rule execution− Passing all memory objects to drools engine in an attempt to simplify developer

life!

▪ Solution(s)− Rule definition on Granular objects / specially created object having exact input

data required for rule execution− Pass exact set of objects required to execute agenda instead of passing all

available

▪ Outcome− Having common fact objects between large scale batch processing and online

processing− Intelligence to scan required objects for agenda execution built-in

Page 30: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

Root Cause Analysis – Performance of Model Load is slower than expected (Search list)

30

▪ Profiling tools used & Observations− Oracle OEM : Large number of quick processing statements building up overall

time− Jprofiler: A lot of time spent in creation of java objects from SQL-Result Set− NMON : A Lot of data transfer over network

▪ Root Cause Determination− FE or App server based memory pagination simply chokes the system for higher

volumes− App Server based memory pagination usually triggered by business requirement

to filter data via business rules or display some aggregate counters− FE Server based memory pagination is usually triggered by requirement for

instantaneous sort on search lists

▪ Solution(s)− Move away from memory pagination to DB Pagination− Where memory pagination is a must – add as much prior filtration to reduce the

result set− Forced error with appropriate message in case of count of result set exceeding a

pre-determined size for implementation

▪ Outcome− Desired response time for search lists

Page 31: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

DB Server

App Server

UI

Request 20 records

Request All records

Return All records

Filter/Mergeand

paginate

Return 20 Records

Return 20 Records

PERFORMANCE PROBLEMPERFORMANCE PROBLEM SOLVED!

Request 20 records

Page 32: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

Root Cause Analysis – Performance of Model Load is slower than expected (Processing)

32

▪ Profiling tools used & Observations− Oracle OEM : Large number of quick processing statements building up overall

time− Jprofiler: A lot of time spent in creation of java objects from SQL-Result Set− NMON : A Lot of data transfer over network

▪ Root Cause Determination− Lazy loading of large result set when entire data set is required by an underlying

process

▪ Solution(s)− Override lazy loading

▪ Outcome− Freedom to choose lazy loading / lazy loading override for a same model under

different process contexts

Page 33: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

SIZE MATTERS – Right Size for Right Operation

Excels in Wrestling

Do you think he will win 100m race ?

Right Granularity of Domain Services

Right Granularity of Domain Objects

Page 34: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

Client Name Display on UI – Tab out from policy #

getPolicy().getClient.getName()

getName()

getClient()

getPolicy(policy #)

getPolicyClientName()

Page 35: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

Learning

35

▪ Achieving right level of granularity of services and domain objects requires thorough domain knowledge

▪ It is a one of most critical trade off between speed of development and system performance

Page 36: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

Root Cause Analysis – Performance of Model Save is slower than expected

36

▪ Profiling tools used & Observations− Oracle OEM : No concerns− Jprofiler: setAttibutes taking up a lot of time

▪ Root Cause Determination− Over all model is loaded in memory containing multiple tables, mutiple records per

each table− Attempt to save full model based upon MERGE feature

▪ Solution(s)− Keep track of dirty records

▪ Outcome/learnings− Dirty records tracking and incremental handing is easy enough− Dirty attributes tracking is proving to be a very complex exercise!− Any attempt to create dirty attributes tracking is directly affecting capability to

create inherited models based upon existing models

Page 37: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

Root Cause Analysis – System is unable to support required concurrency

37

▪ Root Cause Determination

− Use of caching at various levels not enabled • Hardware capacity near 100% utilization

− Inadequate size of Processing Thread pool (In our case : Servlet thread pool size)

− Inadequate size of max database connections in database connection pool

Page 38: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

Root Cause Analysis – System is unable to scale horizontally or vertically

38

▪ Root Cause Determination

− Parallel processing not enabled and / or

− Synchronization blocks becoming critical

Page 39: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

Even Ben Johnson Can’t run 100 m in 1 Second

Nine mothers can not produce a child in one month

Nine mothers can produce nine children in nine months

BUT

Average Time to produce a child = 1 month!Kill the Statistian!

GUIDELINE : Don’t expect even a super computer to reduce unit processing

time to too small a value! Use Effective Multi Threading Identify what can be processed in parallel without a bottleneck

Page 40: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

Summary

40

▪ As a result of efforts put in by platform development team, product development team and performance engineering Lab, we demonstrated in IBM LABS

▪ Support 2500 concurrent users, 40 million policy base▪ 25 different business transactions ▪ 4 hours run▪ 600,000 business transactions per hour▪ Server response time < 1 sec per request, consistent

▪ Hardware : p770 in IBM Labs, USA▪ 32 core, 128 GB AppServer▪ 32 corer, 128 GB DB Server

▪ Won a deal from largest insurer

Page 41: Performance Tuning of MDA Based Platform & Product Niraj Trivedi niraj.trivedi@mastek.com

Thank You

41