Model-Driven Optimizations of omponent Systems OMG Real-time Workshop July 12, 2006 Krishnakumar Balasubramanian Dr. Douglas. Schmidt {kitty,schmidt}@dre.vanderbilt.edu Institute for Software Integrated Systems Vanderbilt University Nashville, Tennessee
omponent Middleware e.g., ORBA omponent Model (M), Microsoft.NET Web Services, Enterprise Java Beans (EJB) omponents encapsulate business logic omponents interact via ports Provided interfaces Required interfaces Event sinks & sources Attributes Allow navigation between ports ontainers provide execution environment for components omponents/containers can also ommunicate via a middleware bus & reuse common middleware services Replication ontainer A/V Streaming Middleware Bus Security Scheduling Persistence Notification Load Balancing omponents allow reasoning about systems at higher level of abstraction 2 ontainer
omponent System Development hallenges Lack of system composition tools 3
omponent System Development hallenges Lack of system composition tools omplexity of declarative platform API & notations <assemblyimpl> <instance xmi:id="scaleqosket"> <name>scaleqosket</name> <package href="scaleqosket.cpd"/> </instance> XML <instance xmi:id="localresourcemanageromponent"> <name>localresourcemanageromponent</name> <package href="localresourcemanageromponent.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 <assemblyimpl> <instance xmi:id="scaleqosket"> <name>scaleqosket</name> <package href="scaleqosket.cpd"/> </instance> <instance xmi:id="localresourcemanageromponent"> <name>localresourcemanageromponent</name> <package href="localresourcemanageromponent.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 <assemblyimpl> <instance xmi:id="scaleqosket"> <name>scaleqosket</name> <package href="scaleqosket.cpd"/> </instance> <instance xmi:id="localresourcemanageromponent"> <name>localresourcemanageromponent</name> <package href="localresourcemanageromponent.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 omponent MIDDLEWARE omponent <assemblyimpl> <instance xmi:id="scaleqosket"> <name>scaleqosket</name> <package href="scaleqosket.cpd"/> </instance> <instance xmi:id="localresourcemanageromponent"> <name>localresourcemanageromponent</name> <package href="localresourcemanageromponent.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 4
omponent System Development hallenges Lack of system composition tools omplexity of declarative platform API & notations omposition overhead in largescale systems Node Application ontainer omponent omponent Assembly omponent ome Receptacle Facet Event Source Event Sink Remote Invocation ollocated Invocation reates 5
omponent System Development hallenges Lack of system composition tools omplexity of declarative platform API & notations omposition overhead in largescale systems Emphasis still on programmingin-the-small Whack-a-mole approach to system development Violation of Don t Repeat Yourself (DRY) principle Lack of abstractions for expressing system level design intent Need for tools to design & optimize systems-in-the-large 6
Solution Approach: Model-Driven Engineering System omposition Technologies omponent omponent omponent Assembly omponent omponent omponent omponent omponent Assembly omponent Assembler omponent Package omponent omponent (3) ierarchical omposition (2) Interaction Definition Implementation assembly omponent Packager composition (1) Interface Definition Resource Requirements PIML specification optimization omponent Implementation omponent Developer omponent omponent omponent Assembly omponent omponent (4) Assembly Optimization generation Properties omponent Deployer (5) Metadata Generation Implementation Assembly Assembly Assembly Deployment DAnE Framework Generative Technologies System omposition Technologies - A Domain-Specific Modeling Language (DSML) to allow component specification & composition System Optimization Technologies System optimization infrastructure Generative Technologies Metadata generation infrastructure System Optimization Technologies 7
Example Scenario: Emergency Response System System Resource Manager Global QoS manager ontrol enter User interaction Image Stream(s) Local Resource Manager Local QoS manager Qoskets QoS enforcer QoS predictors QoS estimators Built using the omponent-integrated AE ORB (IAO) Developed for DARPA PES program (dist-systems.bbn.com/papers/) 8
Application Specific Optimizations Middleware tries to optimize execution for every application ollocated method invocations Optimize the (de-)marshaling costs by exploiting locality Specialization of request path by exploiting protocol properties aching, ompression, Various Encoding schemes, e.g. FOUS tool-chain Reducing communication costs Moving data closer to the consumers by replication Reflection-based approaches hoosing appropriate alternate implementations 9
Application Specific Optimizations: What s missing? Lack of high-level notation to guide optimization frameworks Missing AST of application 10
Application Specific Optimizations: What s missing? Lack of high-level notation to guide optimization frameworks Missing AST of application Emphasis on detection at runtime (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 11
Application Specific Optimizations: Unresolved hallenges 1.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 nearoptimal solutions SystemResource Manager Sender Local Resource Manager rop Qosket Stream 1 Stream 2 Stream 3 Stream 4 ompression QoS Predictor Scaling QoS Predictor ropping QoS Predictor Scale Qosket omponent ompress Qosket ontrol enter Display Node Application annot be solved efficiently at middleware level alone! omponent Assembly omponent ome Receiver ontainer Receptacle Facet Event Source Event Sink Remote Invocation ollocated Invocation reates 12
Application Specific Optimizations: Unresolved hallenges 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 SystemResource Manager Sender Local Resource Manager rop Qosket Stream 1 Stream 2 Stream 3 Stream 4 ompression QoS Predictor Scaling QoS Predictor ropping QoS Predictor ontrol enter Display Need optimization techniques to build large-scale component systems! 13 Scale Qosket omponent ompress Qosket omponent Assembly omponent ome Node Application Receiver ontainer Receptacle Facet Event Source Event Sink Remote Invocation ollocated Invocation reates
Proposed Approach: Supply Application ontext w/models 1.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 SystemResource Manager Sender Local Resource Manager rop Qosket Stream 1 Stream 2 Stream 3 Stream 4 ompression QoS Predictor Scaling QoS Predictor ropping QoS Predictor Scale Qosket omponent ompress Qosket ontrol enter Display omponent Assembly omponent ome Node Application Receiver Factory ontainer Receptacle Facet Event Source Event Sink Remote Invocation Optimized Invocation reates 14
15 Proposed Approach: Physical Assembly Mapping 3.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
Proposed Approach: Evaluation riteria Baseline for comparison Performance & footprint (with vanilla IAO) 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 16
Proposed Approach: Evaluation riteria Improve performance t = no. of interactions between components within an assembly Transform t checked collocation calls to t unchecked calls Eliminate mis-optimizations heck incompatible POA policies Incompatible invocation semantics (oneway vs. twoway) No changes to individual component implementations Eliminate need for a local vs. remote version ustomizable & application transparent 17
oncluding Remarks omponent middleware is an emerging paradigm rucial to realizing the vision of Software Factories Problems with component middleware Significant gaps in the development & integration toolchain Our research Proposes to perform optimizations on component middleware that were previously infeasible Exploit application context made available by MDE toolchain Potential to negate benefits of using component middleware Direct application to DRE systems not always feasible Might not meet the stringent QoS requirements of DRE systems Tools can be downloaded from www.dre.vanderbilt.edu/osmi/ 18