18
Model-Driven Optimizations of Component Systems Vanderbilt University Nashville, Tennessee Institute for Software Integrated Systems OMG Real-time Workshop July 12, 2006 Krishnakumar Balasubramanian Dr. Douglas C. Schmidt {kitty,schmidt}@dre.vanderbilt.e du

Model-Driven Optimizations of Component Systems

  • Upload
    stevie

  • View
    54

  • Download
    3

Embed Size (px)

DESCRIPTION

Institute for Software Integrated Systems. Vanderbilt University Nashville, Tennessee. Model-Driven Optimizations of Component Systems. OMG Real-time Workshop July 12, 2006 Krishnakumar Balasubramanian Dr. Douglas C. Schmidt {kitty,schmidt}@dre.vanderbilt.edu. …. …. …. …. Container. - PowerPoint PPT Presentation

Citation preview

Page 1: Model-Driven Optimizations of Component Systems

Model-Driven Optimizations of Component Systems

Vanderbilt University Nashville, Tennessee

Institute for Software Integrated Systems

OMG Real-time WorkshopJuly 12, 2006

Krishnakumar BalasubramanianDr. Douglas C. Schmidt

{kitty,schmidt}@dre.vanderbilt.edu

Page 2: Model-Driven Optimizations of Component Systems

2

Component Middleware

• Components encapsulate “business” logic

• Components interact via ports• Provided interfaces• Required interfaces• Event sinks & sources• Attributes

• Allow navigation between ports• Containers provide execution

environment for components• Components/containers can also

• Communicate via a middleware bus & reuse common middleware services

SecurityReplication NotificationPersistence

SchedulingA/V Streaming Load Balancing

Middleware Bus

Container

… ……

Container

Components allow reasoning about systems at higher level of abstraction

e.g., CORBA Component Model (CCM), Microsoft .NET Web Services, Enterprise Java Beans (EJB)

Page 3: Model-Driven Optimizations of Component Systems

3

Component System Development Challenges• Lack of system composition tools

Component

ResourceRequirements

Impl Impl Impl

Properties

Component Assembly

ComponentComponent

ComponentComponent

Page 4: Model-Driven Optimizations of Component Systems

4

Component System Development Challenges• Lack of system composition tools

• Complexity of declarative platform API & notations

<assemblyImpl><instance xmi:id="ScaleQosket">

<name>ScaleQosket</name><package href="ScaleQosket.cpd"/>

</instance><instance xmi:id="LocalResourceManagerComponent">

<name>LocalResourceManagerComponent</name><package href="LocalResourceManagerComponent.cpd"/>

</instance>...<connection>

<name>incoming_image_outgoing_image_Evt</name><internalEndpoint><portName>outgoing_image_Evt</portName><instance xmi:idref="LocalReceiver"/>

</internalEndpoint><internalEndpoint>

<portName>incoming_image_Evt</portName><instance xmi:idref="MultiReceiver"/>

</internalEndpoint></connection>

</assemblyImpl>

OS KERNEL

OS I/O Subsystem

Network Interfaces

OS KERNEL

OS I/O Subsystem

Network Interfaces

MIDDLEWARE

ComponentComponent

<assemblyImpl><instance xmi:id="ScaleQosket">

<name>ScaleQosket</name><package href="ScaleQosket.cpd"/>

</instance><instance xmi:id="LocalResourceManagerComponent">

<name>LocalResourceManagerComponent</name><package href="LocalResourceManagerComponent.cpd"/>

</instance>...<connection>

<name>incoming_image_outgoing_image_Evt</name><internalEndpoint><portName>outgoing_image_Evt</portName><instance xmi:idref="LocalReceiver"/>

</internalEndpoint><internalEndpoint>

<portName>incoming_image_Evt</portName><instance xmi:idref="MultiReceiver"/>

</internalEndpoint></connection>

</assemblyImpl>

<assemblyImpl><instance xmi:id="ScaleQosket">

<name>ScaleQosket</name><package href="ScaleQosket.cpd"/>

</instance><instance xmi:id="LocalResourceManagerComponent">

<name>LocalResourceManagerComponent</name><package href="LocalResourceManagerComponent.cpd"/>

</instance>...<connection>

<name>incoming_image_outgoing_image_Evt</name><internalEndpoint><portName>outgoing_image_Evt</portName><instance xmi:idref="LocalReceiver"/>

</internalEndpoint><internalEndpoint>

<portName>incoming_image_Evt</portName><instance xmi:idref="MultiReceiver"/>

</internalEndpoint></connection>

</assemblyImpl>

<assemblyImpl><instance xmi:id="ScaleQosket">

<name>ScaleQosket</name>

<package href="ScaleQosket.cpd"/></instance><instance xmi:id="LocalResourceManagerComponent">

<name>LocalResourceManagerComponent</name><package href="LocalResourceManagerComponent.cpd"/>

</instance>...<connection>

<name>incoming_image_outgoing_image_Evt</name><internalEndpoint>

<portName>outgoing_image_Evt</portName>

<instance xmi:idref="LocalReceiver"/></internalEndpoint><internalEndpoint>

<portName>incoming_image_Evt</portName><instance xmi:idref="MultiReceiver"/>

</internalEndpoint></connection>

</assemblyImpl>

XML

XMLXML

XML

Page 5: Model-Driven Optimizations of Component Systems

5

Component System Development Challenges• Lack of system composition tools

• Complexity of declarative platform API & notations

• Composition overhead in large-scale systems

Node Application

Container

CH CH

CHCH

CH CH

CHCH

CH CH

CHCH

CH CH

CHCH

CH

Receptacle

Facet

Event Sink

Event SourceComponent Home

Component Assembly

Component Remote InvocationCollocated Invocation

Creates

Page 6: Model-Driven Optimizations of Component Systems

6

Component System Development Challenges

Need for tools to design & optimize “systems-in-the-large”

• Lack of system composition tools

• Complexity of declarative platform API & notations

• Composition overhead in large-scale systems

• Emphasis still on programming-in-the-small

• Whack-a-mole approach to system development

• Violation of Don’t Repeat Yourself (DRY) principle

• Need abstractions for expressing system level design intent

Page 7: Model-Driven Optimizations of Component Systems

7

Component Assembler

Component Assembly

Component Component

Component Component

Component Package

Component Assembly

Component Component

Component Component

Component Assembly

Component Component

Component Component

(1) I

nter

face

D

efin

ition

(2) Interaction Definition

(3) Hierarchical Composition

(5) Metadata Generation

(4) Assembly Optimization

Component Developer

Component Packager

ComponentDeployer

PICMLcompositio

n

asse

mbl

y

optimization

gene

ratio

n

specification

Assembly

Deployment

Assembly

Assembly

DAnCE Framework

Component

ResourceRequirements

Implementation

Properties

ImplementationImplementation

Solution Approach: Model-Driven Engineering

• System Composition Technologies - A Domain-Specific Modeling Language (DSML) to allow component specification & composition

• System Optimization Technologies – System optimization infrastructure• Generative Technologies – Metadata generation infrastructure

Generative Technologies

System Composition Technologies System

Optimization Technologies

Page 8: Model-Driven Optimizations of Component Systems

8

Control Center SystemResource

Manager

ScaleQosket

CropQosket

Compress Qosket

LocalResourceManager

Cropping QoSPredictorScaling QoS

Predictor

Compression QoSPredictor

Image Feeds (.NET Web

Service)

• System Resource Manager

• Global QoS manager• Control Center

• User interaction• Image Stream(s)

• Local Resource Manager

• Local QoS manager

• Qoskets• QoS enforcer

• QoS predictors• QoS estimators

• Built using the Component-Integrated ACE ORB (CIAO)

Example Scenario: Emergency Response System

Developed for DARPA PCES program (dist-systems.bbn.com/papers/)

Page 9: Model-Driven Optimizations of Component Systems

9

Control Center SystemResource

Manager

ScaleQosket

CropQosket

Compress Qosket

LocalResourceManager

Cropping QoSPredictorScaling QoS

Predictor

Compression QoSPredictor

Image Feeds (.NET Web

Service)

Application Specific Optimizations • Middleware tries to optimize

execution for every application• Collocated method invocations

• Optimize the (de-)marshaling costs by exploiting locality

• Specialization of request path by exploiting protocol properties• Caching, Compression,

Various Encoding schemes, e.g. FOCUS tool-chain

• Reducing communication costs• Moving data closer to the

consumers by replication• Reflection-based approaches

• Choosing appropriate alternate implementations

Page 10: Model-Driven Optimizations of Component Systems

10

Application Specific Optimizations: What’s missing?• Lack of high-level notation to

guide optimization frameworks• Missing AST of application

N N N N

N

N

N

N

NN

Application Abstract Syntax Tree

Page 11: Model-Driven Optimizations of Component Systems

11

• Lack of high-level notation to guide optimization frameworks• Missing AST of application

• Emphasis on detection at run-time (reflection)• Additional overhead in the

fast path• Not suitable for all systems

• Not completely application transparent• Requires providing multiple

implementations• Optimization performed either

• Too early, or too late

Control Center SystemResource

Manager

ScaleQosket

CropQosket

Compress Qosket

LocalResourceManager

Cropping QoSPredictorScaling QoS

Predictor

Compression QoSPredictor

Image Feeds (.NET Web

Service)

Application Specific Optimizations: What’s missing?

Page 12: Model-Driven Optimizations of Component Systems

12

Control Center Display

SystemResourceManager

LocalResourceManager

Sender ReceiverCrop

QosketCompress

QosketScale

Qosket

Compression QoS Predictor

Scaling QoS Predictor

Cropping QoS Predictor

Stream 4

Stream 3

Stream 2

Stream 1

Application Specific Optimizations: Unresolved Challenges1.Lack of application

context• Missed middleware

optimization opportunities

• E.g., every invocation performs check for locality

• Optimization decisions relegated to run-time

• Impossible for middleware (alone) to predict application usage

• Settle for near-optimal solutions

Cannot be solved efficiently at middleware level alone!

Node Application

Container

CH CH

CHCH

CH CH

CHCH

CH CH

CHCH

CH CH

CHCH

CH

Receptacle

Facet

Event Sink

Event SourceComponent Home

Component Assembly

Component Remote InvocationCollocated Invocation

Creates

Page 13: Model-Driven Optimizations of Component Systems

13

Control Center Display

SystemResourceManager

LocalResourceManager

Sender ReceiverCrop

QosketCompress

QosketScale

Qosket

Compression QoS Predictor

Scaling QoS Predictor

Cropping QoS Predictor

Stream 4

Stream 3

Stream 2

Stream 1

Node Application

Container

CH CH

CHCH

CH CH

CHCH

CH CH

CHCH

CH CH

CHCH

CH

Receptacle

Facet

Event Sink

Event SourceComponent Home

Component Assembly

Component Remote InvocationCollocated Invocation

Creates

2.Overhead of platform mappings • Blind adherence to

platform semantics• Inefficient middleware

glue code generation per component

• Example: Every component is created using a Factory Object• Overhead of

external components similar to internal ones

3.Standard component models define only virtual assemblies

Need optimization techniques to build large-scale component systems!

Application Specific Optimizations: Unresolved Challenges

Page 14: Model-Driven Optimizations of Component Systems

14

Control Center Display

SystemResourceManager

LocalResourceManager

Sender ReceiverCrop

QosketCompress

QosketScale

Qosket

Compression QoS Predictor

Scaling QoS Predictor

Cropping QoS Predictor

Stream 4

Stream 3

Stream 2

Stream 1

Node Application

Container

Factory

CHCH

CH

CH

CH

CH

Receptacle

Facet

Event Sink

Event Source

Component Home

Component Assembly

Component Remote InvocationOptimized Invocation

Creates

CH CHCH

Proposed Approach: Supply Application Context w/Models1.Use models to capture &

derive application context• Explicit, e.g., sensor &

monitor are collocated (user-specified)

• Implicit, e.g., sensor & monitor deployed onto same node

• Detect components internal to an assembly

2.Optimize platform mappings • Eliminate space

overhead at system level• e.g., eliminate creation

overhead of homes for internal components

Page 15: Model-Driven Optimizations of Component Systems

15

Proposed Approach: Physical Assembly Mapping3.Devise mapping for physical

component assembly • Exploit hierarchy of

application structure to fuse (make a component internal) at multiple levels in hierarchy

• Experimentally validate right depth of hierarchy to stop fusion• Too deep – Single giant

blob• Too shallow –

Potentially lower benefits

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

CH

Page 16: Model-Driven Optimizations of Component Systems

16

Proposed Approach: Evaluation Criteria • Baseline for comparison

• Performance & footprint (with vanilla CIAO)• Emergency Response System

(30+ components)• ARMS GateTest scenarios (1,800+

components)• Scenario with & without inherent

hierarchy• Reduce static & dynamic footprint

• n = no. of internal components, x = total no. of components in the assembly

• Reduce no. of homes by (n-1)/x• Reduce no. of objects registered with

POA by (n-1)/x

CH CH

CHCH

CH CH

CHCH

CH CH

CHCH

CH CH

CHCH

Assembly Optimizer

Factory

CHCH

CH

CH

CH

CH CHCH

Page 17: Model-Driven Optimizations of Component Systems

17

Proposed Approach: Evaluation Criteria • Improve performance

• t = no. of interactions between components within an assembly

• Transform t checked collocation calls to t unchecked calls

• Eliminate mis-optimizations• Check incompatible POA

policies• Incompatible invocation

semantics (oneway or twoway)

• No changes to individual component implementations• Eliminate need for a local

vs. remote version• Customizable & application transparent

Page 18: Model-Driven Optimizations of Component Systems

18

Concluding Remarks• Component middleware is an emerging

paradigm

• Crucial to realizing the vision of Software Factories

• Problems with component middleware

• Significant gaps in the development & integration toolchain

• Potential to negate benefits of using component middleware

• Direct application to DRE systems not possible

• Might not meet the stringent QoS requirements of DRE systems

• Our research

• Proposes to perform optimizations on component middleware that were previously infeasible

• Exploit application context made available by MDE tool-chain

Tools can be downloaded from www.dre.vanderbilt.edu/CoSMIC/