Professional Documents
Culture Documents
High Availability Server Implementation Using NGINX, Keepalived, and Varnish To Ease Web Server Access
High Availability Server Implementation Using NGINX, Keepalived, and Varnish To Ease Web Server Access
net/publication/334451751
CITATIONS READS
0 289
1 author:
SEE PROFILE
All content following this page was uploaded by Ezra Adriadi Putranto on 14 July 2019.
Abstract— The research in this paper is conducted to create utilize a component that is able to monitor failure inside the
and test the performance of two High Availability Server which system and divert the job to another part of the system which
are used to increase data availability and reduce the load of is more capable to do it [2].
backend web servers. The performance is measured by the
response time of the server at failover and by logging the result C. Keepalived
of Secure Socket Layer Termination and website content Keepalived is a routing program which is running on
caching inside High Availability Server. Using the integration of background, capable of doing services monitoring and
Keepalived, NGINX, and Varnish, the High Availability Server automatic failover in case of failure inside the system [2].
is created and tested by sending request via Virtual IP. Based on
the performance measured from the test, it indicates that the D. NGINX
High Availability Server is able to reduce downtime and lighten Developed by Igor Sysoev in October 2004, NGINX is an
the load on the backend servers. open-source web server as an answer to the C10K problem to
handle 10.000 concurrent connection at the same time. As a
Keywords—Website; Availability; High Availability Server;
Downtime; Keepalived; NGINX; Varnish; Cache; Failover; SSL
web server, NGINX has many features, such as caching, load
Termination balancing, handling SSL traffic, reverse proxy, and many
more [3].
I. INTRODUCTION E. Varnish
Have you ever been in the situation, where you want to Varnish is an HTTP accelerator that can fasten access to
throw away your phone so badly because a tab in your browser websites. Varnish works in the server side, unlike Squid Proxy
keeps loading forever? It seems that your phone’s browser is which accelerate on the client side. Varnish are used by
trying hard to load a website from an unoptimized, or perhaps websites which have high traffic [4]. Compared to another
unavailable web server. You won’t be able to browse the web cache software, Varnish can work faster without
if there is no web server in the internet. Web server keeps communicating with database, able to server request when
expanding and increasing in number every year, and not every there are damage on the data source, and is able to handle
one of them are managed or maintained properly. This could 275.000 request per second. Varnish log also monitor traffic
lead into compromising the aspects that a website has, such as and request statistic [5].
its availability. Using High Availability servers as a bridge
between web servers and client could help websites stay F. SSL Termination
accessible despite the troubles on the backside, thus Terminating SSL traffic is one of configuration option to
minimalizing the downtime on the client. Through failover, balance encrypted traffic. Received SSL requests are
SSL termination, and Caching, High Availability server helps decrypted by load balancer server, and the decrypted requests
a website by switching between servers and taking over some are forwarded to the backend server. Load balancer server take
of the server’s work. High Availability server plays a over the intensive decryption process [6]. SSL Termination
significant role in website availability based on its can be applied on load balancer server if the network between
performance to reduce web server downtime. the load balancer server and backend server is guaranteed safe
[7].
II. LITERATURE REVIEW
A. Caching III. EXPERIMENTS
Making requests served faster can be achieved by doing In this paper, two high availability server will be used, and
data caching. By caching, data loaded from past requests are their performance will be tested to maintain the availability of
reused. To do this, those data are stored inside RAM and serve two backed web servers. High availability servers will be
them if there is a similar request. There are few kind of cache, installed with three main software: NGINX, Varnish, and
those are browser cache, database cache, object cache, and et Keepalived.
cetera [1]. Testing the performance of high availability server will be
B. High Availability done by collecting the data of the response time of the server
at failover, and by logging the result of cache and termination
A function inside system’s design which enable an of SSL traffic.
application to re-run or divert its job to another, more capable
system at failure is called high availability. This function
Fig. 1. Illustration on virtual machine roles and IP address After the configuration files are altered, restart the service
and see the service’s status to check whether Keepalived is
Both of the high availability server will be installed three running properly. If the configuration is correct, it should
software. The first is Keepalived which function is to prevent show master state for server 1 and backup state for server 2 as
failure if one of the server fails. The second is Varnish to store shown in the Fig. 3.
cache to lighten the load of backend web servers. The last is
NGINX to terminate SSL-encrypted traffic.
Fig. 4 and Fig. 5 indicates that there is change on the active From Fig. 8, the value of X-Forwarded-Proto is HTTPS,
high availability server after failing over the previously active meaning that the request is originated from secured traffic.
server. Also, the backend web servers remain reachable even The log also shows the log of the backend web server
if one of the high availability server has failed. destination port which value is 80, where port 80 is for HTTP
traffic (unsecured traffic). That indicates the SSL termination
C. Backend Server Failover Test is successfully done by the high availability server.
This test is done to determine whether failure at one of the
backend web servers will affect the availability on the content E. Caching Test
of the web server. To test the failover, first thing to do is to This test is done to test whether high availability servers
open the PHP script on the backend web server to identify the are able to store cache and use them to serve client’s requests.
backend web server that is currently active. The log generated Monitoring the log is possible via the value of the cache hit
by the script will be shown on the browser by opening the inside the Varnish stat. Open the stat using command
address 172.31.254.227/status.php. varnishstat and check the cache hit value. Once the value is
checked, try to make as many request as possible to the Virtual
After the active backend web server is identified via the IP IP from any browser. After the requests are made, check the
address on the log, shut that server down so it will become value of the cache hit again and compare with the previous
inactive and unable to process any request. Make a request value.
again by opening the PHP script from the browser and see the
log.
Fig. 7. Backend Server after failover The increased value of the cache hit from 9 to 31 shown
on Fig. 9 and Fig. 10 indicates that the requests are served
Fig. 6 and Fig. 7 indicates that there is change on the active using cache stored inside the high availability server without
backend web server after failing over the previously active making request to the backend web servers.
server. Also, the content of the web servers remain accessible
even if one of the backend web server has failed. F. Downtime Measurement at Failover
D. SSL Termination Test Downtime testing is done to determine whether failover
affects the availability percentage of the server. By monitoring
This test is done to determine whether the request from the virtual IP from PRTG, the response time of the server will
HTTPS traffic can be forwarded into the backend web server be recorded. The test is done by comparing the response time
via HTTP traffic with the help of SSL termination inside the of ping packets (ICMP) when the server is in idle state and
high availability server. The log generated by the PHP script when the failover is in process, repeated by five times to get
can show what protocol is used inside the request. more accurate result.
using integration of Keepalived, Varnish, and NGINX. The
50 performance is measured by the response time of the server at