Evaluating And Experimental Analysis Of Load Balancer And Self .

Transcription

2018 3rd International Electrical Engineering Conference (IEEC 2018)Feb, 2018 at IEP Centre, Karachi, PakistanEVALUATING AND EXPERIMENTAL ANALYSIS OF LOAD BALANCER ANDSELF ORGANIZED WEBSERVERS USING HA-PROXYMuhammad Shakeeb1 and Bilal Muhammad Khan2*1 Department of Electrical Engineering, National University of Sciences and Technology, PNECKarachi, Pakistan (muhammad.shakeeb2015@pnec.nust.edu.pk)2 Department of Electrical Engineering, National University of Sciences and Technology, PNEC Karachi,Pakistan (bmkhan@pnec.nust.edu.pk) * Corresponding authorABSTRACT: Self-organize and load balancing of computing system is one of the emerging research area.Despite of having robust infrastructure; several organizations still face system downtime due to hardwarefailure, high load, memory exhaustion and network choking. The best way to avoid downtime is to have theability to predict and analyze the behavior of link and infrastructure. This paper presents an experimentalimplementation and evaluation of load balancing using HA-Proxy as a software-based load balancer and aproactive approach for self-organizing of network systems using certain algorithms in case of system failure.We are using Network function virtualization using XenServer that provides the ability to take network andtraffic management. However, making sure that achieving such centralized system is not a trivial task [15] as itraises various issues relating to network control, system management, data security, package requirements,routing and data migration.Keywords - Self Organizing, HA-Proxy, Load Balancing, Network function Virtualization and XenServer.I. INTRODUCTIONand reports it to monitoring system with theseprobe results in real time in order to fully maintainquality of service and system production [4]. Thereason of introducing virtualization in system andnetworks has attracted the attention of bothindustries and academic bodies. Several workshave been done on System and NetworkVirtualization [10].To support service availability a load balancer isneeded which requires two or more servers. A loadbalancer receives traffic from external sources anddistributes these requests to multiple defined loadbalancer servers. This load balancing of web trafficcan be implemented with special hardware,dedicated software’s or some time uses acombination of both software and hardware [8].Our design consists of two virtual webservers andon top of it a load balancer.The ability to run such infrastructure elements asvirtual machines or software appliances has beenaround for a long time. Virtual Machine Monitor(VMM) software supports to view, monitor andmanage multiple virtual machines with a singlehost. Typical virtual machine monitor includesUser Mode line / ESX Server, VMware Server andXen Virtual Server [2]. Virtual Machine may act asa logical server and can be hosted in physicalmachines which have complete isolation from themain server as it runs its own instances. Eachvirtual machine act as a real machine having itsown tools, software’s, users and networkconfiguration. This paper uses a Xen Server anopen source tool used to host Linux OS [14].Network performance, measurement and quality ofa service can be achieved by the hardware probesof the system. However special configuration ofnetwork monitoring system is needed which run onall gateway services on single physical machine.Usually hardware probe work around system clockIn any communication environment availability ofthe network is highly required. This performancefactor of network availability can be determined byanalyzing the connectivity of end-to-end processflow. In order to test the network connectivity ARPand ICMP packets are sent to test and diagnose thenetwork connectivity [3]. The aim of the proposedalgorithm is to gather information from multiplesources using network utilities and later on usingalgorithm including from the point of incident andmake effective decisions including shifting of thenetwork traffic from one VM to other VM in caseof any disaster or system degradation. Moreover,the proposed algorithm provides a unique solutionand work on all such physical machine [12].The paper is organized as; Section3 presentssystem design. Section4 describes load balancingusing HA-Proxy, Section5 describes syncing ofdata before service degradation using designedalgorithm. Section6 practical implementation ofload balancer and its results. Section7 concludesthe paper.1

2018 3rd International Electrical Engineering Conference (IEEC 2018)Feb, 2018 at IEP Centre, Karachi, PakistanFig. 1 XEN ArchitectureII. System DesignB. Xen Remote ManagementXen App is installed on any supported operatingsystem. It enables secure, remote access of XenHosted server. Through Citrix Xen app a remotemanagement tool is used to install the virtualmachine in Xen Hosted Server [2].Server configuration may vary according to thehosting of virtual machine. In this paper threevirtual machines are used which are hosted onsingle physical machine that can be managed byCitrix Xen management and monitoring tool.VMMs includes VMware server/ESX server [17],User Mode Line [16] and Citrix Xen Server [5, 14].VMware provides virtualization for both Linux andwindows based architecture. VMware is a wellknown commercial product used in productionenvironment. Para virtualization present a modifiedinterface having a new architecture for the interfaceof guest OS. Xen is a para virtualized virtualmachine monitor that supports Berkeley SoftwareDistribution (BSD) and a Linux based OS. UMLalso supports virtualization but have low speed thanXen VMM; therefore, in this paper XenServer isused which is configured on Physical Machine andto monitor it we will use Xen virtual machinemonitoring app.C. Xen Virtual NetworkXen enabled kernel creates virtual network, virtualinterfaces like network interface cards for VMs andthese Virtual network interfaces are bridge to realinterface using Linux system utilities. Virtualmachine has its own identity usually defined by theuser which allows access from gateway machine[2] to access it remotely. We can setup a public IPas well to directly access it remotely. Figure 2presents the internal architecture of Xen serverhosted physical machine with its networkinterfaces.A. Xen ServerTo implement network virtualization at least twoseparate physical machines required one havingXen Server installed, and the other to run the Xenmonitoring tool i.e. Xen App. This paper uses asystem with multiple core enabled with 64bitserver-class machine to allow virtualization [13][14]. Xen machine has xen-enabled kernel with anoptimized Linux partition which is responsible tocontrols the interaction and its communicationbetween virtual devices nd the physical hardware[6]. Figure 1 shows XEN architecture.Fig. 2 Physical MachineTable.1 shows system requirement to configuredvirtual machine. These may be varying as per thehardware size and system traffic requirement. Inthis paper three VMs are used two of these VMshas 1 network interface and the main load balancerhave 2 network interface cards. Ubuntu asoperating system is used for all the virtualmachines.Table.1 Virtual Machine Configuration Table.Virtual MachineHOST-2HA-ProxySystem Req. HOST-12Proces s or2700 MHz2700 MHz2700 MHzRAM512 MB512 MB1024MBNIC112Dis k6 GB6 GB10GB

2018 3rd International Electrical Engineering Conference (IEEC 2018)Feb, 2018 at IEP Centre, Karachi, PakistanIII. Load Balancing Using HA-ProxyC. Least connectionsLeast connections algorithm stored a record of allthe active server and its connections and isresponsible to forward new connection request tothe server which has less active connections. [9]Load balancing services are offered by many of thecloud hosting providers and its demand increasesso rapidly [19] [20] due to high internet usage.Social media popular websites like Facebook,twitter etc. have a huge number of clients whichneed to be served real time which causes high loadon server due to server limitations response timeincreases so instantly some time causes serverdowntime. To maintain a tolerable service upresponse, several servers must be provided toprevent bottlenecks and allowed to forward theclient requests to the backend servers to handlethem [22]. User requests are dispatched using loadbalancing policies defined in load balancer to endservers. Load balancer using HA-Proxy uses anumber of algorithms whose aim is to minimize theimbalance between different servers and distributethe load among in an optimal way.Load balancer supports weighted and non-weightedalgorithms: first alive, hash, round robin, leastconnections. Weighted least connection andweighted round robin are different policies used.Weighted algorithm checks a server with higherweights and sent the request to that server who hasa higher weight. It checks the preference anddetermine to which server receives next request.The percentage of traffic divided to each server isapproximately equal to its weight which is dividedby the cumulative weight of all servers in thepresented member group. Similarly A nonweighted algorithm assumes that the capacity of allservers in the group to be equivalent. Althoughnon-weighted algorithms are typically faster thanweighted algorithms.D. Weighted least connectionsWeighted least connections algorithm generates aweighted list and maintains a list of applicationservers with active number of connections. Theservice forwards a new connection to a server onthe basis of its weight or number of activeconnections. It uses more computation times soincreasing response time therefore known as slowalgorithm.E. Weighted round robinWeighted round robin algorithm originates aweighted list. On the basis of connectionproportion to the weight it forwards newconnections to high weighted server. The algorithmuses additional computation time but have theability to distribute the traffic more efficiently tothe server that is most capable of handling therequest.F. Round robinRound robin algorithm uses a list of servers definedin HA-Proxy configuration and forwards a newclient connection request to the next server inmembers list [9].Among commonly available load balancingpolices, round robin is the most common onesupported by major cloud providers [21]. In thispaper two apache webservers are installed over VMhaving IP address 192.168.1.5 (host-1) and192.168.1.6 (host-2) both contains same data in itsweb root directory with same server configuration.Another VM with HA-proxy is used as the mainserver which handles all client request and forwardit to these webservers. HA-Proxy Server IP is set to192.168.1.7 which is public interface and all therequests are sent to this IP.A. First aliveThe first alive algorithm uses the concept of aprimary and secondary (backup) servers.The primary server is the first server in themembers list define in ha-proxy configurationsimilarly the secondary servers are any subsequentserver in the members list. This algorithm checksthe health state of primary server if it is up it willforward all the traffic to primary server and if thehealth state of the primary server is down, the datapower service forwards connections to the nextserver in the list.Round robin algorithm is used to test the loadbalancer. In this paper a test.php code file is createdwhich shows load balancer result containing webserver IP, Load Balancer IP ( HA proxy server )and X-Forwarded IP ( A system which request forthis page) .B. HashThe hash algorithm uses HTTP header and the IPaddress of the client as the basis for serverselection. This property is available for only theMulti-Protocol Gateway and Web Service Proxy.Hashing algorithms cannot ensure evenlydistributed connections. [9]3

2018 3rd International Electrical Engineering Conference (IEEC 2018)Feb, 2018 at IEP Centre, Karachi, PakistanIV. Self-Organizing of Data before ServiceDegradation.In this paper two webservers are created to caterclient request and if there is any server failure torespond client request than another subsequenthosts is required to handle the request. To predicthigh load we have developed a script which checkssystem load and on certain defined threshold needto enable (Failover webserver). To develop thisapproach we have build replica server with samecontent, system packages. We can achieve thisusing XenApp tool which helps to create acomplete snapshot of the VM. Snapshot takes sometime to build complete image of the webserver onlydepends on the server size. Now a day’s peoplecreate scripts to define program for all UNIXenvironment to break all complex projects intosimple smaller task also known as bash scripting(Bourne again Shell) in Linux environment. In thispaper an algorithm is developed using a shellscripting which uses a way to explore thecapabilities in Linux environment [11] using samealgorithm we have designed customized algorithmwhich checks all the updates from primary serverhost-1 and host-2. Sync the data to the backupserver automatically. In our designed algorithm ifthe website content is change or update than thisalgorithm won’t backup complete site but it takesincremental backup and ignore the old contentwhich is already in backup server which helps toreduce time in sync of data from main server.To examine system performance, load and memorytest we are using a Perl script and on the basis of itif there is high load another bash script runs whichsync the data. Syncing data is possible to anyremote host without human intervention whichgenerates exact copy of data to failover server andshifts the traffic if required using the designedalgorithm. All these scripts are placed inside mainHA-Proxy server which is responsible for loadbalancing test. In this paper, complete data backupsize is approx. 1.2MB which takes 1.1MB/sec totransfer data. Using our designed algorithm if theprimary webserver host-1 or host-2 gets down thanan auto update runs which edit main configurationfile of HA-Proxy and add new failover serverwhich out any human intervention and down time.Fig. 3 HA-Proxy ArchitectureTo analyze round robin algorithm curl is used witha test script which shows below result. Curl is atool to transfer data from or to a server which givesoutput as a command line.shakeeb@Shakeeb-Laptop: curlhttp://192.168.1.7/test.php Server IP: 192.168.1.5Load Balancer IP: 192.168.1.7X-Forwarded-for: 192.168.1.4shakeeb@Shakeeb-Laptop: curlhttp://192.168.1.7/test.php Server IP: 192.168.1.6Load Balancer IP: 192.168.1.7X-Forwarded-for: 192.168.1.4shakeeb@Shakeeb-Laptop: curlhttp://192.168.1.7/test.php Server IP: 192.168.1.5Load Balancer IP: eeb-Laptop: curlhttp://192.168.1.7/test.php Server IP: 192.168.1.6Load Balancer IP: 192.168.1.7X-Forwarded-for: 192.168.1.4Each client request has been verified by seeing thatround robin algorithm works without any data lossand request has been handled by each serverconsecutively. First request is catered by the host-1and second request by host-2 after that 3rd requestis surfed by host-1 again and fourth by host-2 andso on which clearly shows round robin technique.We are using only two webservers as a loadbalancer so only two IPs appears as a server IP.V. ExperimentalAnalysisofLoadBalancerBelow are few experiments presented whichmeasures performance analysis of using loadbalancer and using virtual machines having samesystem configuration with the help of apache benchtest.4

2018 3rd International Electrical Engineering Conference (IEEC 2018)Feb, 2018 at IEP Centre, Karachi, Pakistan1. Web stress test without using multiplewebservers (Host-1).2. Web stress test by increasing host-1 memory to1024MB.3. Web stress test over load balancer using two512MB webservers.Table.2 Response time without Load balancing512MB serverConcurrent TrafficSi ngl e us er10 us ers20 us ers40 us ersAll experiments have been performed to check theperformance on HA-Proxy server by increasingnumber of concurrent connection from 1user to100users and then analyze response time for eachrequest. These results based on number ofconnections, response time, connection rate, andtimeouts. We are using a demo webpage with a sizeof 1.2MB so that to analyze same page over allpresented scenarios.60 us ers80 us ers100 us ersResponse time 76.724486.241671.081718.572Figure4. Shows graphical representation whensingle 512MB webserver serves all client requestsand the response time shows in milliseconds. Byanalysis graphical result it shows as much as thenumber of concurrent request increases responsetime also increases while after increasing numberof test the load on the server also increases causeshigh load time which is much higher than loadbalancer and presented in our next scenario.A. First Scenario has been tested by switchingoff all the web server except (Host-1) here host-1has a memory of 512MB and to analyze itsbehavior a curl request is generated. Curl requestshows test script result where X-Forwarded isresponsible to take client request and forward it toServer. Here Server IP is static as we have enablesingle server so it shows server IP of host-1.shakeeb@Shakeeb-Laptop: curlhttp://192.168.1.7/test.php Server IP: 192.168.1.5Load Balancer IP: 192.168.1.7X-Forwarded-for: 192.168.1.4shakeeb@Shakeeb-Laptop: curlhttp://192.168.1.7/test.php Server IP: 192.168.1.5Load Balancer IP: 192.168.1.7X-Forwarded-for: 192.168.1.4shakeeb@Shakeeb-Laptop: curlhttp://192.168.1.7/test.php Server IP: 192.168.1.5Load Balancer IP: 192.168.1.7X-Forwarded-for: 192.168.1.4shakeeb@Shakeeb-Laptop: curlhttp://192.168.1.7/test.php Server IP: 192.168.1.5Load Balancer IP: 192.168.1.7X-Forwarded-for: 192.168.1.4shakeeb@Shakeeb-Laptop: curlhttp://192.168.1.7/test.php Server IP: 192.168.1.5Load Balancer IP: 192.168.1.7X-Forwarded-for: 192.168.1.4Fig. 4 Response time without Load Balancing Server with512MBB. Second experiment has been performed over1024MB webserver which is equivalent memory oftwo webservers used in third scenario. In thisexperiment single VM has been created with samedata and memory is set to 1024MB. To analyze thebehavior using load balancer a curl request isgenerated which shows single server on loadbalancer is activated.shakeeb@Shakeeb-Laptop: curlhttp://192.168.1.7/test.php Server IP: 192.168.1.5Load Balancer IP: 192.168.1.7X-Forwarded-for: 192.168.1.4shakeeb@Shakeeb-Laptop: curlhttp://192.168.1.7/test.php Server IP: 192.168.1.5Load Balancer IP: 192.168.1.7X-Forwarded-for: 192.168.1.4shakeeb@Shakeeb-Laptop: curlhttp://192.168.1.7/test.php Server IP: 192.168.1.5Load Balancer IP: 192.168.1.7X-Forwarded-for: 192.168.1.4By generating curl request we analyze that singlewebserver is active. Table.2 shows web stress testof 1st, 10th, 50th, 51st, 99th and 100th number ofrequest. After generating web stress test resultsshows that response time increases so instantly onincreasing number of concurrent request. Initialrequest response time is approx. same but if wecheck the result of 100 concurrent users it reachesfrom 206.4ms to 718.572ms after 100 th requestwhich is 3.5 times greater than its first request.5

2018 3rd International Electrical Engineering Conference (IEEC 2018)Feb, 2018 at IEP Centre, Karachi, PakistanBy analyzing above it only shows single server isactivated. After generating apache stress test overload balancer server with single activated 1024MBmemory Virtual machine. Table.3 shows responsetime of 1st, 10th, 50th, 51st, 99th and 100th request.Here Initial request response time is far better ascompare to previous scenarios but if we check theresult for 100 concurrent request it reaches from195.412ms to 666.255ms which is 3.5 times of itsfirst request this ratio is approximately equal to the512MB webserver. Only the response time is less ascompare to previous scenario.HA-Proxy server to cater the request and forward itto next defined server in HA-proxy configuration.After 100 concurrent connection first request takes241.282ms and reaches to 481.57ms which isapprox. 2 times of initial request.Below Table.4, shows the result of 1st, 10th, 50th,51st, 99th and 100th test with defined number ofconcurrent users using load balancer. As perexperimental analysis if the number of specificrequest increases the response time to surf singlerequest also increases but have far better responsetime as compare to all previous scenarios.Table.3 Response time without Load balancing1024MB serverConcurrent TrafficTable.4 Response time with Load Balancing ServerConcurrent TrafficResponse time (ms)Response time (ms)4.0754.1736.1496.1789.48910.354Single user4.9215.336.93210 users12.35612.78761.11661.159106.44110.57210 users21.00724.3539.713 39.916 65.68620 users68.45968.728114.331116.619181.13193.71320 users31.95452.461 90.535 90.753 148.195 148.3740 users97.137107.622229.705232.305329.071358.61940 users97.309102.25 167.51 167.57 239.44239.4960 users124.46132.802318.959319.688453.023462.49560 users137.762 137.86 229.13 230.19 358.28359.4580 users168.386170.413391.529395.226570.056570.49180 users172.273 172.32 262.18 262.19 424.62439.24666.255100 users214.282 214.38 351.55 353.76 475.97481.57Single user100 11.11678.748Below graphical representation shows all hundredrequests response time. In Figure 5 we clearlyanalyses the response time using 1024MB ofwebserver is less as compare to 512MB webserver.After 100th request in previous scenario the responsetime is higher than 700ms and as per the belowgraphical representation if we increases systemmemory its response time is far better.For all apache bench test over HA-Proxy loadbalancer server presented in Figure 6. Shows thatafter 100 concurrent request response time is lesserthan 500ms which is previously greater than700ms. From all presented experiments responsetime using load balancer server is far better ascompare to using single webserver with samesystem configuration.Figure5. Response time without Load Balancing Serverwith 1024MBFigure6. Response time with Load Balancing ServerVI. CONCLUSION:C. Third experiment has been performed on two512MB webserver which is used as a load balanceralso presented in Figure.3 .Minimum request timefor single user is approximate same as previousscenarios but as soon as the number of concurrentrequest increases its response time is far better thanprevious scenarios. When a first requests generatedwhich shows a response time little high with theprevious one as some response time utilizes by theThis paper presents an experimental analysis toinvestigate best possible method to introduce selforganizing within the network without incurringadditional complexity and better response timeusing a described algorithm. This paper presentsthe difference between load balancer using HAproxy webserver or virtual webserver. Using round6

2018 3rd International Electrical Engineering Conference (IEEC 2018)Feb, 2018 at IEP Centre, Karachi, Pakistanrobin as load balancer algorithm performs the bestin handling high traffic and with efficientimplementation of shell script in order to organizeservers is fast as compare to another load balanceralgorithms. Our designed algorithm script helps toorganize webserver and add another host on loadbalancer server configuration. Implementation ofsuch centralized physical machine reduceshardware cost, human intervention, powerconsumptions and space per site. Designedalgorithm helps in improving the traffic flow andsmooth evacuation during shifting and switching oftraffic from one host to another. As per our analysisround robin handle the request efficiently as thefirst client request is surf by the 1st host anotherclient request is surf by 2nd host causes less load onthe server which helps in fast response time tohandle all client requests. It can also be concludedfrom the experiments that software switching ismore reliable and efficient as compare to hardwareswitching in real time. This virtualization schemeimproves the utilization of hardware which reducesthe cost and its maintenance.[8] Round-trip time (RTT) [URL] April definition/round-trip-time.[9] Load balancing technique and ter/en/SS9H2Y 7.5.0/com.ibm.dp.doc/lbg algorithms.html[10] J. Lee, J. Tourrilhes, P. Sharma, and S.Banerjee, “No more middlebox: integrateprocessing into network,” SIGCOMM Comput.Commun. Rev., vol. 41, no. 4, pp. –, Aug. .cfm?id 2043164.1851262[11] Advanced Bash-Scripting Guide [URL] tiontechnology/[14] CITRIX [URL] 1999-2016 Citrix 15] Bilal Zafar ;Soheyl Gherekhloo ; AidinAsgharzadeh ; Mehdi Tavakoli Garrosi ; MartinHaardt “Self-Organizing Network with IntelligentRelaying (SONIR)“ The 7th IEEE InternationalConference on Mobile Ad-hoc and Sensor Systems(IEEE MASS 2010)[16] Unified Modeling Language [URL] Nov. 2007[Online]. formal/uml.htm[17] VMware Virtualization Technology [URL]Nov. 2007 [Online]. Available:http://www.vmware.com[18] Bash Script Algorithm [URL] 2016 , Available: nitor-network.[19] M. A. Adnan, R. Sugihara, and R. K. Gupta,“Energy efficient geographical load balancing viadynamic deferral of workload,” in Proc. of IEEECloud. 188-195, 2012.[20] H. Goudarzi and M. Pedram, “Geographicalload balancing for online service applications indistributed datacenters,” in Proc. of IEEE Cloud.351-358, 2013.[21] K. Boloor, R. Chirkova, T. Salo, and Y.Viniotis, “Heuristic-based request schedulingsubject to a percentile response time sla in adistributed cloud,” in Proc. of IEEE GLOBECOM.1–6, 2010.[22] Agung B. Prasetijo, Eko D. Widianto andErsya T. Hidayatullah “Performance Comparisonsof Web Server Load Balancing Algorithms onHAProxy and Heartbeat” in Proc. of 2016 3rd(ICITACEE), Oct 19-21st, 2016.REFERENCES[1] Lizhe Wang, Gregor von Laszewski, Jie Tao,and Marcel Kunze, “Grid Virtualization Engine:Design, Implementation, and Evaluation IEEEsystems journal, vol. 3, no. 4, December 2009[2] Stephen Childs, Brian Coughlan, DavidO’Callaghan, Geoff Quigley, John Walsh, “Asingle-computer Grid gateway using virtualmachines,” 19th International Conference onAdvancedInformationNetworkingandApplications, 2005 IEEE.[3] Zongjian He, Guanqing Liang, “Research andEvaluation of Network Virtualization in CloudComputing Environment,”[4] Xiaoliang Li, Feng Liu, Zhenming Lei and KunZhang, self-organizing load balancing for networkmeasurement server cluster,” work is supported byNational Natural Science Foundation of China.2011 IEEE[5] Jiaxin Wang , Lianhe Yang ; Miao Yu ; Wang“Application of Server Virtualization TechnologyBased on Citrix XenServer in the InformationCenter of the Public Security Bureau and FireService Department.’ IEEE July tation/[7] M. Tatezono, N. Maruyama, and S. Matsuoka,“Making wide-area, multisite MPI feasible usingXen VM,” in Proc. Workshop on XEN in HPCCluster and Grid Computing Environments(XHPC), LNCS, 2006,vol. 4331, pp. 387–396.7

Keywords-Self Organizing, HA-Proxy, Load Balancing, Network function Virtualization and XenServer. I. INTRODUCTION To support service availability a load balancer is needed which requires two or more servers. A load balancer receives traffic from external sources and distributes these requests to multiple defined load balancer servers.