Università degli Studi dell’Aquila Symposium on Software Performance Joint Kieker/Palladio Days 2013 27-29 November, Karlsruhe, Germany Catia Trubiani Dipartimento di Ingegneria e Scienze dell'Informazione e Matematica (DISIM), University of L’Aquila, Italy http://www.di.univaq.it/catia.trubiani A common thought “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 2 What happens today “apple” “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 3 Technology and its drawbacks 4 problem solution “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 A proactive approach… … get rid of worms before contaminating the apple! Software (Performance) Antipatterns Two main challenges: 1- Identify when a software system is (performance) sick 2- Fix the issues to get (performance) improvements “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 5 (Performance) Antipatterns » Negative features of a software system » Conceptually similar to design patterns: recurring solutions to common design problems » The definition includes common mistakes (i.e. bad practices) in software development as well as their solutions » What to avoid and how to solve (performance) problems! W.J.Brown, R.C. Malveau, H.W. Mc Cornich III, and T.J. Mowbray. “Antipatterns: Refactoring Software, Architectures, and Project in Crisis”, 1998. “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 6 Outline of this talk » Problem statement » Reasoning on Performance Antipatterns » Performance Antipatterns in Modeling Languages Unified Modeling Language (UML) Domain Specific Language (PCM) Architecture Description Language (AEmilia) “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 7 Problem Reasoning on Perf. Antipat. PA in Modeling Languages PROBLEM STATEMENT… AND DIFFERENT WAYS TO APPROACH IT… “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 8 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 9 » Software performance process Modeling (Annotated) Software Architectural Model Analysis Model2Model Transformation e.g. UML+Marte, Automata, Process Algebras, PCM, … Refactoring Performance Model e.g. Queueing Networks, Simulation Models, … Model Solution PERFORMANCE RESULTS COMPLEXITY -Numbers to be interpreted -Different levels of granularity Performance Results - Cross-checking of software system characteristics Results Interpretation & Feedback Generation “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages Software architectural models 10 UML Component Diagram UML Use Case Diagram UML Deployment Diagram Architectural specification “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages Performance results “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 11 Problem Reasoning on Perf. Antipat. PA in Modeling Languages Software architectural models vs Performance results The interpretation of performance results is not a trivial task! “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 12 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 13 Software Performance Feedback: state-of-the-art Antipatternbased Design Space Exploration Rule-based Simple Criteria Metaheuristics Approach (Annotated) Software Architectural Model Performance Model Framework Williams et al. 2002 Software Execution Model System Execution Model SPE-ED …… …… …… …… Parsons et al. 2008 JEE systems Reconstructed runtime model PAD Barber et al. 2002 Domain Reference Arch. Simulation Model RARE /ARCADE …… …… …… …… Xu 2010 UML Layered QN Perf. Booster Zheng et al. 2003 UML Simulation Model - …… …… …… …… Ipek et al. 2008 Artificial Neural Network Simulation Model - Canfora et al. 2005 Workflow Model Workflow QoS Model - …… …… …… …… Martens et al. 2010 PCM Simulation Model PerOpteryx “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 14 Antipattern-based approaches - They make use of antipatterns knowledge to cope with performance issues Williams, L.G., Smith, C.U.: PASA(SM): An Architectural Approach to Fixing Software Performance Problems. In: International Computer Measurement Group Conference, Computer Measurement Group (2002) … Parsons, T., Murphy, J.: Detecting Performance Antipatterns in Component Based Enterprise Systems. Journal of Object Technology 7 (2008) “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages Rule-based approaches - They encapsulate general knowledge on how to improve system performance into executable rules Barber, K.S., Graser, T.J., Holt, J.: Enabling Iterative Software Architecture Derivation Using Early Non-Functional Property Evaluation. In: ASE, IEEE Computer Society (2002) … Xu, J.: Rule-based automatic software performance diagnosis and improvement. Perform. Eval. 67 (2010) “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 15 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 16 Design space exploration – simple criteria - They explore the design space by examining alternatives that can cope with performance flaws Zheng, T., Woodside, C.M.: Heuristic optimization of scheduling and allocation for distributed systems with soft deadlines. In Computer Performance Evaluation /TOOLS (2003) … Ipek, E., McKee, S.A., Singh, K., Caruana, R., de Supinski, B.R., Schulz, M.: Efficient architectural design space exploration via predictive modeling. ACM Trans. on Architecture and Code Optimization (2008) “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages Design space exploration – Metaheuristics - They make use of evolutionary algorithms that look for design alternatives aimed at improving the system performance Canfora, G., Penta, M.D., Esposito, R., Villani, M.L.: An approach for QoSaware service composition based on genetic algorithms. In Beyer, H.G., O'Reilly, U.M., eds.: GECCO, ACM (2005) … Martens, A., Koziolek, H., Becker, S., Reussner, R.: Automatically improve software architecture models for performance, reliability, and cost using evolutionary algorithms. In WOSP/SIPEW (2010) “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 17 Problem Reasoning on Perf. Antipat. Antipatternsbased Rule-based … PA in Modeling Languages 18 Approach (Annotated) Software Architectural Model Performance Model Framework Williams et al. 2002 Software Execution Model System Execution Model SPE-ED …… …… …… …… Parsons et al. 2008 JEE systems Reconstructed runtime model PAD Focus of this talk Unified Modeling Language (UML), Palladio Component Model (PCM), AEmilia ADL Queueing Network, Simulation Model, Markov Chain Performance Antipatterns aNd feeDback on software Architectures (PANDA) Barber et al. 2002 Domain Reference Arch. Simulation Model RARE /ARCADE …… …… …… …… Xu 2010 UML Layered QN Perf. Booster …… …… “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 19 Software performance process: introducing automation Modeling (Annotated) Software Architectural Model Analysis Model2Model Transformation Refactoring Performance Model Model Solution Antipattern-based Performance Rules and Actions Antipatterns Performance Results Detection & Solution of Results Interpretation & Performance Antipatterns Feedback Generation “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 20 A bird’s-eye look to the problem … 1- Representing Antipatterns 2- Detecting Antipatterns 3- Solving Antipatterns “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages Representing Antipatterns: What are the software architectural model elements we need for representing antipatterns? “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 21 Problem Reasoning on Perf. Antipat. PA in Modeling Languages Detecting Antipatterns: How to explore the architectural models to recognize antipattern occurrences? “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 22 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 23 … Solving Antipatterns: What are the refactoring actions that lead the architectural model to remove performance flaws? “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages REASONING ON PERFORMANCE ANTIPATTERNS “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 24 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 25 Software Performance Antipatterns Classification Antipattern Singlevalue Concurrent Processing Systems Unbalanced Processing Solution Processing cannot make Restructure software or change use of available scheduling algorithms to enable processors. concurrent execution. The slowest filter in a “pipe and filter” “Pipe and Filter” architecture causes the Architectures system to have unacceptable throughput. Extensive Break large filters into more stages and combine very small ones to reduce overhead. Extensive processing in general impedes overall response time. Move extensive processing so that it doesn’t impede high traffic or more important work. … … … The Ramp Occurs when processing time increases as the system is used. Select algorithms or data structures based on maximum size or use algorithms that adapt to the size. Processing Multiplevalues Problem C. U. Smith and L. G.Williams. “More new software performance antipatterns: Even more ways to shoot yourself in the foot”, 2003. “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 26 Single-value vs Multiple-values » Single-value: performance indices are evaluated in a certain interval, i.e. the mean, max or min values. ∆ time » Multiple-values: performance indices are evaluated along the time, i.e. the values trend (or evolution). ∆ 2∆ … n∆ time “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 27 SPA: why are they complex? C. U. Smith and L. G.Williams. “More new software performance antipatterns: Even more ways to shoot yourself in the foot”, 2003. Antipattern Blob … Problem Solution Occurs when a single class or component either 1) performs Refactor the design to distibute intelligence most of the work of an application or 2) holds all of uniformly over the the applications data. Either applications top-level manifestation results in classes, and to keep related excessive message traffic data and behavior together. that can degrade performance. … … What does it mean “most” of the work”? What does it mean “excessive” message traffic? “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages How to make more “formal” (i.e. machine-processable) the specifications of antipatterns??? “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 28 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 29 Graphical representation of the “Blob” Antipattern PROBLEM: “occurs when a single class or component either 1) performs most of the work of an application or 2) holds all of the applications data. Either manifestation results in excessive message traffic that can degrade performance” (Annotated) Software Architectural Model M (Annotated) Software Architectural Model M i i i i “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 30 Graphical representation of the “Blob” Antipattern SOLUTION: “Refactor the design to distribute intelligence uniformly over the applications top-level classes, and to keep related data and behavior together” (Annotated) Software Architectural Model M’ (Annotated) Software Architectural Model M’ “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 31 Idea: building a vocabulary to include all model elements involved in the antipatterns specification Views overlapping! Message STATIC VIEW: software resources, relationships among them, … to model static aspects DYNAMIC VIEW: interactions such as messages between sw resources, … to model dynamic aspects senderRole SoftwareEntity Instance receiverRole DYNAMIC VIEW DEPLOYMENT VIEW: hardware resources, … to model deployment aspects ProcesNode utilization deployedInstance clientRole DEPLOYMENT VIEW supplierRole Relationship STATIC VIEW “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 32 PAML: Perf.Antipatterns Modeling Language READ: Reference Elements for Antipatterns Definition “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages The “Model Elements Specification” sub-MM: READ “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 33 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 34 Basic Idea: a performance antipattern can be formalized as a logical predicate LPantipatName A logical predicate is made of (Static, Dynamic, Deployment) basic predicates, BPi LPantipatName = BP1 (∧, ∨) … (∧, ∨) BPn “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 35 Auxiliary elements in the formalization process Functions > FfunctionName elaborates information of the model (e.g. FnumMsgs is a function counting the number of messages sent by an instance of the class/component model element) Thresholds > ThthresholdName is a value used to establish the acceptable range of values for system features (e.g. ThmaxMsgs is a threshold value representing the upper bound for an acceptable number of messages exchanged among two software instances. It can be estimated, for example, as the average number of all messages sent by all software entities, plus the corresponding variance) “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 36 The Blob antipattern occurs when the following predicate is true: ( ∨ ) ( ∧ ∨ ) ( ∨ where represents the set of SoftwareEntityInstance(s), and represents the set of Service(s). All the (swEx, swEy, S) instances satisfying the predicate must be pointed out to the designer for a deeper analysis. “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 ∧ ) Problem Reasoning on Perf. Antipat. PA in Modeling Languages Thresholds in performance antipatterns specification/representation Design : thresholds Performance : referring to design thresholds referring to characteristics (e.g. performance indices Overview of(e.g. Antipatterns Thresholds high/low number of high/low device connections, number of utilization, queue length). exchanged messages). “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 37 Problem Reasoning on Perf. Antipat. PA in Modeling Languages Each antipattern can be expressed by means of first-order logics But this is only OUR interpretation of their textual description V. Cortellessa, A. Di Marco, and C. Trubiani. “An approach for *seemodeling more details in: and detecting Software Performance Antipatterns based on firstorder logics”, accepted for publication in the journal of Software and Systems Modeling (SoSyM), 2012. “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 38 Problem Reasoning on Perf. Antipat. PA in Modeling Languages Key-Question: Once we have (somehow) “represented” antipatterns, how can we detect them in a software model? “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 39 Problem Reasoning on Perf. Antipat. PA in Modeling Languages How to establish fair thresholds for antipatterns??? “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 40 Problem Reasoning on Perf. Antipat. PA in Modeling Languages Define heuristics to calculate antipatterns thresholds E.g., ThmaxConnects can be estimated as the average number of connections per component, by considering the entire set of software components in the software system, plus the corresponding variance. “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 41 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 42 A case study: the “E-commerce System” software model excerpt performance model Requirement Required Value Predicted Value RT(browseCatalog) 1.2 sec 1.5 sec RT(makePurchase) 2 sec 2.77 sec “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 43 A preliminary complex step: setting thresholds Detecting Antipatterns design properties (e.g. excessive message traffic) performance results (e.g. high network utilization) “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 44 Performance Antipattern occurrences in ECS: Detecting Antipatterns Antipattern Blob Problem Solution libraryController performs most of Refactor the design to keep related data and the work, it generates excessive behavior together, i.e. delegate some work message traffic towards bookLibrary from libraryController to bookLibrary Concurrent Processing Systems Processing cannot make use of the processor webServerNode Restructure software or changing scheduling algorithms between processors libraryNode and webServerNode Empty Semi Trucks An excessive number of requests are sent by the userController to perform the task of registering users Refactor the design combining items into messages to make better use of available bandwidth “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages Detecting Antipatterns » An example: detecting the EST antipattern instance The (userController, RegisterUsers) instance satisfies the Empty Semi Trucks predicate, hence it must be pointed out to the designer for a deeper analysis “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 45 Problem Reasoning on Perf. Antipat. PA in Modeling Languages And another Key-Question Once we have (somehow) “detected” antipatterns, which refactoring actions must be taken to remove (some of) them? First rough approach First-Order-Logic representation of antipatterns can help: refactoring actions can be (automatically) obtained from negating predicates! “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 46 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 47 Solving Antipatterns An example: solving the EST antipattern instance The removal of the EST antipattern gives rise to a new software architectural model (called here as “ECS \ {est}”) “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 48 Performance Analysis of some refactored models Analysis Modeling ECS \ {est} ECS \ {cps} Prima-UML ECS \ {blob} Queueing Network MVA Response Time, Utilisation, … Unified Modeling Language (UML) (Annotated) Software Architectural Model RT(browseCatalog) < = 1.2 sec RT(makePurchase) < = 2 sec ECS 1.5 sec 2.77 sec ECS \ {blob} 1.14 sec 2.18 sec ECS \ {cps} 1.15 sec 1.6 sec ECS \ {est} 1.5 sec 2.24 sec “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 49 Some more thoughts on refactoring RBML (Role-Based Modelling Language) defines the available constructs (roles and associations among them) characterizes a (part of a) system in terms of roles that are played by the elements of the system characterization of the (source) model that has to be refactored the number of elements playing that role characterization of the refactored (target) model It exists a <<T Role>> for each type T in the modelling language used to specify the system “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 50 Empty Semi Trucks (EST) - SOURCE ROLE MODEL Elements from the antipattern detection phase Contextual elements: additional model elements that can support the removal of the bad practice “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages Empty Semi Trucks (EST) - TARGET ROLE MODEL Added elements “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 51 Problem Reasoning on Perf. Antipat. PA in Modeling Languages PERFORMANCE ANTIPATTERNS IN MODELING LANGUAGES “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 52 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 53 Antipattern-based process (Annotated) Software Architectural Model Model2Model Transformation Performance Model Model Solution - Generic Modeling Languages (UML) - Domain Specific Languages (PCM) - Architecture Description Languages (Aemilia) - … Performance Results Antipatterns-based Rules and Actions Detecting Antipatterns (i.e. Results Interpretation) (Annotated) Software Architectural Model Candidate1 Solving Antipatterns (i.e. Feedback Generation) … (Annotated) Software Architectural Model Candidaten “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 54 Looking at different modeling notations… … UML Generic Modeling Language (i.e. UML + Marte profile) representing Domain Specific Language (i.e. Palladio Component Model) detecting solving ...any modeling language has “antipatternsconcepts” AEmilia PCM Architectural Description Language (i.e. AEmilia) “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 55 MDE support: metamodel and model transformations … M1: Models M2: Metamodels representing detecting solving ...any modeling language has “antipatternsconcepts” Generic Modeling Language (i.e. UML + Marte profile) Domain Specific Language (i.e. Palladio Component Model) Architectural Description Language (i.e. AEmilia) UML model (Marte annotated) PCM model AEmilia specification “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 56 Antipatterns in concrete modeling languages Blob … Performance Antipatterns SoftwareEntity ProcesNode UML Component … UML Node UML+MARTE … PCM Basic Component … BasicResDemand READ ARCHI_ELEM_TYPE … … PCM Resource Container Palladio Component Model Aemilia ADL “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 57 Is UML+Marte expressive enough to specify antipatterns? “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages Is PCM expressive enough to specify antipatterns? “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 58 Problem Reasoning on Perf. Antipat. PA in Modeling Languages Is Aemilia expressive enough to specify antipatterns? “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 59 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 60 Expressiveness of the considered modeling languages UML + Marte profile Antipattern Solvable Detectable Solvable Detectable Solvable ✔ ✔ ✔ ✔ ≈ ≈ Concurrent Processing Systems ✔ ✔ ✔ ✖ ✖ Pipe and Filter Architectures ✔ ✔ ✔ ✔ ✖ ✔ ✔ Extensive Processing ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✖ ✖ ✖ ✖ ✖ … … … … … … ✔ ✔ ✖ ✔ ✔ ✖ ✖ ✖ ✔ ✖ ✖ ✔ ✔ ✖ Tower of Babel … The Ramp Traffic Jam More is Less AEmilia Detectable Blob Unbalanced Processing Palladio Component Model ✔ = fully detectable/solvable ✔ ✖ ✖ ✖ ≈ = partially detectable/solvable ✖ = not detectable/solvable “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Open Issues - Basics − Gap textual/formal representations − Threshold setting − Uncertainty/incompleteness in: > Architectural/Performance models, antipatterns specifications, input parameters (e.g., workload, op. profile) − Validation on larger model repositories (industrial case studies) “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 61 Open Issues - Advanced 62 − Evaluating the framework on: > Precision (ratio of actual antipatterns found) > Recall (ratio of antipatterns found overall) − Language-specific antipatterns (other languages to experiment?) − Antipatterns at the code level − Combining approaches (antipatterns with metaheuristics) − Tool construction and integration “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Open Issues – Process related − Legacy constraints − Conflicting solutions − Overlapping solutions (composition) − Combination with other quality attributes (maintenability, reliability, etc…) “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 63 Discussion 64 − Interesting points? − Open issues? − Threats to validity? − Links to other research directions? − … That’s all folks! “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 65 Thank you! Credits for this invited talk go to… Vittorio Cortellessa, Antinisca Di Marco, Davide Arcelli, Romina Eramo, Alfonso Pierantonio, Anne Koziolek, Ralf Reussner Questions catia.trubiani@univaq.it “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 66 “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Software performance process in deep 67 Termination Criteria: (Annotated) Software Architectural Model … (i) fulfilment criterion Performance Antipatterns-based Rules and Actions Results (ii) no-actions criterion (iii) #iterations Detecting Antipatterns (i.e. Results Interpretation) iteration1 Solving Antipatterns (i.e. Feedback Generation) (Annotated) Software Architectural Model Candidate1-1 (Annotated) Software Architectural Model Candidate1-h … … iterationn (Annotated) Software Architectural Model Candidaten-1 … (Annotated) Software Architectural Model Candidaten-k “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 68 Yet another Key-Question: How to drive the process of antipattern solution? Who guarantees that the removal of antipatterns will lead to “better” performance? First approach A guilt-based one, but still many issues to solve! “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 A step ahead in the antipatterns solution Problem: once performance antipatterns has been detected in a model, which ones should be solved first? Solution: introducing scores that allow to order detected antipatterns on the basis of their guilt R1 Performance Antipatterns … Rj Violated Requirements PA1 … PAi weight (PAi, Rj) “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 69 Validation of the ranking process “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 70 Afterthoughts on experimental results 71 #Candidates (Antipattern solution) #Candidates (Antipattern guilt-based solution) iteration1 7 4 iteration2 36 25 iteration3 123 93 iteration4 289 217 TOT 455 339 The ranking process led the system to discard 34% of candidates “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages PERFORMANCE ANTIPATTERNS IN MODELING LANGUAGES: OUR EXPERIENCE “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 72 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 73 Our experience in UML Modeling Unified Modeling Language (UML) Analysis Prima-UML Refactoring Queueing Network Mean Value Analysis OCL code Response Time, Utilisation, … OCL engine for the Detection of Antipatterns “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 74 UML model Service Demand (input parameters) Utilization (output indices) webServerNode 2.02 msec 27% libraryNode 7.05 msec 96% controlNode 3 msec 41% dbNode_cpu UML Use Case Diagram dbNode_disk UML Component Diagram 15 msec 20% 30 msec 41% UML Deployment Diagram Requirement: each hardware resource has not to be used more than 80% under the mean workload of 70 requests/second concurrently in execution in the system. “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages An example: the Blob antipattern as OCL rule “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 75 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 76 Detecting antipatterns in UML “Blob” Antipattern occurrence “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 77 Solving Antipatterns in UML Note that these values have changed due to the load re-distribution Service Demand (input parameters) webServerNode “Blob” Antipattern removal Utilization (output indices) 4.07 msec 61% libraryNode 5 msec 75% controlNode 3 msec 41% dbNode_cpu 15 msec 20% dbNode_disk 30 msec 41% Requirement: each hardware resource has not to be used more than 80% under the mean workload of 70 requests/second concurrently in execution in the system. “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 78 Our experience in PCM Modeling Palladio Component Model (PCM) Analysis PCM2SimuCom Refactoring Simulation Models Simulation Java code Response Time, Utilisation, … Java engine for the Detection & Solution of antipatterns “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 79 PCM model Requirement Required Value Predicted Value RT(system) 10 sec 18.71 sec “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages An example: the Concurrent Processing Systems antipattern as Java code “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 80 Problem Reasoning on Perf. Antipat. PA in Modeling Languages Detecting antipatterns in PCM “Concurrent Processing Systems” Antipattern occurrence “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 81 Problem Reasoning on Perf. Antipat. PA in Modeling Languages Solving antipatterns in PCM “Concurrent Processing Systems” Antipattern removal <<redeploy>> “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 82 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 83 The solution process in PCM “Concurrent Processing Systems” Antipattern removal <<redeploy>> required value “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 84 Our experience in AEmilia Modeling AEmilia specification Analysis TwoTowers Refactoring Markov chain TwoTowers OCL code Response Time, Utilisation, … OCL engine for the Detection of Antipatterns “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 85 AEmilia specification Requirement Required Value Predicted Value Throughput(system) 15 reqs/sec 12.19 reqs/sec “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 86 An example: the Extensive Processing antipattern as OCL code (applied on the AEmilia MM!) “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Problem Reasoning on Perf. Antipat. PA in Modeling Languages Detecting antipatterns in AEmilia “Extensive Processing” Antipattern occurrence “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 87 Problem Reasoning on Perf. Antipat. PA in Modeling Languages 88 Solving antipatterns in AEmilia “Extensive Processing” Antipattern removal Requirement Required Value Predicted Value Throughput(system) 15 reqs/sec 18.29 reqs/sec “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 M2: Metamodels Round-trip process in the AEmilia ADL Performance Antipatterns Modelling Language (PAML) AEmilia Grammar conform to Modelling AEmilia Architectural specification (file.aem) PAML[AEmilia] Metamodel conform to conform to conform to Analysis Refactoring AEmilia Model AEmilia Performance specification (file.rew) Performance Evaluation M1: Models 89 Text-to-Model Transformation Performance Results Annotation AEmilia Performance results (file.val) Antipatterns Solution Annotated AEmilia Model Antipatterns Detection Detected Antipatterns “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 PAML[AEmilia] metamodel 90 structure of the AEmilia specification “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Text-to-Model Transformation AEmilia Grammar 91 transformation rules conform to AEmilia Architectural specification (file.aem) PAML[AEmilia] Metamodel conform to AEmilia Model “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Performance Results Annotation AEmilia Performance specification (file.rew) AEmilia Performance results (file.val) “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 92 Antipatterns Detection OCL code for the detection of the Extensive Processing Antipattern “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 93 Advanced MDE techniques Embedding Antipatterns neutral concept in concrete modeling notations − Antipatterns are based on a dedicated general purpose language (SML+) − Weaving models can map the concepts of SML+ into concrete modeling notations (parameter passing) “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 94 Advanced MDE techniques 95 REPRESENTATION A transformation T is generated, starting from the WM, between the neutral representation of antipatterns and the concrete modeling language “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Advanced MDE techniques DETECTION A transformation T’ is generated, starting from the same WM, to provide an OCL-based executable semantics “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 96 97 INFLUENCE OF ANTIPATTERNS THRESHOLDS ON ANTIPATTERNS DETECTION AND REFACTORING “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 Influence of antipatterns thresholds » An illustrative example: E-CommerceSystem (ECS) Requirement: the RESPONSE TIME for the MakePurchase service must not exceed 2 seconds (with a workload of 150 customers) “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 98 ECS modeling 99 » Static, Dynamic and Deployment Views Dynamic View Static View View Deployment “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 ECS- Performance Analysis 100 » Performance Annotations » Performance Results 2.16 the performance analysis predicts that the response time is equal to 2.16 seconds, larger than the required 2 seconds “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 ECS- antipatterns detection and refactoring 101 » Thresholds binding for the Blob antipattern Blob <<deploy>> Performance Results 1.98 … “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 ECS- influence of thresholds in antipatterns detection Variation of Blob Thresholds “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 102 ECS- influence of thresholds in antipatterns refactoring Variation of the MakePurchase response time across different Blob refactorings “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013 103 Open issues 104 » Antipatterns that only include thresholds related to performance indices are more difficult to refactor vs antipatterns that include thresholds related to design features. » What’s the effectiveness of current heuristics? » How to decide the “right” (if any) interval of values for varying the numerical values of thresholds? “SPA challenges: how to get rid of worms before contaminating the apple?”, Invited talk @ Joint Kieker/Palladio Days, Karlsruhe, Germany, 27-29 November, 2013