3.1. Problem Description
The scheduling decisions made during the initial deployment stage of containers have a significant impact on subsequent system performance, resource utilization efficiency, and energy consumption. To achieve intelligent and efficient container resource scheduling, it is essential to construct a well-designed optimization model that comprehensively captures the multi-dimensional constraints and performance objectives encountered in practical deployment scenarios.
In this chapter, the container scheduling problem is first formally described to clarify the problem context and fundamental assumptions. Subsequently, based on the resource characteristics of containers and physical hosts, a multi-objective optimization model is developed. The model jointly considers five key dimensions, namely resource utilization, load balancing, resource fragmentation, energy consumption, and SLA satisfaction, and integrates them into a comprehensive fitness function. Furthermore, a dynamic weighting mechanism is introduced to enhance the adaptability and optimization effectiveness of the model across different scheduling stages.
Figure 1 illustrates the architecture of the initial container deployment, where multiple containers (e.g., c_1–c_11) are placed onto different physical machines (e.g., pm_1–pm_3). The objective is to optimize energy usage and resource allocation while ensuring service quality. As shown in the figure, a simplified single-layer container deployment architecture is adopted in this study, which facilitates the direct application of scheduling algorithms and improves the efficiency of resource allocation.
3.2. Objective Function Design
To solve the container scheduling problem under multi-dimensional resource constraints, this study formulates a unified multi-objective optimization model that jointly considers resource utilization, load balancing, resource fragmentation, energy consumption, and SLA satisfaction. The goal is to obtain an optimal mapping between containers and physical machines that achieves efficient resource usage and stable system performance.
Let
denote the set of physical machines, where
represents the total number of physical machines, and
denotes the set of containers, where
represents the total number of containers.
denotes the set of containers. Each physical machine is characterized by its CPU capacity , memory capacity , peak power consumption , and idle power consumption . Each container requires CPU resource and memory resource . The container scheduling problem aims to determine an optimal placement scheme that assigns each container to a physical machine while satisfying resource constraints and optimizing multiple performance objectives.
- (1)
Resource Utilization and Resource Wastage Rate
The resource wastage rate is denoted as . Resource utilization reflects the effectiveness of physical machine resource usage after container deployment. For each physical machine, the overall utilization level is determined by both CPU and memory utilization. A weighted combination of these two dimensions is adopted to evaluate the resource utilization of each host.
The resource utilization rate is defined as follows:
where
and
denote the CPU and memory utilization ratios of physical machine
, respectively, and
and
are the corresponding weight coefficients that satisfy
.
Based on the utilization rate, the resource wastage rate is defined to measure the proportion of unused resources:
where
m denotes the total number of physical machines.
A smaller value of indicates higher overall resource utilization and less resource wastage.
- (2)
Load Balancing Degree among Physical Machines
The load balancing degree among physical machines is denoted as
. Load balancing is used to evaluate the fairness of workload distribution among physical machines. It is quantified by the mean squared deviation of host loads, where a smaller value indicates a more balanced system.
where
represents the average utilization level of all physical machines, m denotes the total number of physical machines, and
represents the index of physical machines.
- (3)
Resource Fragmentation Degree of Physical Machines
The resource fragmentation degree of physical machines is denoted as . Resource fragmentation measures the dispersion degree of residual resources on physical machines. Highly fragmented resources reduce the ability of the system to accommodate incoming containers, even when sufficient aggregate resources exist.
The resource fragmentation degree is defined as:
This metric intuitively reflects resource fragmentation in containerized environments by measuring how unused CPU and memory resources are dispersed across physical machines, with higher dispersion indicating lower resource reuse efficiency.
- (4)
Energy Consumption of the Container Cloud System
The energy consumption of the container cloud system is denoted as
. Energy consumption represents the total power usage of physical machines under a given scheduling strategy. It is estimated based on the number of active hosts and their utilization levels.
where
and
denote the power consumption of physical machine
at full load and idle state, respectively.
- (5)
Service Level Agreement Violation Rate
The service level agreement violation rate is denoted as
. The SLA violation rate measures the proportion of containers whose resource demands are not satisfied due to insufficient allocation or overload conditions.
where
denotes the number of containers that violate SLA constraints, and
is the total number of containers. A lower SLA violation rate indicates better service quality.
- (6)
Unified Multi-Objective Fitness Function
To flexibly balance the relative importance of different objectives during the optimization process, a dynamic weighting mechanism is adopted. The overall fitness function is defined as a weighted sum of the five objectives:
where
,
,
,
, and
are time-varying weight coefficients that adaptively change with the iteration number
. These coefficients satisfy the normalization constraint:
In the early stages of optimization, higher weights are assigned to resource utilization and load balancing to guide global exploration, while in the later stages, more emphasis is placed on fragmentation reduction, energy efficiency, and SLA satisfaction. The dynamic adjustment strategy is expressed as:
where
is the maximum number of iterations, and
and
are the initial weight coefficients. The remaining weight coefficients follow the same adjustment logic. After dynamic adjustment, all weight coefficients are normalized to ensure that their sum equals 1 at each iteration.
The initial weight values are empirically selected based on preliminary experiments. Due to the adaptive adjustment mechanism, the proposed algorithm exhibits low sensitivity to specific initial weight settings as the weights dynamically evolve according to the search process.
The final optimization objective is to minimize the unified fitness function:
where a smaller value of
indicates a better container scheduling solution.
Although Pareto-based multi-objective optimization methods are widely used, a weighted-sum formulation is adopted in this study to facilitate direct comparison among scheduling solutions and to support practical cloud scheduling scenarios, where a single deployable solution is typically required. This formulation also enables seamless integration with population-based metaheuristic optimizers.
- (7)
Resource Capacity Constraints
The container placement solution must satisfy CPU and memory capacity constraints for each physical machine:
where
indicates whether container
is assigned to physical machine
, and
and
denote the numbers of physical machines and containers, respectively.
and
represent the CPU and memory capacities of physical machine
, while
and
denote the resource requirements of container
.