Journal of Information & Computational Science 10:11 (2013) 3305 3312 July 20, 2013 Available at http://www.joics.com Load Balancing Algorithm Based on Services Yufang Zhang a, Qinlei Wei a,, Ying Zhao a, Chuan Li b a College of Computer Science, Chongqing University, Chongqing 400030, China b Department of Computer Science, Wayne State University, Detroit, MI 48202, USA Abstract In this paper, we present a dynamic load balancing algorithm based on the service types and load at each node in order to solve the load balancing issue for clusters. We choose proper parameters to calculate the load at each node so that each service obtains a unique status, which makes the distributions of tasks different, thus the server cluster is used adequately. We use random probability distribution to ensure uniform load distribution. We also utilize load increment and correction to guarantee system stability. Our simulations in OPNET show that the algorithm can effectively improve the load balancing efficiency. Keywords: Load Balancing; Parameters; Load Increment; OPNET 1 Introduction With the development of information technology, informationization has penetrated into all fields. Sectors such as enterprises, government and military are accelerating their information development in order to adapt to new circumstances. In order to fully display the enterprise image, enhance communication and facilitate business, enterprises usually provide all kinds of network services for customers or employees, such as HTTP, Mail, FTP etc.. Moreover, according to the 30th statistical report on the Internet development in China, by the end of June 2012, the number of Chinese Internet users had reached 538 million, and the Internet penetration rate had been 39.9%. In the first half of 2012, Internet users increased by 24.5 million and the penetration rate increased by 1.6%. Due to the increasing number of users and extensions of service types, the low performance and poor scalability of a single server make it the bottleneck of network services. The cluster system has higher performance and extensibility and is more convenient for management and maintenance, so technicians hope to deploy a variety of services on cluster to guarantee the stability and reliability as well as the high quality of services. Cluster is a set of independent computers interconnected through a high-speed network and managed as a single system pattern. The internal structure of cluster is transparent to clients, Corresponding author. Email address: weiqinlei@gmail.com (Qinlei Wei). 1548 7741 / Copyright 2013 Binary Information Press DOI: 10.12733/jics20101925
3306 Y. Zhang et al. / Journal of Information & Computational Science 10:11 (2013) 3305 3312 i.e., they only feel that a high performance server is providing the service. According to different functionalities, clusters fall into three categorieshigh performance computing clusters, high availability clusters and load balancing clusters. The purpose of the load balancing clusters is to distribute the network load to each node in cluster as fairly as possible. In the circumstances of heavy load, load balancing cluster ensures quick service response using the set of server nodes with scalability and high performance [1]. As a type of dynamic equilibrium technology, the load balancing algorithm analyzes the network data-flow in real time and grasps network conditions and then distributes the task reasonably and evenly. Based on the existing networking infrastructure, this technique provides a cheap and effective way to extend the bandwidth and improve the throughput, and further strengthen the ability of processing data as well as improve the flexibility and availability of network. 2 Problem Formulation A load balancing algorithm is the core of a load balancing cluster [2], and there are mainly two categories of load balancing algorithms: static load balancing algorithms and dynamic ones [3, 4]. Static load balancing algorithms make decisions based on prior knowledge, and tend to ignore the current load condition of a system. Usually, they are used in systems with regular tasks. Dynamic load balancing algorithms determine the distribution of task according to the real-time load condition of servers. They are typically used in the systems with uncertainties in tasks. According to the current state for load distribution, they have a great deal of flexibility and pertinence. If we only consider one simple index, the traditional dynamic load balancing algorithms cannot estimate the load condition at each node correctly. Besides, they fail to have any updates for the load for a long time, thus the balancing effect is usually not satisfied. So many researchers study from all perspectives and present many modified dynamic load balancing algorithms. For example, Jian Liu et al. have put forward a load balancing algorithm based on dynamic feedback [5], which considers the performance and the actual load at each node when controlling the distribution of tasks and adjusts the load of nodes timely through the dynamic feedback mechanism to ensure that the system runs smoothly in a long time. Qi Zheng et al. have proposed another load balancing algorithm based on classification of contents [6], which fully consider the user requests and the differences between the server nodes. It classifies the user requests and distributes them to each node fairly, thus guaranteeing that each node gets roughly the same amount of requests with different kinds. Several improved dynamic load balancing algorithms collect all index of servers as complete as possible and fully consider the node performance, load and other information to control the distribution of the requests. In addition, they dynamically adjust the system through the feedback mechanisms that guarantee the system stability and increase the load balancing effect significantly. However, these dynamic load balancing algorithms usually focus on only one type of services. For the case when various services coexist, they treat all services as the same and deal with them in the same way, which may not be desirable in real world scenarios. Therefore, in this paper, we propose a novel load balancing algorithm based on services with dynamic feedback. Our algorithm chooses the corresponding parameters to calculate the load and other information according to the service types and then control the task allocations using the nodes current state, which makes sure that server resources are fully used and each node gets consistent load with its performance.
Y. Zhang et al. / Journal of Information & Computational Science 10:11 (2013) 3305 3312 3307 3 Load Balancing Algorithm Based on Services In order to better explain our algorithm, we present the related concepts involved in our algorithm as follows: 3.1 Node Performance and Load Calculation Nodes S = (S 1, S 2,, S n ) in cluster are often heterogeneous, and the ability of a node varies a- mong different services, so we must consider the performance of node when allocating the requests. In this paper, we calculate the performance C(S i ) of the node S i as follows: C(S i ) = k 1 n C(C i ) + k 2 C(M i ) + k 3 C(D i ) + k 4 C(N i ) i = 0, 1,, n 1, k j = 1 (1) where n is the CPU number, C(C i ) is the CPU frequency, C(M i ) is the memory capacity, C(D i ) is the disk I/O rate and C(N i ) is the network bandwidth. In addition, we apply Eq. (2) to calculate the load L(S i ) of the node S i. L(S i ) = k 1 L(C i ) + k 2 L(M i ) + k 3 L(D i ) + k 4 L(N i ) i = 0, 1,, n 1, j=1 k j = 1 (2) where L(C i ) is the CPU occupancy rate, L(M i ) is the memory occupancy rate, L(D i ) is the disk I/O occupancy rate and L(N i ) is the network bandwidth occupancy rate. Furthermore, we use a vector k = (k 1, k 2, k 3, k 4 ) to denote the weights for each index, which reflects the dependence degree with various index for different types of services. For example, a calculation task mainly consumes CPU resources, without the need of I/O resources, while an I/O-based task mainly occupies I/O, without involving any CPU resources [7]. Therefore, the value of the same index is different in different types of services. In real-world applications, these parameters can be adjusted in accordance with the current running situation of a system so as to achieve better performance. j=1 3.2 Load Increment Dynamic load balancing algorithms require regular updates with server information, but they cannot get the load information timely during updating, so we need to introduce the load increment for load correction. A load increment [5] δ refers to the part of load of a server node brought by a certain type of request distributed to itself, and is calculated by Eq. (3). δ = L(S) / n (3) where L(S) is the load of a node which is used to calculate the load increment, n is the request number of the node. Note that load increments are closely related to service types, so the load increments of different services should be calculated respectively. In order to improve the system stability, the load increment δ needs to be adjusted automatically online.
3308 Y. Zhang et al. / Journal of Information & Computational Science 10:11 (2013) 3305 3312 3.3 Load Balance During the update period, system needs load balance when new request coming or task completed. We may need to revise the load of node to estimate the condition of the node as accurately as possible. Load correction [5] is calculated by Eq. (4), where δ denotes the load increment, C(S) denotes the performance of the node which is used to calculate the load increment, C(S i ) denotes the performance of the current node, L(S i ) denotes the load of the current node. L(S i ) = L(S i ) ± δ C(S)/C(S i ) i = 0, 1,, n 1 (4) However, it will increase the burden of nodes to monitor whether the request has been finished. In order to avoid this phenomenon, our algorithm does not directly monitor the requests completion status, instead, we achieve this by the adjustment of the load increments. In the update period, if the cluster completes more requests than it is assigned, the load will decrease, and then the load increment should decrease too after revised, and vice versa. Thus it can make up for the influence with the load when the node gets or finishes requests, and this will get the same effect with the load of the node. Finally, the load correction is calculated by Eq. (5), where δ represents the load increment and should be adjusted after load update, C(S) stands for the performance of the node which is used to calculate the load increment, C(S i ) is the performance of the current node, L(S i ) is the load of the current node. L(S i ) = L(S i ) + δ C(S)/C(S i ) i = 0, 1,, n 1 (5) 3.4 Random Probability Distribution If we always choose the node with the smallest load for request distribution, all the requests may be assigned to the same node in a short time, the node s load will increase quickly, and then requests will be assigned to the node with the second-smallest load, and so on. The cluster system will generate jitter. Therefore, we use the way named random probability distribution. When distributing requests, we firstly choose those nodes with smaller load as candidate nodes constituting the nodes set for distribution, then allocate the requests according to the probabilities of nodes in the set, ensuring that the distribution of the requests is uniform and the jitter is avoided. 3.5 Load Balancing Algorithm Based on Services The design idea of the algorithm is given as follows: according to different service types, we choose the corresponding parameters to calculate the load and performance of nodes and use them to control the task allocation, thus making sure that the request is assigned to the right node. The uneven distribution of load between the candidate nodes is solved by the random probability distribution. By using load increments to adjust the load of nodes, our cluster system becomes more steady and flexible. In what follows, we describe the load balancing algorithm based on services with dynamic feedback: (1) Set a threshold ε.
Y. Zhang et al. / Journal of Information & Computational Science 10:11 (2013) 3305 3312 3309 (2) When a new request arrives, we choose the corresponding parameters to calculate the load of nodes L and the performance C according to the service type. (3) Join the node S i which meets the following conditions to the candidate nodes set N for distribution. L(S m ) = min L(S i ) i = 0, 1,, n 1 (6) L(S i ) < L(S m ) + ε i = 0, 1,, n 1 (7) (4) Calculate the distribution probabilities P (S k ) of those nodes in the candidate nodes set N. n 1 P (S k ) = C(S k ) / C(S i ) k = 0, 1,, n 1, S i N, S k N (8) i=0 (5) According to the distribution probabilities of nodes in set N, assign the request to one appropriate node through random probability distribution and adjust the load of the node according to Eq. (5). 4 Performance Analysis of Our Algorithm We use the OPNET modeler to verify the load balancing effect of our algorithm. The OPNET modeler provides three layers: a process layer, a node layer and a network layer. We model our system throughout the three layers. OPNET adopts discrete events mechanism in the simulations, which enable users analyze the behavior of a complex network accurately, and it is also convenient for data acquisition and statistics [8]. In order to verify the load balancing effect of our algorithm to a cluster system offering various services, we use three servers with different performance as the cluster system to provide the FTP and HTTP service at the same time for testing. The performance ratio of the three servers is 1 : 1.5 : 1.9. The clients consist of 130 nodes sending requests to the load balancer at the same time, 100 nodes sending HTTP requests and the other 30 nodes sending FTP requests. With OPNET modeler, we establish four scenarios to verify our algorithm. Scenario one sets different parameters for different services, the parameter of FTP service is k = (0.7, 0.1, 0.1, 0.1) and the parameter of HTTP service is k = (0.3, 0.2, 0.2, 0.3). Other scenarios do not distinguish the services, i.e., using the same parameters for all services. In scenario two, the parameters of FTP and HTTP services are k = (0.7, 0.1, 0.1, 0.1). In scenario there, the parameters are k =(0.3, 0.2, 0.2, 0.3), and in scenario four, the parameters are k = (0.5, 0.1, 0.1, 0.2). The simulation time is 60 minutes and the results are shown in Fig. 1 to Fig. 4. As shown in these figures, scenarios two to four cannot assign the requests well according to the performance of servers. As a result, the two nodes with lower performance presents roughly equal load, and the load distributed to them is not inconsistent with their performance. For scenario one, our algorithm calculates the load according to the service type and chooses the right node for distribution, which enables that the nodes get consistent load with its performance. All resources of servers can be fully applied and the expected goal is achieved. The final purpose of load balancing algorithms is to make full use of the load and performance of nodes and assign the task to them, thus making sure that each node gets proportional load with its
3310 Y. Zhang et al. / Journal of Information & Computational Science 10:11 (2013) 3305 3312 900 time_average (in Ethernet.Load (packets/sec)) 1100 time_average (in Ethernet.Load (packets/sec)) 800 700 600 Object: S1 of office network Object: S2 of office network Object: S3 of office network 1000 900 800 700 Object: S1 of office network Object: S2 of office network Object: S3 of office network 500 400 600 500 400 300 0 10 20 30 40 50 60 min 300 0 10 20 30 40 50 60 min Fig. 1: The load result of scenario one Fig. 2: The load result of scenario two 900 time_average (in Ethernet.Load (packets/sec)) 1100 time_average (in Ethernet.Load (packets/sec)) 800 700 600 Object: S1 of office network Object: S2 of office network Object: S3 of office network 1000 900 800 700 Object: S1 of office network Object: S2 of office network Object: S3 of office network 500 400 600 500 400 300 0 10 20 30 40 50 60 min 300 0 10 20 30 40 50 60 min Fig. 3: The load result of scenario three Fig. 4: The load result of scenario four performance [9, 10]. As a result, we use Pearson correlation coefficient to contrast the experiment effect. Pearson correlation coefficient (PE) allows the identification of linear correlations between sequences [11]. It is calculated by Eq. (9), where X and Y are the means of X and Y. r = (X X)(Y Y ) (X X) 2 (Y Y ) 2 (9) The nodes average load and the Pearson correlation coefficient with their performance are shown in Table 1. As shown in the table, if we calculate the load with the same parameters for different services, the scenarios two to four can distribute the task according to the nodes performance in a certain extent, but the correlation coefficients between the nodes performance and distributed load are a little bit high, the values are 0.899102, 0.895745 and 0.862260 respectively. Our algorithm differentiates the service types to control the task allocation; therefore it distributes the load
Y. Zhang et al. / Journal of Information & Computational Science 10:11 (2013) 3305 3312 3311 more uniformly and reasonably. The correlation coefficient between the performance of nodes and distributed load is high enough, and the value is 0.998308. The load balancing effect has been improved obviously. Table 1: The nodes average load and the Pearson correlation coefficient of the four scenarios Scenario Server 1 Server 2 Server 3 PE one 498.81 661.61 821.13 0.998308 two 498.90 560.97 926.99 0.899102 three 486.95 543.50 898.90 0.895745 four 566.32 580.73 793.78 0.862260 5 Conclusion Load balancing algorithms are the core of a load balancing cluster, and excellent algorithms can make full use of the resources of the cluster and fulfill the advantage of the cluster to provide high quality of services for users. By analyzing the characteristics of dynamic load balancing algorithms, we proposed a load balancing algorithm based on services with dynamic feedback. The main features of our algorithm are as follows: by choosing the corresponding parameters for different services to calculate the load and guide the allocation of the new task, our algorithm succeeds in making full use of the cluster resources and guarantees the stability of our system through load correction and avoids the situation that the system will tilt in long time operation. Experiments show that our algorithm can improve the load balancing effect preferably and enhance the availability and stability of the load balancing cluster. References [1] Wei Chen, Yufang Zhang, Zhongyang Xiong, Research and realization of the load balancing algorithm for heterogeneous cluster with dynamic feedback, Journal of Chongqing University, 33 (2010), 73-78 [2] V. Cardellini, E. Casalicchio, M. Colajanni, S. Tucci, Mechanisms for quality of service in web clusters, Computer Networks, 37 (2001), 761-771 [3] S. Dhakal, M. Hayatm, J. E. Peaooa et al., Dynamic load balancing in distributed systems in the presence of delays: A regeneration theory approach, IEEE Trans. on Parallel and Distributed Systems, 18 (2007), 485-497 [4] Haakon Bryhni, A comparison of load balancing techniques for scalable web servers, IEEE Network, July/August 2000 [5] Jian Liu, Lei Xu, Weiming Zhang, A load balancing algorithm based on dynamic feedback, Computer Engineering and Science, 25 (2003), 65-68 [6] Qi Zheng, Gguangping Zhou, Content classification load balancing algorithm in cluster, Computer Systems and Applications, 20 (2011), 47-50 [7] Hongbin Wang, Zhiyi Fang, Guannan Qu, Xiaodan Ren, An innovate dynamic load balancing algorithm based on task classification, International Journal of Advancements in Computing Technology, 4 (2012), 244-254
3312 Y. Zhang et al. / Journal of Information & Computational Science 10:11 (2013) 3305 3312 [8] Jinglei Cao, Jianguo Zhou, Leihua Qin, Simulation of network pressure based on OPNET, Computer Engineering, 35 (2009), 115-117 [9] Milan E. Soklic, Simulation of load balancing algorithms: A comparative study, ACM SIGCSE Bulletin, December 2002 [10] E. Altman, U. Ayesta, B. J. Prabhu, Load balancing in processor sharing systems, Telecommun. Syst., 47 (2011), 35-48 [11] Pablo A. Jaskowiak, Ricardo J. G. B. Camepello, Ivan G. Costa, Evaluating correlation coefficients for clustering gene expression profiles of cancer, Lecture Notes in Computer Science, 2012, 120-131