Programming Algorithms of Load Balancing With HA-Proxy in HTTP Services
Programming Algorithms of Load Balancing With HA-Proxy in HTTP Services
100-105 100
José Teodoro Mejı́a Viteri1,* , Marı́a Isabel Gonzáles Valero1,† , and Ángel Rafael España León1,‡ .
1 Universidad Técnica de Babahoyo, Ecuador.
Resumen—El acceso a los servicios públicos y privados a través de la web gana protagonismo diario, y a veces debe soportar
cantidades de solicitudes que un equipo no puede procesar, por lo que existen soluciones que utilizan algoritmos que permiten para
distribuir la carga de las peticiones de una web aplicación en varios equipos; el objetivo de este trabajo es realizar un análisis de
algoritmos de programación a través de la herramienta HA-Proxy de balanceo de carga y entregar un instrumento que identifica
el algoritmo de distribución de carga a utilizar y la infraestructura tecnológica, para cubrir en gran parte puesta en práctica. La
información utilizada para este trabajo se basa en un análisis bibliográfico, estudio de campo y aplicación de los algoritmos en el
equipo, donde se analizará la distribución y el rendimiento de equilibrio de carga diferentes. La incorporación de esta tecnologı́a a
la gestión de servicios en la web, mproves la disponibilidad, continuidad del negocio ayuda a y a través de las diferentes formas de
distribución de las solicitudes de los algoritmos que pueden ser implementadas en HA-Proxy para proporcionarlos responsable de
sistemas informáticos con el fin de sus ventajas y desventajas.
Palabras Clave—Tecnologı́a de comunicaciones, La disponibilidad de información, Seguridad de datos.
proportional to the cost in technological infrastructure, it is for GET and POST methods
this reason that the research aims to implement and analyze The GET method asks for a specified resource representation.
the results of the techniques that allow to manage the load that For security, it should not be used by applications that cause
a web server receives. effects, since it transmits information through the URL, adding
And the following topics are considered successively: Web parameters to it. The POST method sends data to the server
Servers, protocol HTTP (Hypertext, Transfer; Protocol), High that can be part of a database, messages to a group of users,
availability, the different algorithms that exist and the tools for etc. Unlike the GET method, it can send any amount of data
their implementation and analyze the response time results in without limit and it does not send information as part of
the requests to the web server. the URL. The data is included in the body of the request
(Rı́os Pérez et al., 2017).
M ETHODOLOGY
Bibliographic and Documentary Analysis
Collection of information was carried out and are represented
in a unified systematic way to facilitate it compression, through
analysis and synthesis, through indexing, annotation.
R ESULTS
Implementation of Programming Algorithm
In the figure below, you can see the implementation in In the graphic below we can see in the backed webserver of
the backed web server section of the round robin as the the static round-robin scheduling as a programming algorithm
programming algorithm requests. in the requests and has a 50 % of load for each web server,
Processor Consumption and Round Robin Memory. because these are not with the same characteristics and can
configure with different loading in each server in percentage
number of load.
Static Round-Robin Processor and Memory Consumption.
In this picture, we see the amount of percentage using of Figure 11. Top Command in the Load Balancer.
the processor is 58.1 % and 2.2 & Memory. Source: Prepared by the authors.
Figure 9. Result of a Number of Petitions per server by an HA-Proxy Figure 13. HA-Proxy tool Number of requests per server.
Tool.
Source: Prepared by the authors.
Source: Prepared by the authors.
In the graphic below we can see that 10000 requests are
The following picture shows that 10000 requests are
distributed equally in both servers.
distributed equally in both servers.
Figure 10. Static Round Robin with Ha-Proxy Configuration. Figure 14. Least Connection Configuration with HA-Proxy.
Source: Prepared by the authors. Source: Prepared by the authors.
JOURNAL OF SCIENCE AND RESEARCH: REVISTA CIENCIA E INVESTIGACIÓN, E-ISSN: 2528-8083, VOL. 3, CITT2017, PP. 100-105 105
In the picture below, we see the backed webserver section round robin algorithm average time in seconds that can take
setting of the least connection memory as programming algo- a processed request is 33 seconds, the minimum is 3 seconds,
rithm in the requests. the amount of requests per second is 987,7 and the amount of
Least Connection processor and memory consumption. data is 371 kb per second. This shows that the Round Robin
programming algorithm requests with HA Proxy efficiency is
superior to the others evaluated, but it also must be pointed
that in the other two algorithms it is possible to regularize the
load, it means to put a higher percentage of requests trough
each one of the servers that can distribute the HA-Proxy load.
C ONCLUSIONS
Figure 15. Top Command in the Load Balancer.
Source: Prepared by the authors. The implementation of higher availability allows to business
to improve its services, using a higher availability architecture
Below, we can see the amount of percentage of processor design that depends on the networking hardware, because
using (54.5 %) and memory (1.3 %). the studied algorithms can realize variants to load balance in
percentages when the servers’ characteristics are different.
The evaluated efficiency of the programming algorithms in
the proposed infrastructure was favorable to Round-Robin, but
it is possible to indicate that in the implementation and tests,
servers with the same characteristics were used. However,
Figure 16. Results of Apache-JMeter with Least Connection Algo-
rithm Setting. the Static Round Robin algorithms, Least Connection, can be
Source: Prepared by the authors.
used when the infrastructure includes equipment with different
characteristics that allow to establish percentages of requests
As we can see in the table below, the average time taken by that can receive each server.
the request is 49 seconds, which take times to process 10000 This research work can be used as a methodology to
request to the server, the maximum time invested by a request evaluate the performance of high-availability programming
is 1726 seconds and the minimum is 3 seconds, the number algorithms, in different scenarios that may vary according to
of processed requests per second were 693.9 per second, the the case study, where the traffic analysis can perform with
amount of processed data are 260.88 Kb/s. different technology architecture.
B IBLIOGRAPHIC R EFERENCES
Bowen, R. and Coar, K. (2007). Apache Cookbook: Solutions
and Examples for Apache Administration. .O’Reilly Media,
Inc.”.
Cáceres Alvarez, L. M., Bernabé, P., and Alejandro, M. (2011).
Modelo de programación ası́ncrona para web transacciona-
Figure 17. HA-Proxy tool Number of requests per server.
les en un ambiente distribuido. Ingeniare. Revista chilena
Source: Prepared by the authors.
de ingenierı́a, 19(1):26–39.
de la Mora, S. (1997). Hablando HTTP.
10000 request are not equally distributed in both servers
Kurose, J. F. and Ross, K. W. (2009). Computer networking:
although they have the same characteristics, the server 1
a top-down approach, volume 4. Addison Wesley Boston,
received 5237 and server 2 received 4763 (see next graphic).
USA.
Márquez Dı́az, J., Sampedro, L., and Vargas, F. (2011). Insta-
D ISCUSSION
lación y configuración de apache, un servidor web. Revista
Table 2. Programming Algorithm Results Cientı́fica Ingenierı́a y Desarrollo, 12(12):10–23.
Rı́os Pérez, F. E., Polanco Carrillo, F., and Moreno Vega,
Rend. Cons. Cons.
Algorit. Med. Máx Mı́n Rend. V. (2017). Servidor web empotrado en un fpga para
Kb/s CPU mem.
Round-
33 262 3
987,7
371.33 58.1 % 2.2 %
configurar un controlador maestro del sistema inteligente de
Robin /sec tráfico cubano. Revista Cubana de Ciencias Informáticas,
Static
Round 169 1471 3
889,8
334.56 60.7 % 3.0 % 11(2):16–28.
/sec
Robin
Least
693.9
Connec 49 1726 3 260.88 54.5 % 1.3 %
/sec
tion
Source: Prepared by the authors.