Ant Colony Optimization-based Light Weight Container (ACO-LWC) Algorithm for Efficient Load Balancing

Container technology is the latest lightweight virtualization technology which is an alternate solution for virtual machines. Docker is the most popular container technology for creating and managing Linux containers. Containers appear to be the most suitable medium for use in dynamic development, packaging, shipping and many other information technology environments. The portability of the software through the movement of containers is appreciated by businesses and IT professionals. In the docker container, one or more processes may run simultaneously. The main objective of this work is to propose a new algorithm called Ant Colony Optimization-based Light Weight Container (ACO-LWC) load balancing scheduling algorithm for scheduling various process requests. This algorithm is designed such that it shows best performance in terms of load balancing. The proposed algorithm is validated by comparison with two existing load balancing scheduling algorithms namely, least connection algorithm and round robin algorithm. The proposed algorithm is validated using metrics like response time (ms), mean square error (MSE), node load, largest Transactions Per Second (TPS) of cluster (fetches/sec), average response time for each request (ms) and run time (s). Quantitative analysis show that the proposed ACO-LWC scheme achieves best performance in terms of all the metrics compared to the existing algorithms. In particular, the response time for least connection, round robin and the proposed ACO-LWC algorithm are 58, 60 and 48 ms respectively when 95% requests are finished. Similarly, the error for scheduling 120 requests using least connection, round robin and the proposed ACO-LWC algorithm are 0.15, 0.11 and 0.06 respectively.


Introduction
In the last few years, server virtualization is popularly being used in the field of information technology. Virtualization acts as a valuable tool for running multiple operating systems in cloud. It facilitates the implementation of various virtual machines on a single physical hardware. The common drawbacks of attained using multi-tenancy containerization model. Garg et al. [13] introduced automated cloud infrastructure for the creation of robust container security. This was implemented using continuous integration of the docker containers. The transformation of cloud computing for the purpose of industrial automation purpose was implemented to improve the productivity of the system. Bhimani et al. [14] analyzed the variation of the performance of the container system with respect to the increase in the number of applications. This scheme was dedicated for the usage in intensive applications. A platform of multiple docker containers were used in this model to identify the effects on the performance in terms of execution time and resource utilization. Mendki [15] utilized docker containers for the implementation by the IoT edge devices. Deep learning framework was implemented in this system. The hardware component used in implementation was the Raspberry Pi module. This scheme was evaluated using surveillance applications in which the real-time data was analyzed. Wan et al. [16] used micro services for the implementation of the docker containers. Hypervisor based virtualization scheme was introduced in this framework. The objective was to minimize the application deployment cost using a micro service architecture. The algorithm was designed to operate in an incremental manner. Jha et al. [17] used holistic evaluation for the integration of docker containers with the micro services. Comparison was done using the container with hypervisor and container with baremetal. In this work, the docker containers were implemented using heterogeneous set of micro services. Two types of containers namely inter-container and intra-container were analyzed and evaluated. Liu et al. [18] proposed a new scheduling algorithm for the container systems based on the optimization of multiple objectives. The resource scheduling was done using the Multiopt algorithm. A new metric was designed to weight each factor in scheduling. Based on this metric, a scoring function was implemented to combine all the factors. Saha et al. [19] evaluated the docker containers using scientific work loads. This system was designed for the cloud implementation. This scheme enabled the flexibility and portability for the usage with multiple applications. Solution was provided based on the singularity principle. Further, this scheme was capable of providing improved performance with minimal overhead. Lingayat et al. [20] performed an extensive performance evaluation of docker containers on baremetals. Here, containers were used for initiating the applications with minimal start up time. Testing was conducted to analyze the type of environment to be used for the implementation of the docker systems. It was found that the usage of baremetal improved the performance by 50%. Based on the literature survey, we infer that proper scheduling algorithms helps to improve the performance of docker systems. Hence, a new algorithm called Ant Colony Optimization-based Light Weight Container (ACO-LWC) load balancing scheduling algorithm for scheduling various process requests is being proposed in this research.

Contribution of the Paper
The main contributions of the paper are listed below: Virtual machine and Container systems are compared in detail.
Lightweight container technologies and their management are discussed. Implementation of docker systems is explained. A novel Ant Colony Optimization-based Light Weight Container (ACO-LWC) load balancing scheduling algorithm is proposed. The proposed algorithm is analyzed using parameters like response time (ms), mean square error (MSE), node load, largest TPS of cluster (fetches/sec), average response time for each request (ms) and run time (s).

Virtual Machine vs. Container
The popularity of software containers has been increasing significantly since the release of Docker in 2013. The main advantage of virtualization approach is its lightweight nature. This helps to isolate and run various programs even on computers that have limited computing capabilities. Recently, the docker containers are being used on top of virtual machine. This helps to overcome the drawbacks of earlier virtual machines. With the rapid evolution of IoT systems, the docker containers are used to promote highly connected networks. These systems help to improve the software processing speed, platform independence and process reliability.
Tab. 1 shows the main differences between virtual machine and the docker container. The first difference is the virtualization level. The virtual machine is based on hardware level whereas, the docker container is based on software level. The virtual machine is fully isolated and the docker container is isolated based on process or application level. The docker container is faster compared to virtual machine. Also, it occupies less storage space compared to virtual machine. The docker machine used a docker hub for its operation. The code reusability concept is encouraged on docker container compared to virtual machine. Further, the resource utilization is done dynamically in docker container whereas, it is done in a static manner in virtual machine. Fig. 1 shows the layer structure of the docker container. The lowermost layer is the infrastructure layer. This layer is topped with Guest Operating System. On top of this layer, is the docker layer. The top most layer is the application layer that contains multiple containerized applications.

Lightweight Container Technologies and their Management
Container technology is a methodology that is capable of functioning as a packaged application. This technology operates with the help of its dependencies. Docker is a software container deployment tool. This tool operates at a process level. The docker container is a tool that allows applications to be isolated from one another in a lightweight manner. The container technology is a network-level virtualization technology that has a separate file system, network and process space to run a server without changing the host operating environment. Using a docker container, more than one processes can be operated simultaneously in a single computer without any conflict with each other.

Implementation
Implementation of docker with multi-service using load balancing algorithm is done as follows, Step 1: A Dockerfile includes a collection of instructions for building an image of docker. The popularly used instructions are FROM, COPY and ENV. The FROM instruction is used for specifying the base images. The COPY command is used for the addition of new files into the container files. The ENV instruction is used for defining the default execution command for the environment variables.
Step 2: The second step is to build the image and to start the container based on the specification in docker-compose.yml file. In this step, the docker compose files are created. This is done using three main steps. The first step is to define the application environment using Dockerfile. The second step is to define all the docker services using docker compose YAML file.
This file is shown in Fig. 3. The final step is to run the docker compose file using the command prompt.
Step 3: The final step is to run the application using compose file. This step is used for building images from the Dockerfile. In this step the docker-compose up command is used for combining the container output.
Step 4: In this step, the docker stat command is used for monitoring the usage of the docker. This is shown in Fig. 4. Here, the load_test_master is used for monitoring the service of the docker in a continuous manner.

Proposed Load Balancing Scheduling Algorithm
A new algorithm is proposed for load balancing scheduling based on Ant Colony Optimization (ACO). In this scheduling algorithm, initially, the amount of resource to be allocated to each node is computed. Based on this computed value, the task allocation is done in a round robin fashion. Then the probability of transition from one node to another is computed. We mostly run docker on the bare computer. Where only docker is operating, implying that the system is completely dedicated to docker. Whereas the individual container will get a maximum of 60% CPU and memory consumption. For effective load balancing, the CPU usage and memory usage must be within a particular optimal range. Hence the CPU usage and memory usage are then computed. Finally, based on the probability of transition, rate of CPU usage and rate of memory usage, the next node to be selected by the artificial ant is then identified. This is explained in the Algorithm 1 below.

Algorithm 1: Ant Colony Optimization-based Light Weight Container (ACO-LWC) load balancing scheduling algorithm
The scheduler is designed such that the tasks are allocated based on the available resources. In this research, ACO is used for the optimal task allocation. The pheromone trail of every resource is analyzed by the artificial ant for the computation of amount of resource to be allocated to each node. This is given by, where R(N i ) is the allocated resource for the node N i , ω m is the memory weight, M′(N i ) is the amount of memory available in node N i , M(N i ) is the total memory of node N i , ω c is the CPU weight, C′(N i ) is the available CPU resources in node N i and C(N i ) is the total CPU of node N i .
Then, the task allocation for each node is done in a Round-Robin fashion. It is represented as where T 0 represents the initial task allocation and RR represents the Round-Robin algorithm.
The probability of transition from node N i to node N j at the T th instant is then given by, where P T (N i , N j ) is the probability of transition from node N i to node N j , T o (N i ) is the task allocated to node N i , λ i is the heuristic value of node N i , T o (N j ) is the task allocated to node N j , λ j is the heuristic value of node N j and n represents the total number of nodes.
The rate of CPU usage is computed as where σ C is the rate of CPU usage, C U (N i ) is the amount of CPU used by node N i and C(N i ) is the total CPU of node N i .
The rate of memory usage is computed as where σ M is the rate of memory usage, M U (N i ) is the amount of memory used by node N i and M(N i ) is the total memory of node N i .
If the CPU usage level is too high, then the response time increases. If the CPU usage level is too low, then the CPU resource gets wasted. Thus, the CPU usage level must be within certain limits. Similarly, if the memory usage level is too high, the run time increases. If the memory usage level is too low, the node load gets unbalanced. Thus, the memory level should neither be too low nor be too high. Based on the probability of transition, rate of CPU usage and rate of memory usage, the next node to be selected by the artificial ant, i.e., node N j is identified using, where σ LC is the lower limit of the CPU usage rate, σ HC is the upper limit of the CPU usage rate, σ C is the rate of CPU usage, σ LM is the lower limit of the memory usage rate, σ HM is the upper limit of the memory usage rate and σ M is the rate of memory usage. The value of σ LC , σ HC , σ LM and σ HM are set as 0.2, 0.8, 0.2 and 0.8 respectively.
The lightweight container load-balancing method is based on ant colony optimization. Fig. 5 shows the flow chart of the proposed ACO-LWC Load Balancing Algorithm. The flowchart goes as follows: first, initialize the container parameters, such as the container name and then begin generating a Docker application package. Then set CPU and memory threshold limitations. The suggested ACO-LWC Load Balancing Algorithm is used to verify the container's workload. If the workload of the container reaches the maximum threshold limit, ant proceeds to compute the container's current resource consumption. If the container is found to be overloaded, a new container is created and a job is assigned. Finally, the best solution was discovered.

Results and Discussion
For evaluating the proposed ACO-LWC algorithm we have used parameters like response time (ms), mean square error (MSE), node load, largest TPS of cluster (fetches/sec), average response time for each request (ms) and run time (s). The proposed algorithm is compared with two existing load balancing scheduling algorithms namely, least connection algorithm and round robin algorithm.
In Fig. 6, the percentage of requests processed were varied from 50% to 95% and the response time was identified for the three algorithms namely, least connection, round robin and the proposed ACO-LWC algorithm. From the Fig. 6, we see that the response time is minimal for the proposed ACO-LWC algorithm compared to the existing algorithms. The response time for least connection, round robin and the proposed ACO-LWC algorithm are 25, 28 and 18 ms respectively when 50% requests are finished. This shows that the response speed is maximum for the proposed scheme. Thus, this scheme can be easily implemented in docker containers for efficient usage. Also, Fig. 5 shows that the response time for least connection, round robin and the proposed ACO-LWC algorithm are 58, 60 and 48 ms respectively when 95% requests are finished. This shows the effectiveness of the proposed algorithm. Fig. 7 shows the comparison of mean square error of the three scheduling algorithms, after scheduling 60 and 120 requests. For all the three algorithms, the error increases when the number of requests increases. The error for scheduling 60 requests using least connection, round robin and the proposed ACO-LWC algorithm are 0.12, 0.09 and 0.04 respectively. Similarly, the error for scheduling 120 requests using least connection, round robin and the proposed ACO-LWC algorithm are 0.15, 0.11 and 0.06 respectively. Thereby, it is evident that the error is very less using the proposed load balancing algorithm. This indicates that the proposed algorithm achieves better performance in load balancing with better stable results. The cluster is divided into many "clusters" in the sense that each node can continue to ping just a subset of the nodes it is aware of. The maximum number of compute nodes in a cluster network is 128 nodes. In Fig. 8, we have considered three nodes namely, Node 1, Node 2 and Node 3. We find that the node load cluster is dispersed in the least connection and round robin algorithm. Whereas, for the proposed ACO-LWC algorithm, the node load is closer together in the cluster. The closeness of node load in the cluster indicates the stability of load balancing. Thus, we can infer that the proposed ACO-LWC algorithm achieves better stability performance. Fig. 9 shows the variation of largest TPS of cluster with respect to number of applications. As shown in the Fig. 9, we see that the number of TPS increases tremendously using the proposed ACO-LWC algorithm. However, the TPS for the least connection and round robin are very low even for higher number of applications. The TPS of cluster for 20 applications is 45, 55 and 650 for the least connection, round robin and proposed ACO-LWC respectively. Similarly, the TPS of cluster for 50 applications is 120, 231 and 1042 for the least connection, round robin and proposed ACO-LWC respectively. The reason for this is because the proposed algorithm schedules the containers adaptively based on the CPU and memory usage. Thus, the response speed is tremendously increased that results in improved TPS performance.  Fig. 10, we see that, for the least connection algorithm, as the number of applications increases, the average response time also increases. Thus, this system is not suitable for higher number of applications. The TPS range achieved by the round robin algorithm is in the range of 2345 to 2865 ms. Thus, it is clear that the response time is high for the round robin algorithm. The proposed ACO-LWC algorithm attains minimal response time ranging from 1567 to 1593 ms. For higher number of applications, for instance, when the number of applications is fixed as 60, algorithms like least connection, round robin and the proposed scheme uses a response time of 5282, 2865 and 1593 ms. Thereby, we understand that, even when the number of applications is high, the response time of the proposed scheme is minimal. This aids in the easier implementation of the proposed algorithm.
In Fig. 11 see that, the run time increases with the increase in the number of applications for all the three algorithms. However, the average run time (ART) for the proposed ACO-LWC scheme is 42.08 ms. For least connection algorithm, the ART is 87.75 ms. For the round robin algorithm, the ART is 67.66 ms. This shows that the overall run time is very low for the proposed scheme. There is around 2.08 times reduction in ART compared to least connection and 1.607 times reduction in ART compared to the round robin algorithm. This clearly indicates the increased performance speed of the proposed scheme.

CPU Performance
The performance of the CPU is greatly improved by the utilization of the proposed ACO-LWC load balancing scheduling algorithm. This helps in the effective resource utilization of the docker host systems. Further, the time taken for the completion of a particular task is very less with the usage of the proposed scheme. Fig. 12 clearly indicates that the proposed scheme has a higher capability to limit the CPU utilization. The amount of CPU utilized by containers and images are greatly reduced with the usage of the proposed algorithm.  This shows that the proposed algorithm has very less CPU usage, thereby, maximizes the CPU efficiency.

Memory Performance
The proposed scheme is further analyzed with respect to the memory performance. This indicates the easier usage of the computer resources. Efficient memory performance helps the docker systems to process multiple applications with minimal cost and minimal overhead. Fig. 13 shows the RAM speed performance of the proposed ACO-LWC algorithm. This Fig. 13 clearly illustrates that almost 100% of the memory utilized by the system are allocated to the software. This ensures that very low memory level is utilized by the system for the virtualization. This helps to improve the RAM speed and the overall performance of the system. The Tab. 3 indicates that the memory usage for least connection, round robin and ACO-LWC algorithm are 2.13 GB, 1.53 GB and 144.3 MB respectively. Thus, the memory utilization of the proposed algorithm is very low. This increases the RAM speed of the system.

Network I/O Performance
The network I/O indicates the data quantity transmitted and received by the docker system using the network interface. The proposed scheme is analyzed based on the network I/O levels using the throughput of the system.      In this research, we have proposed a new algorithm called Ant Colony Optimization-based Light Weight Container (ACO-LWC) load balancing scheduling algorithm for scheduling various process requests. Initially, the task allocation was done in a round robin fashion. To achieve effective load balancing, in this algorithm, the CPU usage and memory usage were maintained within a particular optimal range. Here, the load balancing scheduling was done based on Ant Colony Optimization. Performance analysis showed that the proposed ACO-LWC algorithm achieved better stability performance. Further, the TPS of cluster for 50 applications was found to be 120, 231 and 1042 for the least connection, round robin and proposed ACO-LWC respectively. Similarly, the response time for least connection, round robin and the proposed scheme with 60 applications was identified as 5282, 2865 and 1593 ms. Furthermore, analysis shows that the overall run time is very low for the proposed scheme. There is around 2.08 times reduction in run time compared to least connection and 1.607 times reduction in run time compared to the round robin algorithm. In future, we plan to integrate the proposed framework with IoT systems. We also plan to deploy the proposed algorithm for micro services-based applications.