Available online at www.sciencedirect.com
Electronic Notes in Discrete Mathematics 47 (2015) 53–60
www.elsevier.com/locate/endm
VNS-based heuristic with an exponential neighborhood for the server load balancing problem I. Davydov
1,3
Y. Kochetov 2,3
Novosibirsk State University, Novosibirsk, Russia
Abstract We consider the server load balancing problem which is originated from optimal web hosting in cloud computing. We have developed VNS-based heuristic to tackle this problem. In order to improve the efficiency of the algorithm, we apply new exponential neighborhood based on the assignment problem. Computational experiments on real world and randomly generated test instances indicate the efficiency of the algorithm. Keywords: variable neighborhood, metaheuristic, assignment problem, large neighborhood
1
Introduction
We consider the following problem which is originated from optimal web hosting in cloud computing [8]. We are given a finite set of servers. Each server 1
Email:
[email protected] Email:
[email protected] 3 This work was carried out in Novosibirsk State University and supported by the Ministry of education and science of the Russian Federation, contract N02.G25.31.0054. 2
http://dx.doi.org/10.1016/j.endm.2014.11.008 1571-0653/© 2014 Elsevier B.V. All rights reserved.
54
I. Davydov, Y. Kochetov / Electronic Notes in Discrete Mathematics 47 (2015) 53–60
contains the set of disks (or images of disks). Internet sites with heterogeneous information are distributed among the disks. A lot of users visit these sites and generate the load for the servers. The load is changed during time interval and can be characterized by some parameters: CPU, RAM, and others. We assume that the number of requests of users are known for each site and as a result for each disk and each server. If the load of the server does not exceed a given threshold, we say that the server is working in regular mode. Otherwise, an overload appears which causes abnormal client-request processing time. To avoid the overload, we can move the disks to another one. Such moving requires some computational efforts. We will call them as overhead expenses. We assume that the expenses are known for each parameter if a disk is extracted from one server and moved to another one. An initial location of disks among the servers is given. The problem is to find a relocation of disks to minimize the total exceeding over the thresholds during the time interval subject to overhead expenses for each server. To tackle this problem, we suggest the local search approach based on the VNS framework [3,4]. We use simple neighborhoods with linear and quadratic power and present a new neighborhood with an exponential power. The main idea of new neighborhood is to choose one disk from each server and relocate these disks in an optimal way. Each server gets one disk and the total overload is minimized. The solution of the assignment problem gives us the optimal disks relocation.
2
Mathematical model
Let us introduce the following notations: S is the set of servers, D is the set of disks, T is the time interval, R is the set of parameters and cdrt is the load of disk d in time t with respect to parameter r, csr is the threshold of the server s with respect to parameter r, x0ds is the initial distribution of the disks, e bw sdr (bsdr ) are the overhead expenses of inserting (ejecting) disk d to (from) server s with respect to parameter r, w e Bsr (Bsr ) are the maximum allowed overhead expenses of inserting (ejecting) disks to (from) server s with respect to parameter r. Decision variables: xds = 1, if disk d is located on server s, and xds = 0 otherwise. ystr is the overload on server s in time t with respect to parameter r.
I. Davydov, Y. Kochetov / Electronic Notes in Discrete Mathematics 47 (2015) 53–60
55
Now we can write the problem as the mixed integer linear program [8]: min
(1)
ystr
s∈S t∈T r∈R
(2)
ystr ≥
s. t.
cdrt xds − csr for all s ∈ S, t ∈ T, r ∈ R,
d∈D
(3)
xds = 1 for all d ∈ D,
s∈S
(4)
0 w bw sdr xds (1 − xds ) ≤ Bsr for all s ∈ S, r ∈ R,
d∈D
(5)
e besdr x0ds (1 − xds ) ≤ Bsr for all s ∈ S, r ∈ R,
d∈D
(6)
ystr ≥ 0, xds ∈ {0, 1} for all d ∈ D, s ∈ S, t ∈ T, r ∈ R.
The goal function (1) gives the total overload among all servers through the whole time interval. Inequality (2) determines this overload for each server and each parameter in each time moment. Equality (3) ensures that each disk is located exactly on one server. Inequalities (4) and (5) restrict the overhead expenses for insertion and ejection of disks for each server and each parameter. Note that the problem is strongly NP-hard even for |T | = 1, |R| = 1. It is easy to see that the well known 3-partition problem can be reduced to this particular case of the problem (1)–(6). Remind that in the 3-partition problem we are given a positive integer b and a set N = {1, 2, ..., 3m} of 3m elements. Each element j has a positive integer size aj , and 3m j=1 aj = mb. The problem is to determine whether a partition of the set N into m subsets, each containing exactly three elements from N and such that the sum of the sizes in each subset is b, exists. This problem is NP-hard in the strong sense. To reduce it to our problem, we put |S| = m, |D| = 3m, csr = b, cdrt = ad for all s ∈ S, d ∈ D. Commercial software, for example, CPLEX, GUROBI, and others may be applied to solve the problem. Unfortunately, the problem has large integrality gap. As a result, we can find optimal solution for small instances only. For example, in case |S| = 20, |D| = 200, |T | = 150, |R| = 2, CPLEX software can not find optimal solution during 24 hours. This lead us to develop metaheuristics which perform well in solving hard optimization problems.
56
3
I. Davydov, Y. Kochetov / Electronic Notes in Discrete Mathematics 47 (2015) 53–60
Variable neighborhood search
In order to develop local search based heuristics we should choose the appropriate neighborhoods. The choice of neighborhoods is very important because it crucially affects the efficiency of the algorithms. In this work we use three neighborhoods. Two neighborhoods have polynomial size. The third one has exponential size. Elements of this large neighborhood are optimal solutions of the assignment problem. Using of large neighborhoods allows us to increase the efficiency of computational methods [1,7]. Let x = (xds ) be a feasible solution. By Move(x) we denote a set of feasible solutions which can be obtained from x by choosing one disk, ejecting it from the server and inserting it to another server. This neighborhood contains at most |D| · |S| solutions. The second neighborhood consists of all feasible solutions which can be obtained from x by swapping two disks between different servers. We denote this neighborhood as Swap(x). It contains at most |D|2 solutions. Although these neighborhoods are polynomial, we will use of theirs randomized versions. This trick allows to increase the efficiency of the local search and reduce the computational efforts per iteration [3,9]. By Moveq (x) we denote randomized neighborhood with the parameter q, 0 < q < 1. Moveq (x) is a part of Move(x) neighborhood. Each element of Move(x) is included into Moveq (x) with probability q. Swapq (x) neighborhood is defined in a similar way. Now we introduce a new neighborhood Assign(x). Its elements are constructed as follows. For each server we define a set of disks Ds , s ∈ S which may be ejected from server s under constraints (5). Then we eject one disk from each set Ds . Subset of the ejected disks we denote as D. If Ds = ∅ for server s, we eject a dummy disk which has no load and overhead expenses. We define Δds as the total overload of server s if we eject one disk from server s and then insert disk d from the set D: Δds = max 0, cd rt xd s − csr + cdrt , t∈T r∈R d ∈D\D
if constraints (4) hold and Δds = +∞ otherwise. Define new variables: zds = 1 if the disk d from D is inserted on server s, and zds = 0 otherwise. We can get an optimal relocation of ejected disks by solving the assignment problem: (7) min{ Δds zds | zds = zds = 1, zds ∈ {0, 1}, d ∈ D, s ∈ S}. d∈D s∈S
d∈D
s∈S
I. Davydov, Y. Kochetov / Electronic Notes in Discrete Mathematics 47 (2015) 53–60
57
The goal function provides the total overload of all servers during the time interval. Constraints ensure that each disk moves to one server only, and each server gets exactly one disk. Note that if Ds = ∅, ∀s ∈ S, the solution of the assignment problem does not change the number of disks on each server. The following trick allows us to expand capabilities of this neighborhood. Let us assume that each server contains one dummy disk without load and overhead expenses. If this disk is included in D, then none of disks were ejected from the server. Hence, in the optimal solution of the assignment problem one of the servers gets a dummy disk, thus the number of disks on this server decrease by one. Thereby, we can reclaim the shortcomings of this neighborhood, e.g. do not eject disks from some servers, for example, from servers with minimal load. As we have mentioned before, the elements of this neighborhood are optimal solutions of the assignment problem. Thus, the size of this neighborhood is equal to s∈S (|Ds |+1), if the optimal solution of the assignment problem is unique. Exploration of this neighborhood requires huge computational time. So, we will use randomized version of this neighborhood [3,9]. During the local search, we will randomly generate lmax instances of the assignment problem and return the improved solution. General framework of our VNS method can be presented as follows: (i) Put xds := x0ds , define parameters q, lmax , kmax and stopping condition. (ii) Repeat the following sequence until the stopping condition is met: (a) k := 1; (b) Repeat the following steps until k = kmax : Choose k disks randomly and move them to other servers; Apply local improvement algorithm by Moveq and Swapq neighborhoods. Apply the assignment problem (7) for improving the current solution lmax times. If the improved solution x is better than x, then x := x and k := 1, otherwise k := k + 1. (iii) Return x. As the stopping condition we use the running time of the method. Elements from the sets Ds are selected at random with uniform distribution. To accelerate the method we put q = 0.3, lmax = 5 and kmax =7.
58
4
I. Davydov, Y. Kochetov / Electronic Notes in Discrete Mathematics 47 (2015) 53–60
Computational experiments
The developed algorithm was implemented in Delphi 7.0 and tested on PC Intel Core i5 3.20GHz, RAM 4Gb 32-bit. The experiments were conducted on the randomly generated test instances from [8] where |S| = 20, |D| = 200, |T | = 150, |R| = 2. Moreover, we have used the algorithm for real world application where |S| = 20, |D| = 200, |T | = 1008, |R| = 6. Computational results for random instances are presented in Table 1. The first column indicates the value of the threshold parameter csr of the servers. Columns from the second to fifth contain results of the experiments from [8]. The value FLP gives us the optimal value of the linear programming relaxation and provides the lower bound on the global optimum. The value tLP indicates computational time in seconds. The forth and fifth columns represent the results of an approximation algorithm based on the linear programming relaxation. Algorithm was terminated after 50 minutes. The best found solutions are presented in column FILP . As we can see, in some instances 50 minutes was not enough for getting any valuable results. The last two columns demonstrate the results of the VNS algorithm. Column FV N S presents the objective function value, column tV N S indicates computational time in seconds. Algorithm was stopped after 20 minutes or in case the lower bound was reached. Note that the problem can be solved easily if the server threshold is high. The exact solution is found within one second. Instances with low threshold level are easy as well. If csr = 600, one second is enough to reach the lower bound. In cases of threshold level from 800 to 810 we were able to find yet unknown optimal solutions. For the threshold level from 650 to 750, the lower bound was not reached, although in case csr = 650 the difference between the optimal solution and the lower bound is less than 1%. Similar results were obtained w e for the same instances with Bsr = Bsr = 1500. The most difficult instances correspond to threshold level 700. In the next experiment we used this value of csr . The results of the experiments on 10 test w e instances with Bsr = Bsr = 500 are presented in Table 2. Comparison of the last three columns show that the VNS algorithm outperforms the previous one although looses in the third instance. Nevertheless, the last column shows that deviation of the results from the lower bound ε = 100%(FV N S − FLP )/FV N S is small enough even in this case. In the last experiment we used the real data from some servers and applied the VNS algorithm for load balancing. Computational results have shown that our approach can reduce the total overload considerably if we terminate the calculations after one hour.
I. Davydov, Y. Kochetov / Electronic Notes in Discrete Mathematics 47 (2015) 53–60
Table 1 w = B e = 500 Computational results for Bsr sr csr
tLP
FLP
tILP
FILP
tV N S
FV N S
850
2
0
6
0
1
0
840
2
0
7
0
1
0
830
2
0
17
0
1
0
820
2
0
70
0
2
0
810
2
0
3000
1834
6
0
800
2
0
3000
2480
14
0
750
198
0
—
—
1200
13965
700
423
96911
3000
188306
1200
129511
650
160
382399
607
407792
1200
383448
600
58
682399
85
702039
1
682399
Table 2 Computational results for csr = 700 Instance
FLP
FILP
FV N S
ε(%)
1
234 387
331 819
246 780
5,0
2
327 380
367 169
329 868
0,8
3
486 154
498 036
531 918
8,6
4
404 395
488 143
417 768
3,2
5
346 045
393 182
353 489
2,1
6
341 400
475 071
384 536
11,2
7
407 088
428 234
407 594
0,1
8
256 666
325 084
281 827
8,9
9
322 371
361 414
325 038
0,8
10
549 565
567 503
561 315
2,1
59
60
5
I. Davydov, Y. Kochetov / Electronic Notes in Discrete Mathematics 47 (2015) 53–60
Conclusions
We have considered the server load balancing problem and shown that it is NP-hard in the strong sense. We have presented the VNS-based algorithm with polynomial and exponential neighborhoods. Optimal solutions of the assignment problem have used for finding elements of the exponential neighborhood. Computational results for real world and randomly generated test instances have been reported. For future research it is interesting to investigate some new ideas for VNS, for example, optimal recombination operators [5,6,2] instead of the random shaking at Step (b) of the method.
References [1] Ahuja, R. K., O. Ergun, J.B. Orlin and A.P. Punnen, A survey of very large–scale neighborhood search techniques, Discrete Applied Mathematics 123 (2002), pp. 75–102. [2] Davidovic, T., Teodorovic, D. and Selmic, M., B ee colony optimization - Part I: The algorithm overview to appear in Yugoslav Journal of Operations Research (2014) DOI 10.2298 / YJOR131011017D. [3] Davydov, I., Y. Kochetov, N. Mladenovic and D. Urosevic, F ast metaheuristics for the discrete (r|p)-centroid problem, Automat. Rem. Contr. 75 (2014), pp. 106–119. [4] Hansen, P. and N. Mladenovic, V ariable neighborhood search, European Journal of Operational Research 13 (2001), pp. 449–467. [5] Eremeev, A., O ptimal recombination in genetic algorithms for combinatorial optimization problems - Part I, Yugoslav Journal of Operations Research 24 (2014), pp. 1–20. [6] Eremeev, A. and Kovalenko, J., O ptimal recombination in genetic algorithms for combinatorial optimization problems - Part II, Yugoslav Journal of Operations Research 24 (2014), pp. 165–186. [7] Kochetov, Y., E. Alekseeva, T. Levanova and M. Loresh, Large neighborhood local search for the p-median problem, Yugoslav Journal of Operations Research 15 (2005), pp. 53–63. [8] Kochetov, Y. and N. Kochetova, T he server load balancing problem (in Russian), Vestn. Novos. U. Inf. Tech. 11 (2013), pp. 71–76. [9] Melnikov, A., Randomized local search for the discrete competitive facility location problem, Automation and Remote Control 75 (2014), pp. 700–714.