Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Impact of Vertical Scaling on Containerized Applications: A Study on Docker and Kubernetes, Exercises of Telecommunications Engineering

The effect of vertical scaling on the performance of containerized applications using Docker and Kubernetes. The study includes a literature review on related topics, such as ElasticDocker and container autoscaling systems. The research focuses on identifying the performance metrics most affected by vertical scaling and characterizing the negative impact. The document also proposes potential solutions for managing container resources and scaling in response to varying load demands.

What you will learn

  • What are the benefits of using containers instead of virtual machines?
  • What is the role of Kubernetes in managing and scaling containerized applications?
  • How can container autoscaling systems improve the performance of containerized applications?
  • How does ElasticDocker add or remove compute resources to Docker containers?
  • What are the performance metrics most affected by vertical scaling in containerized applications?

Typology: Exercises

2021/2022

Uploaded on 09/27/2022

shyrman
shyrman 🇺🇸

4.2

(6)

240 documents

1 / 53

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Master of Science in Telecommunication Systems
June 2019
Performance Analysis of the Impact of
Vertical Scaling on Application
Containerized with Docker
Kubernetes on Amazon Web Services EC2
Dhananjay Midigudla
Faculty of Computing, Blekinge Institute of Technology, 371 79 Karlskrona, Sweden
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35

Partial preview of the text

Download Impact of Vertical Scaling on Containerized Applications: A Study on Docker and Kubernetes and more Exercises Telecommunications Engineering in PDF only on Docsity!

Master of Science in Telecommunication Systems June 2019

Performance Analysis of the Impact of

Vertical Scaling on Application

Containerized with Docker

Kubernetes on Amazon Web Services EC

Dhananjay Midigudla

Faculty of Computing, Blekinge Institute of Technology, 371 79 Karlskrona, Sweden

This thesis is submitted to the Faculty of Computing at Blekinge Institute of Technology in partial fulfilment of the requirements for the degree of Master of Science in Telecommunication Systems. The thesis is equivalent to 20 weeks of full time studies.

The authors declare that they are the sole authors of this thesis and that they have not used any sources other than those listed in the bibliography and identified as references. They further declare that they have not submitted this thesis at any other institution to obtain a degree.

Contact Information: Author(s): Dhananjay Midigudla E-mail: dhmi@student.bth.se

University advisor: Emiliano Casalicchio Department of Department of Computer Science and Engineering

Faculty of Computing Internet : www.bth.se Blekinge Institute of Technology Phone : +46 455 38 50 00 SE–371 79 Karlskrona, Sweden Fax : +46 455 38 50 57

Acknowledgments

I would like to express my sincere gratitude to Prof. Emiliano Casalicchio for his valuable inputs and support throughout the thesis. I would like to thank professor Patrik Arlos, whose curriculum gave me a unique educational perspective.

I would like to thank my parents for their unconditional love and support.

ii

Nomenclature

AWS Amazon Web Service

CPU Central Processing Unit

EC2 Elastic Compute Cloud

HTTP Hyper Text Transfer Protocol

TCP Transmission Control Protocol

iii

  • 1 Introduction Acknowledgments ii
    • 1.1 Motivation
    • 1.2 Aim and Objectives
      • 1.2.1 Research Questions
  • 2 Background
    • 2.1 Containers
    • 2.2 Docker Containers
    • 2.3 Kubernetes
      • 2.3.1 Nodes
      • 2.3.2 Pod
      • 2.3.3 Deployment
      • 2.3.4 Namespace
      • 2.3.5 Service
    • 2.4 Vertical Scaling
    • 2.5 Amazon Web Services and its components
      • 2.5.1 EC2
      • 2.5.2 Virtual Private Cloud
      • 2.5.3 S3
    • 2.6 Apache Jmeter
  • 3 Related Work
  • 4 Method
    • 4.1 Overview
    • 4.2 Hosting the containerized application on kubernetes
    • 4.3 Resource allocation to the containers running on kubernetes
    • 4.4 Vertical Scaling Method
      • 4.4.1 Updating a Deployment
    • 4.5 Environment Setup
    • 4.6 Experimentation Methodology
      • 4.6.1 Scenario 1: Single Replica
      • 4.6.2 Scenario 2: Two replicas
  • 5 Results and Analysis
    • 5.1 Scenario 1: One replica
      • 5.1.1 Test case:
      • 5.1.2 Test case:
    • 5.2 Scenario 2: Two replicas
      • 5.2.1 Test case:
      • 5.2.2 Test case:
    • 5.3 Summary
  • 6 Conclusions and Future Work
    • 6.1 Research Questions and Answers
  • References
  • 2.1 Containers vs Virtual Machine [1] List of Figures
  • 2.2 Kubernetes Architecture [2]
  • 2.3 Kubernetes Node [3]
  • 2.4 EC2 architecture [4]
  • 2.5 Virtual Private Cloud - Default [5]
  • 2.6 Virtual Private Cloud - Custom [5]
  • 4.1 Creating a kubernetes namespace
  • 4.2 A sample deployment file
  • 4.3 A kubernetes deployment from command line
  • 4.4 A sample kubernetes deployment description
  • 4.5 Network load balancer
  • 4.6 A sample kubernetes service configuration
  • 4.7 Creating the Kubernetes service
  • 4.8 load balancer creation in AWS gui
  • 4.9 A deployment configuration describing the compute resources
  • 4.10 Updating a kubernetes deployment
  • 4.11 Initial pod description
  • 4.12 Description of the newly generated pod
  • 4.13 ec2 instance terminal sample
  • 4.14 A kubernetes cluster description
  • 4.15 Environment for experimentation
  • 4.16 Vertical scaling specifications
  • 5.1 Active threads(users) over time
  • 5.2 Bytes throughput over time
  • 5.3 Connect times over time
  • 5.4 Latency over time
  • 5.5 Server hits per second
  • 5.6 Active threads(users) over time
  • 5.7 Bytes throughput over time
  • 5.8 Connect times over time
  • 5.9 Latency over time
  • 5.10 Server hits per second
  • 5.11 Active threads(users) over time
  • 5.12 Bytes throughput over time
  • 5.13 Connect times over time
  • 5.14 Latency over time
  • 5.15 Server hits per second
  • 5.16 Active threads(users) over time
  • 5.17 Bytes throughput over time
  • 5.18 Connect times over time
  • 5.19 Latency over time
  • 5.20 Server hits per second
  • 4.1 Description of ec2 instance List of Tables
  • 4.2 Vertical scaling specifications
  • 5.1 Data for the HTTP requests for test case
  • 5.2 Data for the HTTP requests for test case
  • 5.3 Data for the HTTP requests for test case
  • 5.4 Data for the HTTP requests for test case
  • 5.5 Error% of HTTP requests with and without vertical scaling

Chapter 1

Introduction

Infrastructure as a Service (IaaS)[6], is a cloud computing infrastructure, which pro- vides virtual machines to users on demand. Over the years, this platform has seen significant improvements in provisioning of customized virtual machines where users can choose the operating system and dependencies according to their needs. Small scale application could be managed efficiently on the virtual machines but it be- came more complex and difficult to manage large scale applications when there was dynamic load present.

Container technology is gaining popularity in cloud industry for research and commercial offerings. The ease in deploying, scaling and exposing an application to the internet are a few contributing factors to container’s widespread usage. Large scale applications are being deployed in a microservice architecture to distribute and isolate sub-processes in order to improve the overall performance. Hence, orchestrat- ing the containers and redefining their behaviour when required is very important when there are varying load demands for the hosted application.

Scalability[7] in cloud computing is a feature that defines the ability to increase or decrease compute resources or instances(virtual machines or containers), in order to meet workload demands and ensure that there is no degradation in the performance of the application. Scaling is popularly used in a microservice architecture, where different segments of the application are containerized and based on the workload demand, specific containers can be scaled to ensure consistent performance, high resource utilization.

Kubernetes[8], is one such popular container orchestrating tool, that is gaining popularity. In cloud computing terminology, kubernetes is viewed as platform as a service (PaaS). Kubernetes provides platform to manage containers and services and its popularity can be linked to its robustness in configuration and automation of containers and services.

Chapter 2

Background

This chapter provides a brief description of the technologies used in this thesis. Containers, Docker container, Kubernetes architecture, AWS EC2, Apache Jmeter are the technologies described.

2.1 Containers

A container refers to a virtualization technology, which is a package of the applica- tion’s code and its dependencies. A container can therefore be called as a unit of software that is flexible, independent and runs less overhead. The host operating system will share the same kernel with containers. The applications running inside the container are independent of the running environment. This ensures that the ap- plication’s performance is consistent regardless of the environment. Containers are operating system level virtualization and are similar to virtual machines. Containers support an entire operating system or a single application [1]. Containers have em- powered the usage of micro-service architectures by being light weight, providing fast start-up times because it does not emulate the physical hardware as a virtual ma- chine does. Containers develop applications based on monolithic and micro-services architectures. The core of containers relies on Linux namespaces and cgroups. One can run a single application within a container whose namespaces are isolated from other processes. Currently Docker containers are widely used containers.

Figure 2.1: Containers vs Virtual Machine [1]

Chapter 2. Background 4

2.2 Docker Containers

Docker [9]is an open source project which provides a platform for users to create con- tainers. In Docker, containers are initially images, which are automatically converted into containers at run-time. Standardization, security, compatibility across multiple platforms makes it quite popular for businesses and research purposes. Docker pro- vides two features to the user namely Docker client and Docker hub. Docker client allows users to download or create new images for the required applications. These images can be pushed to docker hub, and can be accessed anytime.

2.3 Kubernetes

Kubernetes [8]is an open-source platform designed to automate deploying, scaling, and operating application containers. With kubernetes, one can deploy applications quickly; scale and limit hardware usage to required resources only. It is portable, extensible and self-healing. In kubernetes, containers are isolated from each other and they have their own file systems. Their computational usage can be bounded. Kubernetes can schedule and run application containers on clusters of physical virtual machines. A kubernetes cluster consists of master and nodes. Master is responsible for managing the cluster. It coordinates all activities in the cluster. Node is a virtual machine or a computer that serves as a worker machine in a kubernetes cluster. A node should have tools for handling container operations.

Figure 2.2: Kubernetes Architecture [2]

2.3.1 Nodes

As mentioned above, a node [3]in kubernetes can be a virtual machine or a physical machine which contains all the necessary resources to run a pod. The nodes in kuber-

Chapter 2. Background 6

2.4 Vertical Scaling

Vertical scaling[14] is the addition or deletion of real computing resources such as CPU, memory to a container. Vertical scaling is done when the workload of a con- tainer increases, and it is applicable to any application. The extent of vertical scaling is limited to the hosting system’s capability. When multiple containers are running on a single machine, the resources (CPU and memory) are allocated by 2 schedulers namely: 1) Completely fair scheduler (CFS), 2) Real-time scheduler (RTS). A CFS equally distributes the CPU time to the containers where as an RTS provides specific limits to the Docker containers.

2.5 Amazon Web Services and its components

2.5.1 EC

Amazon Elastic Compute Cloud (EC2) [15] [8], is a web service provided by AWS, which provides users with a re-sizable compute capacity in the cloud i.e users can choose configurations of their virtual machines and deploy them quickly. It also has preconfigured templates called Amazon Machine Images (AMI), that packages the operating system and additional dependencies on the server.

Figure 2.4: EC2 architecture [4]

2.5.2 Virtual Private Cloud

A virtual private cloud (VPC) [5]provides users with a virtual network which can run resources like EC2 etc. The vpc can be modified by the user accordingly such as specifying the ip range, security rules etc. There are 2 types of available vpc’s namely:

Chapter 2. Background 7

  • Default : It is the default option provided by AWS which provides a private ip address to every instance launched inside it.

Figure 2.5: Virtual Private Cloud - Default [5]

  • Custom: When a custom vpc is created by a user, public ip addresses are assigned to the instances unless specified explicitly.

Figure 2.6: Virtual Private Cloud - Custom [5]

Chapter 3

Related Work

This section describes the related previous works that provided motivation for this research work. Peng Wang et al. [19] analyzed the performance of docker container on kubernetes platform. Docker architecture, cgroups, linux namespaces were studied and CPU, disk i/o performance metrics were analyzed. Yahya Al-Dhuraibi et al. [14] proposed ELASTICDOCKER, which adds or re- moves compute resources to docker containers based on the workload demands au- tonomously. The proposed model migrates docker container to another host if the workload demands more resources of the host than available and the migration tech- nique used is based on CRIU functionality in linux systems. End user QoE, resource utilization, migration time were the performance metrics that were considered. The performance of ELASTICDOCKER was measured under different workload scenar- ios and was compared with kubernetes auto-scaling feature and it was concluded that ELASTICDOCKER outperformed kubernetes autoscaling by 37 %. In [20], the authors designed an autoscaling system for web applications hosted on docker, that dynamically scales up or scales down the number of containers according to workload demand. A scaling algorithm was developed that spawns new containers and attaches them to the load balancer. An underlying predictive model in the algorithm ensures to scale down the number of containers only if it predicts less number of containers for k successive periods. Chuanqi Kan [21] designed DoCloud, an elastic cloud platform that dynamically scales up or scales down the number of containers according to the workload demand. Scaling down the number of containers was done keeping in mind that there might be an upsurge in demand just after scaling down. In [22], authors proposed a framework involving a custom container auto-scaler that scales in or scales out containers based on the resource utilization of the running containers. The auto-scaler performed better when the workload was repetitive, and performed very poorly when there was random workload. In [23], the authors classified autoscaling into predictive and reactive systems. Predictive systems employ machine learning, reinforcement learning to predict the future workload and allocate resources accordingly.

Chapter 4

Method

4.1 Overview

A systematic approach was employed in carrying out the research methodology for this thesis. It involved an extensive study to figure out a vertical scaling solution, implementation of the solution under different scenarios, data collection and analy- sis. Vertical scaling was done manually based on the workload demand. Literature study on containers, Docker containers, Kubernetes, elasticity of containers was done initially which provided insight on the architectures, tools and other technologies re- quired to perform the experiments. Since Kubernetes is orchestrating the docker container running our web service, an investigation on how to perform vertical scal- ing in kubernetes was done. In kubernetes, containers are generally deployed in pods. A deployment specifi- cation can be configured that inputs the desired characteristics and runs the pods accordingly. As mentioned in section 2.3.2, containers run inside pods and all the instructions and specifications to a pod are redirected to the containers inside it. Deployments allows users to manage more than one container, add shared volumes among them, and bind them together to host a service. Once the deployment is set up, a network load balancer is required so that our application is exposed to the internet as a service. A service can be defined in kubernetes linking our deployment to a newly created load balancer which makes it possible to access the service through the ingress of the load balancer. Load is generated progressively for a time period and this traffic is redirected to the pod by the load balancer gradually. Kubernetes architecture and its features were studied extensively to determine the methods that can be used to perform vertical scaling. One such feature that that was of interest was "Rolling update[24]" , which is a kubernetes feature that can be used to update an existing deployment. The rolling update feature uses a deployment controller [25] that manages updates to the existing deployments. Rolling update can be used to modify a deployment in many ways such as increasing or decreasing the number of container replicas, changing container images etc. But the main advantage that rolling update provides is that it does not break down the deployment if an invalid update (such as invalid container images, unavailable resources etc.) is requested by the user. The user can monitor the status of the deployment update requested and can take necessary actions if required. Rolling update also offers a roll back option, that brings the deployment back to the previous configuration and cancels the update. The thesis work therefore has been divided into the following steps: