Software Performance Optimization Based on ...

40 downloads 330 Views 383KB Size Report
component based software, indicates that the automation of. SPE is very important because software designer can more easily create high-quality ...
Software Performance Optimization Based on Constrained GSA Maryam Amoozegar

Hossein Nezamabadi-pour

School of Computer Engineering, Iran University of Science and Technology Tehran, Iran [email protected]

Department of electrical Engineering, Shahid Bahonar University Kerman, Iran [email protected]

Abstract—Software Performance Engineering (SPE) in the early life cycle of software development (software modeling) is very useful and cost-effective but does not guide the software architect through how to improve the design. Computing the least response time by controlling utilization and cost is a constrained optimization problem. This paper presents a constrained optimization method based on Gravitational Search Algorithm (GSA) for exploring the software design space automatically and proposes the best configuration in terms of performance evaluation. Presented method is compared with constrained PSO which is one of famous optimization algorithms. Obtained results confirm the efficiency of proposed method. Keywords-component; Software performance engineering; Gravitational serach algorithm; constrained optimization;

I.

INTRODUCTION

Software Performance Engineering (SPE) [1] is the process of evaluating performance of software thorough the life cycle to increase performance. Research is done in component based software, indicates that the automation of SPE is very important because software designer can more easily create high-quality component-based software model. SPE process can be divided into 2 subprocesses; transformation and feedback. Transformation is a step for transforming software model into performance model, where feedback is done from performance model to software model for finding best configuration and design improvement on the software model. There has been various automation transformation approaches in the literature, especially when automatic finding of the best configuration has been a mature task in feedback subprocess [2]. In software engineering, the most important performance factor is response time that must be minimized. Also utilization of software and hardware resources, throughput and cost must be controlled. Recently, several efforts have been performed to find and propose best configuration [3,4,5].These configuration are understandable for the software designer; therefore, software designer does not need to be expert in the performance evaluation field. Therefore, software performance optimization can be described as a constrained optimization problem. Objective is minimizing the response time whereas cost and utilization constraints have to be satisfied. In [6], the author has reviewed application of meta-heuristic algorithms in software engineering. These approaches explore design

space with meta-heuristic algorithms, for example genetic algorithm. Gravitational Search Algorithm (GSA) is a new heuristic optimization method that is based on the law of gravity and mass interactions [7]. GSA has been applied for solving various nonlinear functions and compared with some wellknow search methods. In this paper, GSA is applied to minimize response time. In order to consider cost and resources utilization constrained and bottlenecks controlling we present a constrained version of GSA. Proposed method applied in a case study and a constrained version of PSO[8] also used to it. Obtained results confirm the efficiency of proposed method. II.

RELATED WORKS

Existing Classical performance analysis tools based on queueing network or stochastic Petri-nets ordinarily analysis model to produce performance metrics and do not provide feedback to improve the model. [2] Xu et al. presented a semi-automated rule-based approach in [3] that finds configuration and design improvement on the software model. In this work, the architecture model wasn’t component based and heuristic rules were defined to increase the processing speed of bottleneck resources and thereby to help the software architect. Mostly, however, these approaches are not automated. Additionally, the rules can only make use of the performance domain knowledge actually codified in these heuristics and cannot explore regions of the design space for which no prior knowledge exist. Martens in [4] presented a fully-automated approach to improve the expected performance of component-based software designs and a prototypical implementation for it. Exploration of the design space was done by genetic search techniques and performance-domain heuristics. Martens in [5] have presented another approach to optimize service-oriented architecture models with regard to performance and reliability. The approach is based on the Palladio Component Model (PCM) [9] but, that work focused on reliability and performance. Thus, few performance parameters have been considered in the literature and researchers have not yet taken quality requirements into account. Also, in the previous works, software model was considered to be PCM model that was introduced by the authors of papers. PCM is a modeling language specially designed for the performance and reliability prediction of service-oriented and component-

based systems. In our proposed method UML is utilized for software specification and modeling that is a standard modeling language. Due to the shortcomings of the previous studies regarding consideration of few performance parameters and the tools for modeling the software, in the present study, some novel approaches are introduced for improving software performance optimization. These innovations are as follows. 1- In our proposed method UML is utilized for software specification and modeling. Although many approaches use UML, but in full automated method do not use it. 2- Some aspects of performance such as utilization of software and hardware resources in addition to response time are considered as assurance factors in SPE. 3-We present and use constrained version of GSA algorithm that allows controlling bottlenecks in software model. If Utilization of software and hardware resources were higher than threshold, bottleneck had happened. III.

BACKGROUND

A. Software performance engineering Software Performance Engineering (SPE), firstly presented in [1], is a systematic, quantitative approach to construct software systems that meet performance objectives. It is based on the careful and methodical assessment of performance attributes throughout the lifecycle, from requirements and specification to implementation and maintenance [10]. Fig .1 shows the steps of SPE. The first step is the designing of software model in UML2 with activity, component and deployment diagram. In the second step, the MARTE[11] profile (that we add new stereotype to it [12]) extends software model to annotate performance requirements and specify performance property of resources and activities using stereotypes and tagged values. Steps three and four are related to software model transform into CBML by means of existing algorithm and tools provided in our already research. CBML is an XML based language designed for describing layered queuing models with embedded components, and also the component sub-models. [13,14] The LQN model will solve with LQNS Solver[16,17] in step 5. LQNS uses analytical mean value queuing approximations to solve the queues at all entries. Analysis is done in step six with SPEX which supports experiment instrumentation [17]. This tool can execute parameterized experiments using LQNS. This tool is very useful for repeating a parameterized run. In the final step, a search is performed through the space of problem and the best value for performance parameter annotated in software model will be presented finally. All of these steps are used for an E-shop software case study. A key factor in the successful performance analysis is automation. This means the availability of tools and automated support for performance prediction in the software life cycle. Over the last decade, a lot of research

has been directed towards integrating performance analysis into the software development process [2]. In this way, software architecture who is not proficient in performance domain, can easily design software with high performance. 3. Transformation

1. Software Modeling (UML2)

4. LQN model 5. Solve LQN 6. Analysis

2. Annotating Performance

7. Optimization 8. Feedback Figure 1. Software Performance Engineering Process

B. Constrained otimization problems The following optimization problem (P) with the inequality constraints, the equality constraints, the upper bound constraints and the lower bound constraints will be discussed in this study: : , (P) Minimize 0, 1,2, … , Subject to 0, 1, … , m x 1, … , n Where, , ,…, is an n dimensional vector of is an objective function, decision variables, 0, 1,2, … , are q inequality constraints and 0, 1, … , m are m equality constraints. f, and are linear or nonlinear real-valued functions and , are the lower bounds and the upper bounds of x , respectively. Also, let the feasible space in which every point satisfies all constraints be denoted by f and the set in which every point satisfies the upper and lower bound constraints be denoted by S (⊃ f) [18]. C. GSA Gravitational Search Algorithm (GSA) is a recently proposed method used on optimization problem, as seen in Rashedi et al. [7]. I t has been compared with some wellknown heuristic optimization methods, and the obtained results have demonstrated the high performance of the method. The GSA is constructed based on the law of Newtonian Gravity: ‘‘every particle in the universe attracts every other particle with a force that is directly proportional to the product of their masses and inversely proportional to the square of the distance between them’’. In the algorithm, all the individuals can be viewed as objects with masses. The objects attract each other by the gravity force, and the force makes all of them move towards the ones with heavier masses. The objects transform information by the gravitational force, and the objects with heavier masses become heavier. The GSA algorithm can be described as follows:

First assuming there are N objects and each of them has m dimensions, we define the ith object by: (1) th

Where, presents the position of i object in the dth dimension. At the tth iteration, the force acted on object i from object j in the dth dimension is defined: xid

(2) Where, G(t ) i s gravitational constant at iteration t , e is a small constant, and R(t) is the Euclidian distance between object i and object j: (3) And Mi(t) , qi(t) is the mass and fitness of each agent, worst and best is the maximum and minimum values fitness of agent in minimization problem.

q

(4)

M



(5)

And the total force acted on the dimension d of object i is given by: (6) Where, randj is a random number in the interval [0, 1]. Then the acceleration of object i in the dimension d can be calculated as: (7) Where Mi is the mass of object i, and the object moves according to the follows:

threaded object or task; each mass is defined by: = [cpusi, cpumi, cpupi, thrmj] i=1,…,s , j=1,…,t. Where: 1) cpus: CPU speed of each server in deployment diagram that annotated with PArate tag value of PAhost stereotype. 2) cpum: CPU multiplicity of each server in deployment diagram that annotated with PAmultiplicity tag of PAhost stereotype. 3) cpup: the price of CPU that will be calculated by: (9) Where H is speed coefficient. 4) thrm: Multiplicity of thread for each active object in UML diagram that annotated with PAmultiplicity tag of PAstep stereotype. Also, we can add other important parameters to evaluate performance carefully, but we restrict the number of parameters to control complexity of problem. Objective function is f(M) that minimizes response time. Response time is annotated with PAresponse tag in activity diagram and is measured by LQNS tools after model transformation. Two important constraints are considered. Total cost that must be limited and utilization of software and hardware resources that must be controlled between upper and lower bound. Note that the boundary constraints must also be added. First constraint is Total cost that controls and restricts the number of resources. Although more recourse decrees response time, total cost must be limited. The total cost defined as: TCost



Where v t is the velocity in dth dimension of object i at iteration t, is the position in dth dimension of object i at iteration t, and rand is a uniform random variable in the interval [0, 1], which adds a randomized characteristic to the search. IV.

PROBLEM FORMULATION

In this section the problem formulation, objective functions and solution space, is precisely described. Design options or performance specifications are annotated in software model by MARTE profile and describe a mass. Therefore, suppose that s is the number of servers and t is the number of multi-

cpum

(10)

Second constraint is resources utilization. Therefore mean utilization of software (for example task) and hardware resources must be measured. Utilization of cpus of the ith server for i=1,…,s is annotated with PAUtilization tag in deployment diagram. Therefore equation (11) measures the mean cpu utilization (MCU) of the ith server. MCU

(8)

H cpus

PAUtilization /cpum

(11)

Also, for computing Mean Task Utilization (MTU) of jth multi threaded task for j=1,…,t that it’s utilization annotated with PAUtilization tag in activity diagram, use equation (12): MTU

PAUtilization /thrm

(12)

Therefore, constraints are: 1.

T cos t − Lim ≤ 0

2. 3.

lowU ≤ MCU ≤ threshold lowU ≤ MTU ≤ threshold

Constraint 1 controls cost, because more resources provide less response time but, we must control cost. In constraints 2 and 3 fewer values than shows which resources are idle and not useful completely, and

more values than threshold shows the resource is in bottleneck. Therefore these constrained controls the usage of cpu and task as hardware and software recourses. The upper bound constraints and the lower bound constraints are: 0< cpusi

Suggest Documents