Container Oriented Job Scheduling Using Linear Programming Model
Container Oriented Job Scheduling Using Linear Programming Model
Dong Zhang, Bing-Heng Yan, Zhen Feng* Chi Zhang, Yu-Xin Wang
State Key Laboratory of High-end Server & Storage School of Computer Science and Technology
Technology Dalian University of Technology
Beijing, China Dalian, China
Inspur Electronic Information Industry Co., Ltd. e-mail: [email protected], [email protected]
Jinan, China
e-mail: {zhangdong, yanbh, fengzh}@inspur.com
Abstract—With Docker gaining widespread popularity in the the container hosts, and the energy costs of the container
recent years, the container scheduler becomes a crucial role for hosts. The illustrated scenario settings and the potential cost
the exploding containerized applications and services. In this considerations lead towards our proposed methodology, that
work, the container host energy conservation, the container minimizes the total costs on the premise that computing
image pulling costs from the image registry to the container capacity requirements are matched for both the clients and
hosts and the workload network transition costs from the servers.
clients to the container hosts are evaluated in combination. By This paper reveals itself in three points, firstly, it presents
modeling the scheduling problem as an integer linear a novel algorithm for the typical container-based applications;
programming, an effective and adaptive scheduler is proposed.
secondly, the container image pulling costs, the workload
Impressive cost savings were achieved compared to Docker
Swarm scheduler. Moreover, it can be easily integrated into
network transition costs from the clients to the container
the open-source container orchestration frameworks. hosts and the host energy costs are considered before making
the image pulling and container-launching decisions; and
Keywords—container; docker; scheduling; integer linear thirdly, to our best knowledge, this is the first work to
programming; energy conservation; container image registry employ the integer linear programming model to solve the
native container scheduling problem.
I. INTRODUCTION The remainder of this paper is organized as follows.
Since the rise of Docker, container, the technology that Section 2 reviews the related works, which inspired our
has evolved for decades, has gained widespread popularity in proposal; section 3 describes the typical container oriented
recent years. The industry has seen the superior advantages application scenario and details the linear programming
inherent in Docker, which remodels the “build, ship and run” based solution; section 4 presents the experimental results
procedure in the software engineering. Remarkably, the and gives a further analysis; section 5 concludes the paper
lightweight and high-performance features pave the way to and introduces our future work.
more opportunities for Docker in novel applications and II. RELATED WORKS
cloud-native services.
Docker has established a de facto standard for the The scheduling methodologies in the cloud environment
container engine, however, the job scheduling and have been studies for years since the coming of cloud
orchestration in the containerized environments is still an computing era. In the early period, the researches on
open issue. The open-source community proposed container- scheduling primarily focused on the collaboration between
native orchestration frameworks such as Kubernetes, Mesos the virtual machines and the physical hosts, for the purpose
Marathon and Docker Swarm; the academic circles put of performance-oriented load balance or energy-oriented
forward creative scheduling algorithms to pursue load- workload consolidation. Some works investigated the on-
balance or energy-efficient optimal solutions. The joint demand resource (processor cores, main memory, I/O
efforts from both the communities make the container devices, etc.) provisions to virtual machines, while others
technology steps further to the practical and commercial moved to a higher level of virtual machine migrations among
usages. physical servers. To list some notable literatures, Srikantaiah
In this paper, the authors consider a typical scenario et al. 2008 studied the inter-relationships between energy
where the concurrent jobs are scheduled in the context of consumption, resource utilization, and performance of
containerized workload dispatch. Requests are initiated from consolidated workloads [1]. They observed that the optimal
the client points for computing capacities, the computing operating points for the energy performance trade-offs for
servers pull the related container images from the image consolidation exist, and modeled the consolidation problem
registry and launch containers to handle the received requests. as a modified bin packing problem. Zhao et al. 2009
Mainly two kinds of costs are observed in the scenario, the introduced the MEmory Balancer (MEB), which
container image transition costs from the image registry to dynamically monitors the memory usage of each virtual
175
pull the responding containers from the image registry. The The constraint (1) ensures that all the workloads from the
image is composed of multiple layer files, if all the required client k should be processed on the hosts.
layer files are already stored in the host, the cost is zero; To meet the criterion (2), the constraint (2) is set as:
however, if only parts of the layer files are ready, then the
missing layers should be downloaded from the image σ
௧ୀଵ ݔሺ݇ǡ ݐሻ
ሺሻ (2)
registry, which leads to extra costs (illustrated in Fig. 2).
The constraint (2) ensures that all the workloads running
on the k-th host should not exceed its capacity.
The costs happened in the workload network transition is
defined as:
݂ଵ ሺݔሻ ൌ σ
௧ୀଵ σୀଵ ݐݏ̴ܿݏ݊ܽݎݐሺ݇ǡ ݐሻ ή ݔሺ݇ǡ ݐሻ (3)
σ
సభ ௫ሺǡ௧ሻ
ൌ (5)
௧௬ሺሻ
176
݂ሺݔǡ ݕሻ ൌ ݂ଵ ሺݔሻ ߙ݂ଶ ሺݔሻ ߚ݂ଷ ሺݕሻ ൌ
σ
௧ୀଵ σୀଵ ݐݏ̴ܿݏ݊ܽݎݐሺ݇ǡ ݐሻ ή ݔሺ݇ǡ ݐሻ ߙ σୀଵ ቆ൫ܲǡ௫ െ
σ
సభ ௫ሺǡ௧ሻ
ܲǡௗ ൯ ൈ
௧௬ሺሻ
ܲǡௗ ቇ ߚ σ
௧ୀଵ σୀଵ ݐݏ̴݈݈ܿݑሺ݇ǡ ݐሻ ή ݕሺ݇ǡ ݐሻ
(9)
where the weighting factors ߙ and ߚ are introduced to
balance the three costs.
This work aims to dispatch the workloads from all the
client points to the container hosts to achieve the minimal
costs of the energy consumption and the network transition. Figure 4. Image pulling cost from the registry
This is reflected in the objective function (10):
To gain a first sight of the three scheduling methods, a
݂ሺݔǡ ݕሻ ൌ ݂ଵ ሺݔሻ ߙ݂ଶ ሺݔሻ ߚ݂ଷ ሺݔሻ (10) small-scale test was performed initially, with two clients and
four container servers. The client workloads and host
capacities were generated in random, but were limited
Subject to the following constraints: between 10 and 20. The network transition costs between
clients and hosts were also random numbers between 1 and 4.
σୀଵ ݔሺ݇ǡ ݐሻ ൌ ሺݐሻ (11) The image pulling costs were set between 0 and 3, based on
the layers required to be downloaded from the registry.
σ (12) Without loss of generality, the weighting factors α and β in
௧ୀଵ ݔሺ݇ǡ ݐሻ
ሺሻ
the function (7) were set to 1. Following Morin et al. 2011’s
ݔ Ͳ and ݔis integer (13) practice, the idle and fully utilized power values were fixed
to 171 and 218 Watt, on a Dell PowerEdge 1950 server with
ݕis binary (14) 4 GB of RAM and two Intel Xeon 5148 2.33 GHz CPUs [5].
The randomly generated host capacities, client workloads
Thereby, an integer linear programming representation is and workload network transition costs are shown in Fig. 3.
introduced by the objective function (10) and the constrains The image pulling costs from the registry are shown in Fig. 4.
(11), (12) and (13). Then the optimal solutions to the Algorithm 1: Liner Programming based Scheduling
ݔሺ݇ǡ ݐሻǡ ݇ ൌ ͳǡʹǡ ǥ ݊ǡ ݐൌ ͳǡʹǡ ǥ ǡ ݉ can be reached. Algorithm for Containers
The complete procedure is presented in Algorithm 1.
Inputs:
IV. EXPERIMENTAL RESULTS AND ANALYSIS
Container host capacities:
ሺሻǡ ݇ ൌ ͳǡʹǡ ǥ ǡ ݊
In this section, the authors conducted series of
experiments to compare the total costs of the proposed Client requested workloads: ሺݐሻǡ ݐൌ ͳǡʹǡ ǥ ݉
method and the binpack and random methods employed in
Network transition costs per workload unit:
the Docker Swarm orchestration framework. For the sake of
̴ܿݐݏሺ݇ǡ ݐሻ
simplification and to expel other factors, the three scheduling
algorithms (LP in our proposal, Binpack and Random in Container image pulling costs between image registry and
Docker Swarm) are implemented via MATLAB in a hosts: ̴ܿݐݏሺ݇ǡ ݐሻ
controlled experimental environment.
Outputs:
Workloads placed on the host k for the client t: ݔሺ݇ǡ ݐሻ
Procedure:
# All the workloads from the client k should be
processed on the hosts:
177
LP Binpack Random
Figure 5. LP scheduler with total cost 137.01
Round 1 705.3 1630.2 1560.7
Round 2 698.1 1447.9 1624.3
Round 3 692.7 1543.7 1831.0
Round 4 631.7 1237.5 1387.3
Round 5 718.5 1516.5 1671.4
LP Binpack Random
Round 1 2285.3 4904.5 5536.4
Round 2 2214.7 4844.7 4993.4
Round 3 2231.1 5047.5 4820.2
Round 4 2203.8 4640.2 4965.8
Figure 6. Binpack scheduler with total cost 185.3 Round 5 2268.5 4648.7 5097.0
178
TABLE III. TOTAL COSTS UNDER 100 HOSTS AND 200 CLIENTS TABLE IV. ENERGY CONSUMPTIONS UNDER 100 HOSTS AND 200
CLIENTS
LP Binpack Random
Round 1 4398.3 9488.3 9844.8 LP Binpack Random
Round 2 4421.8 9828.4 9811.3 Round 1 1587.4255 1994.5625 2053.9633
Round 3 4592.4 9775.1 10509.9 Round 2 1544.9884 1833.5165 1991.5988
Round 4 4366.9 9743.8 9849.2 Round 3 1524.3855 1918.8469 1964.6325
Round 5 4334.9 9680.2 9796.3 Round 4 1542.1529 1884.4235 1952.5552
Round 5 1500.0833 1890.6129 1851.3717
LP Binpack Random
Round 1 3011 7671 7441
Round 2 3009 7615 7815
Round 3 2921 7374 7316
Round 4 2946 7222 7419
Round 5 2948 6899 7403
σ
సభ ௫ሺǡ௧ሻ
V. CONCLUSION
݂ሺݔሻ ൌ σୀଵ ቆ൫ܲǡ௫ െ ܲǡௗ ൯ ൈ
௧௬ሺሻ In this paper, we put forward an Integer Linear
Programming-based solution to the containerized application
ܲǡௗ ቇ (15) scheduling in the cloud environment. The proposed method
has achieved impressive performance in the energy
In cases where only the energy consumption matters, or: conservation, registry image pulling costs and the network
transition costs savings. It makes a step further to an adaptive
݂ሺݔሻ ൌ σ
௧ୀଵ σୀଵ ܿݐݏሺ݇ǡ ݐሻ ή ݔሺ݇ǡ ݐሻ (16) and effective scheduler for the native container as a service
scenarios.
In cases where only the network transition cost counts. We have planned our future work in two fields. Firstly, in
The experimental results for the objective functions (15) the current scheme, the workload is represented by units, we
and (16) are shown in Tables 4 and 5 respectively, under the intend to extend the workload into multiple dimensions, to fit
100 hosts and 200 clients setting. for the multiple resource requests, leading to that the
workload will become a vector with CPU and memory
dimensions. Secondly, the scheduler prototype is currently
written in MATLAB, we will reconstruct it into the GO or
Python language, to make the proposed scheduler as a plugin
for the open-source container orchestration frameworks. The
scheduler prototype source code will be available at GitHub.
ACKNOWLEDGEMENT
This work is supported by the National High Technology
Research and Development Program (863 Program) of China
(NO. 2015AA015301).
REFERENCES
[1] S. Srikantaiah, A. Kansal, F. Zhao, “Energy aware consolidation for
cloud computing,” Proceedings of the 2008 conference on Power
aware computing and systems, San Diego, California, 2008, pp: 10-
10
[2] W. M. Zhao, Z. L. Wang, “Dynamic memory balancing for virtual
machines,” Proceedings of the 2009 ACM SIGPLAN/SIGOPS
international conference on Virtual execution environments,
Washington, DC, USA, 2009.
Figure 9. Cost growth curves with growing scales
179
[3] P. Padala , K. Y. Hou, K. G. Shin, X. Z., M. Uysal , Z. K. Wang , S. [8] H. Yuan, C. B. Li , M. K. Du, “Virtual Machine Resources
Singhal , A. Merchant, “Automated Control of Multiple Virtualized Scheduling Based on Improved Particle Swarm Optimization in
Resources,” Proceeding of the 4th ACM European Conference on Cloud Computing,” Journal of Software, 2014, 9(3).
Computer Systems, Nuremberg, Germany, 2009, pp: 13-26. [9] D. Zhang, B. H. Yan, Z. Feng, K. Y. Qi, Z. Y. Su, “Inverse
[4] R. Urgaonkar, U. C. Kozat, K. Igarashi and M. J. Neely, "Dynamic Clustering-based Job Placement Method for Efficient Big Data
resource allocation and power management in virtualized data Analysis,” Proceedings of the 2015 IEEE 17th International
centers," 2010 IEEE Network Operations and Management Conference on High Performance Computing and Communications,
Symposium - NOMS 2010, Osaka, 2010, pp. 479-486. 2015 IEEE 7th International Symposium on Cyberspace Safety and
[5] E. Feller, L. Rilling and C. Morin, "Energy-Aware Ant Colony Based Security, and 2015 IEEE 12th International Conf on Embedded
Workload Placement in Clouds," 2011 IEEE/ACM 12th International Software and Systems, Washington, DC, USA, 2015, pp. 1796-1799.
Conference on Grid Computing, Lyon, 2011, pp. 26-33. [10] R. Osnat, “A Brief History of Containers: From 1970s chroot to
[6] A. Beloglazov, J. Abawajy and R. Buyya, “Energy-aware resource Docker 2016,” http://blog.aquasec.com/a-brief-history-of-containers-
allocation heuristics for efficient management of data centers for from-1970s-chroot-to-docker-2016
Cloud computing,” Future Generation Computer Systems, 2012, vol. [11] J. Monsalve, A. Landwehr and M. Taufer, "Dynamic CPU Resource
28(5), pp: 755-768 Allocation in Containerized Cloud Environments," 2015 IEEE
[7] Y. Song, Y. Sun and W. Shi, "A Two-Tiered On-Demand Resource International Conference on Cluster Computing, Chicago, IL, 2015,
Allocation Mechanism for VM-Based Data Centers," in IEEE pp. 535-536.
Transactions on Services Computing, vol. 6, no. 1, pp. 116-129, First
Quarter 2013.
180