A Novel Algorithm for Optimizing Multiple Services Resource Allocation

Resource provisioning becomes more and more challenging problem in cloud computing environment since cloudbased services become more numerous and dynamic. The problem of scheduling multiple tasks for multiple users on a given number of resources is considered NP-Complete problem, and therefore, several heuristic based research methods were proposed, yet, there are still many improvements can be done, since the problem has several optimization parameters. In addition, most proposed solutions are built on top of several assumptions and simplifications by applying computational methods such as game theory, fuzzy logic, or evolutionary computing. This paper presents an algorithm to address the problem of resource allocation across a cloud-based network, where several resources are available, and the cost of computational service depends on the amount of computation. The algorithm is applicable without restrictions on cost vector or compaction time matrix as opposed to methods in the literature. In addition, the execution of the algorithm shows better utility compared to methods applied on similar problems. Keywords—Cloud computing; Cloud Services; Scheduling; Parallel and Distributed systems


I. INTRODUCTION
Cloud computing [1] has emerged recently as a new paradigm that moved enterprise computing from the classical host-based architecture pattern into the elastic computing pattern.This new service-oriented vision delivers resources and applications on-demand based on the pay-per-use concept.The cloud system should provide the application users with robustness, fault tolerance, execution automation, and powerful computing facilities.This implies various cloud service requirements and QoS to be maintained.Therefore, several challenges arise throughout the design development and deployment of these systems.In addition, unlike conventional software and hardware systems, a wide range of different issues should be considered in the design and operation of cloud based systems.On the other hand, the size of data centers have been continuously increased in order to accommodate the increasing demand while at the same time reducing the management costs.Finally, virtualization has been heavily used in order to increase the utilization of server resources by consolidating many virtual machines into a single physical server.Therefore, as cloud-based services become more numerous and dynamic, resource provisioning becomes more and more challenging.
While QoS problems in service and cloud based systems have been addressed in the literature, the problem of constrained resource allocation problem attracts a lot of attention, as it is considered difficult problem since it is affected by several aspects, such as assumptions about the services, tasks, subtasks, and communication between servers.The problem of scheduling multiple tasks for multiple users on given number of resources is considered difficult, and therefore, several research methods were proposed, yet, there are still many improvements can be done, since the problem has several optimization parameters and in addition, most proposed solutions are built on top of several assumptions and simplifications.
In this paper, we address the problem of resource allocation in which service demanders intend to solve sophisticated parallel computing problem by requesting the usage of resources across a cloud-based network, where several resources are available, and the cost of computational service depends on the amount of computation.The contributions in this paper include providing a simple algorithm for resource allocation for single user with multiple subtasks.Then, propose another algorithm for the multiple users problem using a selection function.The proposed algorithm is illustrated on example that was proposed in the literature, and the proposed method in this paper outperforms previous ones by two aspects: first, it can be applied on the general case without any restriction on the type of the computation time matrix for resource, nor on the cost function, as opposed to previous work.Second, the algorithm provides better schedule in terms of utility.
The rest of this paper is organized as follows: Section II provides a brief review on the state of the art on the subject.Section III describes the formalization of the single and multiple users problem.Section IV presents the proposed algorithm to solve the single user scheduling problem.Section V presents a selection function based algorithm for scheduling the multiple users problem.The proposed method is illustrated on an example in Section VI.Finally Section VII concludes the paper with future work hints.

II. RELATED WORK
In this section we present a brief state of the art review on related work that addressed the problem of resource allocation in cloud computing.In fact, more detailed reviews can be found in several surveys, for instance, [2], [3], [4], [5], [6], and [7].www.ijacsa.thesai.orgWalker et al. [8] presented a model in which the resultant profit is calculated by obtaining the storage space from cloud.Buyya et al. [9] have proposed an infrastructure for resource allocation in multiple clouds based on commodity pricing method.The work in [10] used virtualization in order to allocate data center resources dynamically based on application demands and support.The authors used skewness to measure the unevenness in the multidimensional resource utilization of a server and combined different types of workloads hoping to improve the overall utilization of server resources by reducing skewness.The work in [11] proposed a resource allocation technique by ranking the tasks of users based on error criteria to maintain the consistency in the priorities of the tasks.The authors in [12] presented a web semantic based resource allocation method using multi-agent technologies to model interoperability between the users and different resource.
Ergu et al. [13] proposed a model for task-oriented resource allocation in a cloud computing environment based on available resources and user preferences.The method considers response time as the measure in their allocation procedure.Genetic algorithms based tasks scheduling in cloud systems were addressed in [14], [15], and [16].The work in [17] addressed distributed convergence to fair allocations of CPU resources for time-sensitive applications for applications with service-level adaptation, that are executed by each application independently.The work in [18] addressed resource allocation in computational mobile grid.Karthik et al. [19] suggested to allocate the resources based on the speed and cost of different VMs in IaaS.It differs from other related works, by allowing the user to select VMs and reduces cost for the user.Zhen Kong et al. [20] proposed a mechanism to allocate virtualized resources among selfish VMs in a non-cooperative cloud environment.Hence, VMs care essentially about their own benefits without any consideration for others.Paul et al. [21] allocated cloud resources by obtaining resources from remote nodes when there is a change in user demand¿ In this method overprovisioning and under-provisioning of resources can cause several issues.The work in [22] dynamically allocated CPU resources to meet QoS objectives by first allocating requests to high priority applications.This method depends on prioritizing tasks which has several limitations in cloud environment.The work in [23] proposed to use live migration as a resource provisioning mechanism but all of them use policy based heuristic algorithm to live migrate VM which is difficult in the presence of conflicting goals.
Several other computing techniques were adopted for resource allocation in cloud computing.For instance, game theory has also been used in several locations for resource allocation in cloud computing, for instance in [24], and [25].Several other methods used fuzzy pattern recognition to propose dynamic resource-allocation algorithms for multiple cloud nodes such as [26], [27], and [28].On the other hand, cloud resource allocation using auction mechanism is addressed in [29], [30], [31], [32], and, [33].These mechanisms does not ensure profit maximization due to its truth telling property under constraints.
Despite the large amount of work on the subject, there is still lack of practicable solution for cloud computing systems because most cloud-based computational services are multiple QoS-constrained, in order to improve the utility of scheduling algorithms [25].The problem addressed in this paper considers multi-users with dependent tasks, each is composed of several subtasks to be scheduled on multiple resources.This paper presents a generic solution that can be applied the problem without the constrains on the execution time and cost imposed in previous work.The proposed mechanism is based on utility function trying to find a local optimum solution for the NPhard problem.

III. PROBLEM DESCRIPTION AND FORMALIZATION
We first present problem description for resource allocation for a single user, then we describe the general case, for multiple users as presented in previous work.A user u has a service S that is composed of k sub tasks that are parallel and dependent subtasks with equal amount of computation.In fact, this assumption is practical, since in case of unequal amounts of computing, the cost values of resources can be adjusted to normalize the amount of commutations for tasks.There are m computational resources that are available to the user, {R 1 , R 2 , ..., R m }.Each resource, R j , has a fixed price p j according to its capacity forming the price vector p = {p 1 , p 2 , ..., p m }.In addition, each resource R i require specific time, t i , to execute any subtask forming the execution time vector t = {t 1 , t 2 , ..., t m }.The objective is to assign subtasks for each user to a number of resources such that the the total cost is minimized, where cost represents the expense and execution time for completing tasks for all users.The scheduling problem solution is a non-negative vector v of m elements, each represent the number of subtasks assigned for each resource.The entry v i is the number of subtasks of the task S allocated to resource R i .The allocation vector v must satisfy We derive two vectors from vectors v, t, and p as follows: the first is the completion time vector, t and the second is the expense vector ê.The entry ti of t is the turnaround time it takes for resource R i to complete v j subtasks of the task S. The entry êi of vector ê is the expense S pays for resource R j to complete v j subtasks.These two vectors are defined as follows: Based on these we calculate two values for schedule v, the total execution time t max , and the total expense e v .The execution time for task S is the maximum execution time of tasks assigned to resources, t max = max{ ti | ti ∈ t}, where ti denotes the i th element of the vector t.The total expense e v is the summation of all expenses paid to all resources, e v = m i=1 e i .We assign weights for schedule costs as follows, w t for execution time weight, and w e for expense weight.Then we can define a merit value of the expense using the following utility function: The objective is to find v that maximizes u. while we will present our proposed methodology for a generalizers case, as opposed to the presented solution in there.Next we give an example to illustrate the problem described above.Given five computational resources (R 1 − R5), m = 5, and given the price vector p = (1, 1.2, 1.5, 1.8, 2), there is a task (S), that has three subtasks, k = 3.The execution time vector for each subtask using above resources is given as t = (5, 4.2, 3.6, 3, 2.8).Assume that a www.ijacsa.thesai.orgschedule v = (1, 1, 1, 0, 0) is used, then we can calculate t and ê as follows: t = (5, 4.2, 3.6, 0, 0) and ê = (5, 5.04, 5.4, 0, 0), then we can calculate, t v = 5 and e v = 15.44.Assuming w e = w t = 1, then u = 1 tv+ev = 0.0489.On the other hand, the schedule v = (0, 0, 1, 1, 1) will yield to u = 0.05.
Next, we present the model for the problem with multiple users sharing the same number of resources as described above.Given n users {u 1 , u 2 , ..., u n }, who are interested in executing n services, {S 1 , S 2 , ..., S n }, where every S i is one single task that is composed of k i subtasks, that are parallel and dependent subtasks with equal amount of computation.k = {k 1 , k 2 , ..., k n } represents the number of subtasks for all users.There are m computational resources that are shared by all users, {R 1 , R 2 , ..., R m } with price vector p.All users who allocate their services to resource R j proportionally share the capacity and expense of resource R j .In addition, each resource R i require specific time, t ij , to execute subtask τ for user u j using resource R i , forming the execution time vector T i for every resource.The collection of all vectors T 1 , T 2 , . . ., T m forms the execution time matrix T .Since all subtasks of S i are parallel and dependent, the completion time of task S i is defined similar to above as max{T ij |T ij ∈ T i }, where T ij denotes the element of matrix T in row i and column j.
The objective is to assign subtasks for each user to a number of resources such that the the total cost is minimized, where cost represents the expense and execution time for completing tasks for all users.The scheduling problem solution is a non-negative matrix A of m rows and n columns, each element represents the number of subtasks assigned for each resource.The entry A ij is the number of subtasks of the task S i allocated to resource R j .The allocation matrix A must satisfy the following constraint n j=1 A ij = k j , where j = {1, 2, . . ., m}.
We derive two matrices from matrix T , schedule A, and vector p as follows: the first, is the completion time matrix, T and the second is the expense matrix Ê.The entry Tij of T is the turnaround time it takes for resource R j to complete A ij subtasks of the task S i .The entry Êij of matrix Ê is the expense user S i pays for resource R j to complete A ij subtasks.These two matrices are defined as follows: Based on these two matrices, we calculate two vectors for schedule A, the first vector, T max , is composed of m elements, each element T maxi represents the execution time for task S i using schedule A, and is defined as the maximum execution time of tasks assigned by user i to all resources, T maxi = max{ Tij |j = {1, 2, ..., n}}.The second vector, E sum , is composed of m elements, each element, E sumi , represents the total expense for user S i , and is defined as the summation of all expenses paid to all resources by user Êij .We assign weights for schedule costs as follows, w t for execution time weight, and w e for expense weight.Then we can use definition for a merit value of the expense use the utility function defined above:

Êij
. Then the utility of schedule A can be defined as the summation of utilities of all users: Next we give an example to illustrate the problem described above for multiple users.We will use a similar problem to the one described in [25], however, problem description in [25] is based on the following two assumptions: (1) the price vector of all resources p = (p 1 , p 2 , .., p m ) satisfies p 1 < p 2 < • • • < p m , and (2) the corresponding execution time of any subtask of an arbitrary task S i satisfies T i1 > T i2 > • • • > T im .We believe that the above assumption is valid for only limited applications, and the method used based on game theory can have a Nash equilibrium only under the given assumption.The algorithm proposed in this paper can be applied on any price vector, p, and execution time matrix, T , regardless of the order.We will explain the problem statement using the same example, since it is going to be used as illustrative example on the proposed algorithm later.Given the price vector p described above, k = {2, 3, 4}, the execution time matrix T and schedule A given as below, then we calculate the two matrices T , Ê and two vectors T max and E sum as follows: This example shows the optimization needed in order to enhance utility of the scheduling problem, while there is tradeoff between the execution time and the price for every assignment.First, a proposed solution for the single user case is provided, where the optimum solution can be obtain.In fact, while similar problems have been addressed in the literature, we believe that the solution we provide is the most efficient one.The algorithm for the multiuser problem, which is considered NP compete problem, will be based on a selection function that is designed using the solution for the single user problem.We define a function that calculates the effect of scheduling tasks into resources, and use it for the choice of proper allocation of every service.www.ijacsa.thesai.orgAlgorithm 1 Singel User Resource Allocation 1: procedure SINGLE USER ALLOCATION 2: Input: k, m, t, p, n.

IV. OPTIMIZING SINGLE USER SCHEDULING
In this section we present the solution for the single user optimization problem based on the description in the previous section.The objective is to find the allocation vector v the maximizes the utility u(v).For k subtasks and m resources, it is obvious that the search space for the problem is nonpolynomial, hence exploring all possible scenarios is nonlinear.
In order to show how the proposed algorithm finds the optimum solution, we first create a variable t max and initiate it to 0. Then, we define a selection function, δ, as a vector of m elements, δ = (δ 1 , δ 2 , . . ., δ m ), which is defined initially as follows: Then, we start the allocation of k subtasks by following an iterative process, where in every iteration, we assign one subtask into one resource.We choose l, such that satisfies the following conditions: (1) 1 ≤ l ≤ n, and (1) ∀i • 1 ≤ i ≤ n ⇒ δ l ≤ δ i .This means that δ l is minimum in δ.Then, we assign the current subtask into resource R m .After the assignment, we modify the schedule v by incrementing v l , calculate the new tl , δ l , and tmax .Then we repeat the process again, until all items are processed.This algorithm has a complexity of worst case O(nm), i.e. it should perform in linear time vs n × m.Applying the above algorithm on the single user example explained above will result in v = (0, 0, 1, 1, 1), with utility u = 0.05.In addition considering the scheduling problem for multiusers presented in the previous section, if the problem is solved individually, i.e. every user schedule his subtasks using the algorithm 1 above, then, the resulting schedule will be v 1 = (0, 0, 0, 1, 1), v 2 = (0, 0, 1, 1, 1), v 3 = (1, 1, 1, 0, 1), all combined together will give schedule A provided below.Hence, under this assumption, the schedule for multiuser will have the utility of u A = 0.1273.Obviously, this is not the optimum solution for the multiuser case.For instance, the schedule given in the example in the previous section yields better utility.Therefore, in the next section, we parent a selection function based algorithm for utility optimization for the multiuser scheduling problem described above.
The algorithm is developed based on the fact that the single user algorithm alone does not lead into the optimum solution when generalized into the multiple users case.Obviously the reason, is that any subtask scheduled at a given resource, affects the execution time of that resource for other users.Therefore, we will develop the scheduling algorithm based on two issues: scheduling subtasks as pairs, and using a selection function that takes into account the current optimum choice for the single users scheduling problem and combine it with other facts, such as the number of unscheduled subtasks.In fact, The objective is to find the allocation matrix A the maximizes the utility u A form a given execution time matrix T and price vector p.The problem is described in the literature as NP-Complete, and hence heuristic based solutions can be used to provide the best possible solution.For n users, each has k i subtasks, where 1 ≤ i ≤ n, and m resources, we first create two empty matrices T and Ê, each of n × m elements and initialize them to zeros.We also create the two vectors T max , and E sum , each of n elements, and a variable T E , all initialized to zeros as well.Let ∆ be a matrix of n × m elements, initialized as follows: Next, we define a vectors, T A of m elements initialized to zero, represents the total number of subtasks assigned to every resource.At any time during the scheduling process, ∆ il , that takes into account the number of unscheduled subtasks, where ∆ il is minimum in row i in the matrix ∆.
Subtasks are then allocated for users using the selection function, Θ, to choose two users, α and β, such that 1 ≤ α, β ≤ n, and the following two conditions are satisfied, (1) Then, for each user, α and β , we choose the entry that leads to best single user utility using the single user optimization algorithm, γ α for task α, and γ β for task β, such that 1 ≤ γ α ≤ k α , and 1 ≤ γ β ≤ k β , and the following two conditions are satisfied: (1) Hence, two subtasks with minimum values in ∆ are to be scheduled for two user .
In fact, the assignment of the two subtasks are chosen simultaneously for a valid reason, when a single subtask is assigned the allocation matrix will be modified, and hence the local utility matrix ∆ will be modified.After several considerations, it was found that sleeting a single subtask and assigning it to the best available entry ∆ ij leads to bad www.ijacsa.thesai.orgAlgorithm 2 Multiple User Resource Allocation Algorithm 1: procedure ALLOCATION 2: Input: k, n, m, T , p.

24:
• updates all variables for by assigning subtask for user α assigned to service γα 25:

32:
• updates all variables for by assigning subtask for user β to resource γ

40:
UNTIL kα = 0 41: END 42: end procedure schedule, due to the effect of every single subtask scheduled on the final commutation time (maximum time) for every user.We then update the list of parameters in two steps, each for one assignment.All variables T , ∆, T max , E sum ,T A , and T E are updated as follows for each task assignment of subtask for user α by scheduling at at service γ α as follows: Values in the matrix ∆ are updated based on the best utility for the single user case described in the previous section.In the next step of the same iteration, the same process is repeated for the assignment of the subtask of user β for service γ β .In the next iteration, the function Θ is used to select two tasks, and the function ∆ is used to select two schedules for each tasks, and then, the best combination is selected.The process is repeated until all tasks are scheduled.In case, there is only one task left with one or more subtasks, then direct assignment using the function ∆ is conducted until all subtasks are processed.The outcome depends on the selection function, i.e., the order on which the users are selected for scheduling and the resource their subtasks are allocated to.Hence, we intend to test the algorithm for more than one selection function.Algorithm 2 shows the step by step description of the process and is illustrated on a detailed example in the next Section.In addition, the algorithm is tested with tow different selection functions, and in both it outperforms evolutionary and game theory based algorithms.

VI. ILLUSTRATIVE EXAMPLE
Let us consider the multi-user example given in Section 3, and demonstrate the algorithm above in order to find an appropriate allocation matrix.All initial values for inputs are as given in the example above.We start calculating initial values using the algorithm above, then we choose α = 3, β = 2 using the selection function.Then we choose two entries in ∆ with minimum values: γ α = 5 and γ β = 4.The combination (γ α , γ β ) = (5, 4) is selected, hence, a subtask for user u 3 will be scheduled to service R 5 , followed by a subtask of user u 2 to service R 4 .Based on this, the allocation matrix, A, will be updated with these schedules in the next step.This is illustrated in the initial step indicated as λ 0 in Table I below, where the numbers in bold represent the active ones.
We observed that the selection function has direct effect on the outcome for the algorithm, therefore, we did execute the algorithm by choosing the selection function as follows Θ i = 1 1+ki + 1 ∆ il , then applying the above steps will lead into the schedule A given below, which has a utility of u A = 0.1416, obviously, this shows an enhancement of around 6.2% over the utility in achieved in [25].A = 0 0 0 0 2 0 0 1 2 0 2 2 0 0 0 www.ijacsa.thesai.org

VII. CONCLUSION AND FUTURE WORK
While cloud computing technology is increasingly being used, effective resource allocation methods are required in order to maximize profit for cloud service providers, provide energy efficient methods, and at the same time achieving user satisfaction.This paper proposes a model for task-oriented resource allocation in cloud computing, where the problem of scheduling single user with multiple dependant subtask on multiple available resources with different execution time and cost is addressed first.Then, the general problem of scheduling multiple users, each with multiple subtask on multiple available resources is addressed.The proposed solution is provided by introducing a selection pairwise function based on subtasks completion time and task costs.The problem addressed in this paper is described as NP-Complete, hence, the presented solution present a local optimum schedule.The proposed method, compared to existing techniques, is applicable on scheduling problems without any restrictions on the execution time and price, in particular as compared to game theoretic approaches [25], where the execution time must be given in ascending order, and the price in descending in order to find Nash equilibrium.In addition, the proposed method outputs schedule with better utility than game theoretic one.
We intend to provide implementation for the method, and test for problems with large number of users and resources.In addition, we intend to try to modify the selection function to further improve the utility of the schedule by considering the weight of the subtasks to be scheduled in the future including price and completion time.In addition, since formal methods have been proposed thouroughly for the analysis of differnt cloud applications [34], we intend to use formal analysis to model and validate the proposaed algorithm.

TABLE I :
Execution of the algorithm on the above example