You are on page 1of 5

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/315861457

Performance comparisons of web server load balancing algorithms on


HAProxy and Heartbeat

Conference Paper · January 2016


DOI: 10.1109/ICITACEE.2016.7892478

CITATIONS READS

5 758

3 authors, including:

Eko Didik Widianto


Universitas Diponegoro
84 PUBLICATIONS   67 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Information System Development View project

Embedded System View project

All content following this page was uploaded by Eko Didik Widianto on 05 October 2017.

The user has requested enhancement of the downloaded file.


Performance Comparisons of Web Server Load Balancing Algorithms on
Haproxy and Heartbeat

Agung B. Prasetijo, Eko D. Widianto and Ersya T. Hidayatullah


Department of Computer Engineering, Faculty of Engineering – Diponegoro University
Jl. Prof. Soedarto, SH, Tembalang, Semarang, Indonesia 50275
E-mail: agungprasetijo@ce.undip.ac.id; didik@live.undip.ac.id; ersya77@ce.undip.ac.id

Abstract – Popular websites such as Google as a balancer request proxy to deal with excessive
and Facebook must have an extremely large clients traffic requests. Arta [8] implemented a load
and providing such clients only with a single web balancing system using WRR (Weighted Round
server to serve such clients is absolutely Robin) algorithm. Jakupović [9] emulated the load
insufficient. To support service availability, two or balancing in a clustered environment using
more servers are required. This, however, needs a Virtualbox, GNS3, Haproxy and Hearbeat. Wang He
load balancing system. A load balancing server [10] explained the basic principle in using Heartbead
receives web traffic and distributes the requests to and DRBD to increase switching speed and stability.
such multiple servers. Load balancing can be Pribadi [11] implemented the Heartbeat on a VPN
implemented with a special hardware, software or a service to ensure the availability of VPN connection.
combination of both. The purpose of this research is This paper explored the performance
to develop a load balancing system with Haproxy as comparison between several algorithms on a
a software-based a load balancer and Heartbeat as combination of Haproxy and Heartbeat: Leastconn,
failover software. The results show that the average Round-Robin and Source algorithms, over unlimited
failover time when an active server down is 10ms. connections.
The Leastconn algorithm, in general, outperformed
the Round-Robin and Source algorithms in terms of II. SYSTEM DESIGN
connection rate, response time, throughput, and
failed connection. The environment for implementing 3 (three)
web servers as well as the load balancer Haproxy and
Keywords – Load Haproxy; Heartbeat; Leastconn Heartbeat can be seen in Table 1. The server is able to
Algorithm; Round-Robin Algorithm; Source replicate the database from the other servers and able
Algorithm to conduct synchronization with the other two
servers. The load balancing system may distribute
I. LITERATURE SURVEY traffic to the three servers.
Popular websites have a huge number of Table 1. Computer Specifications
clients to be served. To maintain a tolerable service
time, several servers must be provided behind a load Server
Component
balancer. Dite [1] compared the performance of two Load balancer Website
load balancer i.e., Haproxy and Pound Links to load Intel Pentium CPU Intel Pentium CPU
balance two web servers. Muhammad [2] employed Processor
G620 2.60 GHz E2200 2.20 GHz
Hearbeat on Ubuntu Linux and explained the design
Motherboard ECS H61H2-M12 HP FT917AA-AR6
of a failover system to overcome server failure to
maintain service availability. Mohammad [3] RAM 4 GB 4 GB
employed DBRD and Heartbeat in the FKIP UNS HDD 500 GB 320 GB
data center to minimize the risk of data loss and NIC 2 Fast Ethernet 1 Fast Ethernet
increase the serviceability of data. Kaushal [4]
explored the architectural design of virtual cloud
using Haproxy. The result showed the application Besides, one unit switch is used (Cisco Catalyst
server is able to recover the system only in several 2960) to interconnect computers, 1 laptop (Asus
milliseconds. Nanang [5] discussed the cluster system A43SD) functioned as client.
with failover capability using Heartbeat and tunneling The Haproxy and Heartbeat as well as the three
EOIP. The benefit of using tunneling is to make web servers are run on Ubuntu server 16.04 LTS x64.
possible the backup server located off-site. Nongki The database is backed by MySQL Server 5.7
[6] explained the testing of a cluster-based web load installed on the three Apache web servers. Unison is
distribution for both static and dynamic heavy HTTP employed to support file synchronization on web
requests. He compared the results of using the Least servers. It replicates files and directories at once and
Connection and Weighted Least Connection store to any different hosts or different hard drives.
algorithm. Noviyanto [7] implemented the Haproxy The Haproxy is used as a load balancer and mostly
used as a reverse proxy purposes, while the Heartbeat (1) webstress test without the use of a load balancer
is used for failover purposes to ensure a high web (affected by number of connection, connection rate,
service availability. A detailed physical topology of and timeouts).; and (2) webstress test employing the
this research can be seen in Figure 1 and the related load balancer with unlimited connections (Haproxy
logical topology can be seen in Figure 2. with Leastconn, Round-Robin, or Source algorithm).
Figure 3 shows the number of maximum
connections for scenario (1). Without a load balancer,
requests handled by every web server are different. In
this experiment only web server #1 handled least of
the requests in light traffic scenario.

Maximum connection reached


400

number of failed connections


350
300
250

(conn/s)
200
150
Fig. 1 Physical topology design
100
50
0

50
10
20
30
40

100
150
200
250
300
350
400
number of requests
(req/s)

web 1 web 2 web 3

Fig. 3 Maximum connection on every web server in


scenario (1)

For scenario (2), Figure 4 shows the


connection speed over number of requests. Here, the
requests are increased until the web server is unable
Fig. 2 Logical topology design
to service such requests (some request timeouts
occur).
The replication system in MySQL being
used is master – master: both the first and the second
servers acts as master and slave, hence there are two Connection rate
masters and two slaves. The replication scheme is 100
conducted in sequence from server #1 to server #2 to
number of connections

server #3 and back to server #1. A master – master 80


synchronization is also used. Unison uses a star
60
(conn/s)

topology, where 1 server acts as a hub and the rests


act as two spokes. 40
For failover design, the two load balancing
servers will be used as active – standby so when any 20
one of these two servers fails, the other server will 0
take over servicing the requests. The down-time in
50
10
20
30
40

100
150
200
250
300
350
400

this research is limited to only 10ms, either by the


disconnection of communication channel or by the number of requests
failure of any one of the load balance servers. (req/s)

III. RESULTS AND DISCUSSIONS roundrobin leastconn source


There are two scenarios to measure the
performance of the system with the help of Httperf:
Fig. 4 Connection speed of every algorithm in Figure 7 shows the failed connections in
scenario (2) scenario (2). The Source algorithm shows an extreme
number of failed connections compared to the other
It is shown that the connection rate of every two algorithms. In contrast, the Leastconn and
algorithm can be used. Maximum load of every Round-Robin algorithms show that both can manage
server is 65 connections per second regardless of the the connections better and the Leastconn algorithm
algorithm used. Whilst, the response time of the outperforms the others.
algorithms in scenario (2) is shown in Figure 5.

Failed connections

number of failed connections


Response time
500
4000 400
milliseconds

(conn/s)
3000 300
2000 200
100
1000
0
0

50
10
20
30
40

100
150
200
250
300
350
400
20

400
10

30
40
50
100
150
200
250
300
350

number of requests
number of requests (req/s)
(req/s)
roundrobin leastconn source
roundrobin leastconn source

Fig. 5 Response time of every algorithm in scenario Fig. 7 Failed connections of every algorithm in
(2) scenario (2)

The Source algorithm performs the worst IV.CONCLUSIONS


compared to the other two algorithms. The response
time goes to 0 when the requests exceed 150 per The load balancing system installed is
second. This indicates the algorithm is not able to working normally and is able to distribute load and
process the requests. Meanwhile, the Round-Robin conduct failover. The replication process on the three
algorithm performs the best in handling high traffic, nodes using one-way ring topology is successful. The
but for low to average traffic, the Leastconn service availability of this system is 10 milliseconds
algorithm shows the least response time. to handle active loads. The Leastconn algorithm, in
For throughput, the Leastconn algorithm general, is the algorithm that outperforms the other
outperforms the other two (see Figure 6). The Source two in terms of connection rate, response time,
algorithm shows unsatisfactory results as this throughput, and failed connections.
algorithm awaits the client connection finishes.
REFERENCES

Throughput [1] D. Ardhian, A. F. Rochim, and E. D.


Widianto, “Analisis perbandingan unjuk kerja
1000 sistem penyeimbang beban web server
800 dengan haproxy dan pound links,” J. Teknol.
dan Sist. Komput., vol. 1, no. 2, pp. 1–7,
600 2013.
KB/s

400
[2] M. T. Saenal, “Membangun High Availability
200 Cluster pada Web Server Dengan Sistem
Operasi Linux Ubuntu Server Menggunakan
0
Heartbeat,” Politeknik Telkom, 2012.
20

400
10

30
40
50
100
150
200
250
300
350

number of requests [3] M. F. S. Afif Tito, M. F. Afif, and T.


(req/s) Suryono, “Implementasi Disaster recovery
plan dengan Sistem Fail Over Menggunakan
DRBD dan Heartbeat pada Data Center FKIP
roundrobin leastconn source UNS,” Indones. J. Netw. Secur., vol. 2, no. 2,
pp. 64–69, 2013.
Fig. 6 Throughput of every algorithm in scenario (2)
[4] V. Kaushal and M. Bala, “Autonomic Fault
Tolerance Using HAProxy in Cloud
Environment,” Int. J. Adv. Eng. Sci. Technol.,
vol. 7, no. 2, pp. 222–227, 2010.
[5] N. Purnomo and M. Syafrizal, “Failover
Cluster Server Dan Tunneling EOIP untuk
Sistem Disaster Recovery,” in Seminar
Nasional Teknologi Informasi dan
Multimedia, 2013, vol. 5, pp. 27–32.
[6] N. Angsar, “Pengujian Distribusi Beban Web
dengan Algoritma Least Connection dan
Weighted Least Connection,” J. Nas. Tek.
Elektro dan Teknol. Inf., vol. 3, no. 1, pp. 24–
28, 2014.
[7] A. B. Noviyanto, E. Kumalasari, and A.
Hamzah, “Perancangan dan Implementasi
Load Balancing Reverse Proxy
Menggunakan HAProxy pada Aplikasi Web,”
vol. 3, no. 1, pp. 59–68, 2015.
[8] Y. Arta and A. M. Penelitian, “Implementasi
Computer Cluster Berbasis Open Source
untuk Penyeimbang Beban Sistem dan
Jaringan Komputer,” J. Tek. Inform. dan Sist.
Inf., vol. 2, no. 1, pp. 99–107, 2016.
[9] A. Jakupović, “Raspoređivanje Opterećenja I
Povećanje,” J. Polytech. Rijeka, vol. 1, no. 1,
pp. 179–195, 2013.
[10] H. Wang, X. Sun, Z. Zhang, C. Li, X. Wang,
I. Posov, and S. Pozdniakov, “Heartbeat and
Drbd the application in the large capacity
OLT,” Proc. 2013 Int. Conf. Adv. Ict Educ.,
vol. 33, no. Icaicte, pp. 490–494, 2013.
[11] P. T. Pribadi, “Jurnal Ilmu Komputer -
Volume 6 - No 1 – April 2013,” J. Ilmu
Komput., vol. 6, no. 1, pp. 25–34, 2013.

View publication stats

You might also like