Method and application of topology-aware microservice application scheduling in cloud environment
By constructing a multi-dimensional resource management model and topology map segmentation algorithm, and using cluster topology to optimize microservice scheduling, the problems of low resource utilization and high communication overhead in cloud data centers are solved, and service quality is improved.
Patent Information
- Application Number
- CN202210169538.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-23
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-02-23
AI Technical Summary
Existing cloud data centers cannot make full use of the cluster topology when managing microservice applications, resulting in low resource utilization and high communication overhead, which affects service quality.
By building a multi-dimensional resource management model, we filter scheduling nodes based on the topological relationship between microservice applications and clusters, perform topology graph segmentation to minimize communication overhead, and allocate microservice applications to appropriate working nodes based on resource utilization and fragmentation rate scores.
It improves the resource utilization and service quality of microservice applications in the cloud environment, and reduces the communication cost between microservice applications.
Smart Images

Figure CN114625500B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of microservices and cloud native, and in particular to a method and application of topology-aware microservice application scheduling in a cloud environment. Background Art
[0002] As a new application architecture model, microservice architecture has become a trend in modern application design due to its support for high scalability and high availability. Microservice architecture divides complex applications into a set of loosely coupled independent services with single functions. These services can be built, deployed, run and maintained independently of other services or the entire application itself without compromising the integrity of the application. Each service with independent functions and deployment is called a microservice. Compared with the traditional monolithic architecture, microservice architecture greatly improves the availability, portability, updatability and scalability of applications.
[0003] However, the large-scale application of microservice architecture has also brought new challenges to cloud data centers. Traditional cloud platforms are mainly designed for single applications, and use virtualization technology to achieve resource pooling, providing pay-as-you-go services for computing, network, storage and other resources. The microservice architecture fundamentally changes many assumptions in current cloud system design, and its impact mainly includes the following two points:
[0004] 1. Insufficient resource management capabilities. Microservices have heterogeneous resource requirements. In addition to the common computing and memory resource requirements, many microservices also require more dimensions and finer-grained multi-resource allocations based on business needs, such as memory bandwidth, graphics computing units (GPUs), and dedicated accelerator cards. The heterogeneity of microservice resource requirements further increases the complexity of resource management.
[0005] 2. The network has become a bottleneck for the service quality of microservice applications. Microservice applications rely heavily on HTTP requests or remote procedure calls to achieve inter-service communication. Therefore, compared with monolithic applications, the bottleneck of end-to-end response latency of microservice architecture applications is reflected in the network. The network communication time overhead in microservice applications accounts for more than 30% of the overall application time overhead, so it is very necessary to optimize the microservice scheduling and deployment from the network.
[0006] At present, the resource management system of cloud data centers mainly uses some general scheduling strategies, such as fair scheduling strategy, which can ensure that service instances can obtain sufficient resources, but the disadvantage of this strategy is that the cluster resource utilization rate is low; the box-packing scheduling strategy can significantly improve the cluster resource utilization rate, but this strategy will have a certain impact on the service quality of the application. More research work on microservice scheduling strategies focuses on automatic scaling methods. These works are based on the independent expansion capabilities of microservices, use reinforcement learning or performance prediction models to establish resource scaling rules, and determine the number of resources that need to be adjusted to achieve higher resource utilization.
[0007] However, the above methods all ignore the topological structures existing in microservice applications and clusters. These topological structures are the key to reducing the communication overhead of microservice applications. Researching microservice scheduling strategies with topology awareness will help improve the performance of microservice applications in cloud environments.
[0008] The information disclosed in this background technology section is only intended to enhance the understanding of the overall background of the invention and should not be regarded as an acknowledgment or any form of suggestion that the information constitutes the prior art already known to a person skilled in the art. Summary of the invention
[0009] The purpose of the present invention is to provide a method and application for topology-aware microservice application scheduling in a cloud environment, so as to solve the problem that existing cluster management tools cannot fully utilize microservice applications and cluster topology relationships.
[0010] To achieve the above objectives, an embodiment of the present invention provides a method for topology-aware microservice application scheduling in a cloud environment.
[0011] In one or more embodiments of the present invention, the method includes: building a multidimensional resource management model for the working nodes in the cluster according to the summary description information of the cluster; performing pre-deployment on the working nodes according to the summary description information of the microservice application and the multidimensional resource management model, and screening the scheduling nodes according to the resource balancing conditions; and obtaining the scheduling result of the microservice application according to the topological map of the microservice application and the scheduling node, and executing the scheduling task according to the scheduling result.
[0012] In one or more embodiments of the present invention, constructing a multidimensional resource management model for the working nodes in the cluster based on the summary description information of the cluster includes: calculating the resource utilization of the working nodes, wherein the resources include at least two of the CPU, memory size, memory bandwidth, and video memory; constructing a multidimensional resource management model based on the resource utilization, wherein the multidimensional resource management model is used to describe the resource usage of the working nodes.
[0013] In one or more embodiments of the present invention, the screening of scheduling nodes according to resource balancing conditions includes: after the microservice application is deployed on the working node, calculating the resource utilization rate of the working node; and traversing the resource utilization rate, and when the extreme difference of the resource utilization rate exceeds the balance constraint, eliminating the corresponding working node.
[0014] In one or more embodiments of the present invention, the scheduling result of the microservice application is obtained according to the topological map of the microservice application and the scheduling node, and the scheduling task is executed according to the scheduling result, including: determining whether the microservice application has completed the scheduling; if so, executing the deployment task according to the result in the deployment queue; if not, screening out the working nodes to be scheduled, and performing topological map segmentation on the working nodes to be scheduled and the microservice application to be scheduled.
[0015] In one or more embodiments of the present invention, the screening out of the working nodes to be scheduled and performing topological segmentation on the working nodes to be scheduled and the microservice applications to be scheduled include: determining whether the working node is the current best scheduling node; if so, deploying the microservice application to be scheduled on the working node and adding the deployment task to the deployment queue; if not, performing topological segmentation on the working node to be scheduled and the microservice application to be scheduled.
[0016] In one or more embodiments of the present invention, a topological map segmentation is performed on the working node to be scheduled and the microservice application to be scheduled, including: segmenting the topological map of the working node to be scheduled into a first area and a second area, and minimizing the communication overhead between the first area and the second area; and allocating the microservice application to be scheduled to the first area and the second area according to the segmentation result of the topological map of the working node to be scheduled.
[0017] In one or more embodiments of the present invention, the microservice application to be scheduled is allocated to the first zone and the second zone according to the segmentation result of the topological map of the working node to be scheduled, including: calculating the communication overhead and network bandwidth occupancy ratio of the microservice application to be scheduled and the scheduled microservice applications in different working node partitions; calculating the resource fragmentation rate of the microservice application to be scheduled in different working node partitions; and obtaining a score according to the communication overhead, the network bandwidth occupancy ratio and the resource fragmentation rate, and allocating the microservice application to be scheduled to the partition with a high score.
[0018] In one or more embodiments of the present invention, the method further includes: determining whether the scheduling of the working node and the microservice application is completely completed, and if so, executing the microservice application deployed on the working node.
[0019] In another aspect of the present invention, a device for topology-aware microservice application scheduling in a cloud environment is provided, which includes a construction module, a screening module and a scheduling module.
[0020] The building module is used to build a multi-dimensional resource management model for the working nodes in the cluster according to the summary description information of the cluster.
[0021] The screening module is used to perform pre-deployment on the working node according to the summary description information of the microservice application and the multi-dimensional resource management model, and screen the scheduling node according to the resource balancing condition.
[0022] The scheduling module is used to obtain the scheduling result of the microservice application according to the topological diagram of the microservice application and the scheduling node, and execute the scheduling task according to the scheduling result.
[0023] In one or more embodiments of the present invention, the construction module is also used to: calculate the resource utilization of the working node, wherein the resources include at least one of CPU, memory size, memory bandwidth and video memory; construct a multidimensional resource management model based on the resource utilization, wherein the multidimensional resource management model is used to describe the resource utilization of the working node.
[0024] In one or more embodiments of the present invention, the screening module is also used to: calculate the resource utilization rate of the working node after the microservice application is deployed on the working node; and traverse the resource utilization rate, and eliminate the corresponding working node when the extreme difference of the resource utilization rate exceeds the balance constraint.
[0025] In one or more embodiments of the present invention, the scheduling module is also used to: determine whether the microservice application has completed scheduling; if so, execute the deployment task according to the result in the deployment queue; if not, filter out the working nodes to be scheduled, and perform topological map segmentation on the working nodes to be scheduled and the microservice applications to be scheduled.
[0026] In one or more embodiments of the present invention, the scheduling module is also used to: determine whether the working node is the current optimal scheduling node; if so, deploy the microservice application to be scheduled on the working node and add the deployment task to the deployment queue; if not, perform topological map segmentation on the working node to be scheduled and the microservice application to be scheduled.
[0027] In one or more embodiments of the present invention, the scheduling module is also used to: divide the topological map of the working node to be scheduled into a first zone and a second zone, and minimize the communication overhead between the first zone and the second zone; and allocate the microservice application to be scheduled to the first zone and the second zone according to the segmentation result of the topological map of the working node to be scheduled.
[0028] In one or more embodiments of the present invention, the scheduling module is further used to: calculate the communication overhead and network bandwidth occupancy ratio of the microservice application to be scheduled and the scheduled microservice applications in different working node partitions; calculate the resource fragmentation rate of the microservice application to be scheduled in different working node partitions; and obtain a score based on the communication overhead, the network bandwidth occupancy ratio and the resource fragmentation rate, and allocate the microservice application to be scheduled to the partition with a high score.
[0029] In one or more embodiments of the present invention, the scheduling module is further used to: determine whether the scheduling of the working node and the microservice application is completely completed, and if so, execute the microservice application deployed on the working node.
[0030] In another aspect of the present invention, an electronic device is provided, comprising: at least one processor; and a memory, wherein the memory stores instructions, and when the instructions are executed by the at least one processor, the at least one processor executes the method for topology-aware microservice application scheduling in a cloud environment as described above.
[0031] In another aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for topology-aware microservice application scheduling in a cloud environment are implemented.
[0032] Compared with the prior art, the method and application of topology-aware microservice application scheduling in a cloud environment according to the implementation mode of the present invention can build a multidimensional resource management model of cluster working nodes based on the summary description of microservice applications and clusters, and apply it to the topology-aware microservice application scheduling strategy, and finally find suitable working nodes for all microservices in the microservice application for deployment; it can also comprehensively consider all the microservices contained in it from the overall perspective of the application when providing topology-aware microservice application scheduling, calculate the scheduling results based on the topological relationship of the microservice application and the cluster and the constraints of available resources, while ensuring the overall resource utilization of the cluster, reduce the communication cost between microservice applications, and improve the service quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is an overall flow chart of a method for topology-aware microservice application scheduling in a cloud environment according to an embodiment of the present invention;
[0034] Figure 2 It is a flow chart of a scheduling algorithm of a method for scheduling microservice applications in a topology-aware cloud environment according to an embodiment of the present invention;
[0035] Figure 3It is an abstract schematic diagram of a cluster in a typical cloud environment according to a method for topology-aware microservice application scheduling in a cloud environment according to an embodiment of the present invention;
[0036] Figure 4 It is an abstract schematic diagram of a typical microservice application of a method for scheduling microservice applications with topology awareness in a cloud environment according to an embodiment of the present invention;
[0037] Figure 5 is a structural diagram of a device for topology-aware microservice application scheduling in a cloud environment according to an embodiment of the present invention;
[0038] Figure 6 It is a hardware structure diagram of a computing device for topology-aware microservice application scheduling in a cloud environment according to an embodiment of the present invention. DETAILED DESCRIPTION
[0039] The specific implementation modes of the present invention are described in detail below in conjunction with the accompanying drawings, but it should be understood that the protection scope of the present invention is not limited by the specific implementation modes.
[0040] Unless explicitly stated otherwise, throughout the specification and claims, the term “comprise” or variations such as “include” or “comprising”, etc., will be understood to include the stated elements or components but not to exclude other elements or components.
[0041] The technical solutions provided by various embodiments of the present invention are described in detail below in conjunction with the accompanying drawings.
[0042] Example 1
[0043] like Figures 1 to 4 As shown, a method for topology-aware microservice application scheduling in a cloud environment in an embodiment of the present invention is introduced, and the method includes the following steps.
[0044] In step S101, a multi-dimensional resource management model is constructed for working nodes in the cluster according to summary description information of the cluster.
[0045] The network topology of a typical container orchestration cluster can be abstractly described as Figure 3The tree topology shown in the figure consists of multiple levels, where the vertex of the tree structure represents the availability zone, and the next level is the aggregation layer, where rack represents the rack facility of the aggregation layer, and the racks are connected to the core switch through the aggregation layer switch; the next level is the physical machine level, and the symbol PM is used to represent the set of all physical machines in the physical machine layer, and the physical machines are connected through the access layer switch; the next level represents the virtual machine layer, and the symbol VM is used to represent the set of all virtual machines in the virtual machine layer, and the virtual machine vm∈VM constitutes the environment for the operation of the microservice; the leaf node of the tree topology is the microservice ms, and the microservice ms is scheduled to the corresponding virtual machine vm by the container orchestration system.
[0046] The summary description can accurately define the resource status of each working node in the cluster and the communication status between each working node. Based on the topology awareness concept, this embodiment aims to fully optimize the resource utilization and communication cost between services based on the resources and network environment of the physical cluster.
[0047] Specifically, the utilization rate of various resources of each working node, including CPU, memory size, memory bandwidth, and graphics card, is calculated; a multi-dimensional resource management model is constructed by comprehensively considering the resource utilization rates of each dimension to uniformly describe the resource utilization of the working nodes.
[0048] In step S102, pre-deployment is performed on the working nodes according to the summary description information of the microservice application and the multi-dimensional resource management model, and the scheduling nodes are screened according to the resource balancing condition.
[0049] Using Tuples for Highlighting Microservice Applications<MS,MS_DEP> The symbol MS represents the set of all microservices in the microservice application, and the total number is M. The symbol MS_DEP is used to describe the topological dependency in the microservice application, and the set of MS_DEP contains the information of all edges in the DAG graph.
[0050] For example, microservices i With ms j There is a call between (ms i ,ms j ,trans ij )∈MS_DEP for description, (ms i ,ms j ,trans ij ) i Indicates the initiator of the call, ms j Indicates the responder of the call. The traffic in the call link uses trans ij To express.
[0051] The summary description of microservices includes not only the topology diagram of microservices, but also a multi-dimensional resource requirement model for each microservice, which defines the resource requirements of a single microservice. i ,REQ i )∈MS, using REQ i Describe microservices i The requirements of physical resources (including computing requirements, memory requirements, storage requirements, etc.)
[0052] Specifically, the resource usage of the microservice after it is deployed on a certain work node is calculated; the resource usage rates of each dimension are traversed, and if the extreme difference between the resource usage rates exceeds the balance constraint, the work node is eliminated to obtain a set of work nodes suitable for scheduling.
[0053] In this embodiment, the topology-aware scheduling algorithm in the cloud environment makes decisions based on the summary description information of the cluster and the summary description information of the microservice application, establishes a multi-dimensional resource management model for the working nodes, supports balanced scheduling of heterogeneous microservices, and improves the resource utilization of the cluster.
[0054] In step S103, the scheduling result of the microservice application is obtained according to the topological diagram of the microservice application and the scheduling node, and the scheduling task is executed according to the scheduling result.
[0055] For the call topology existing in microservice applications, the topology-aware scheduling strategy uses a heuristic graph partitioning algorithm to complete the topology mapping between the microservice topology and the cloud data center topology. This method can effectively reduce the network overhead and network contention of microservice applications, and optimize the response delay and throughput performance of microservice applications.
[0056] Specifically, determine whether the microservice to be scheduled has completed scheduling. If so, execute the deployment task according to the result in the deployment queue. If not, determine whether the working node is the current best scheduling node. If so, select the microservice to be scheduled to be deployed on the working node and add the deployment task to the deployment queue; if not, execute the graph partitioning algorithm.
[0057] The partitioning algorithm is executed on the topology of the work node to be scheduled. The partitioning algorithm partitions the work node topology into two parts and minimizes the communication overhead between the two parts. The partitioning algorithm is executed on the topology of the microservice to be scheduled. The partitioning algorithm allocates the microservice to be scheduled to two work node partitions according to the partitioning result of the work node. The allocation is based on: node resource fragmentation rate, communication overhead between services, and network bandwidth contention degree. Based on the topological relationship between microservices, the communication overhead and network bandwidth occupancy ratio of the microservice to be scheduled and the scheduled microservices in different work node partitions are first calculated, and the resource fragmentation rate of the microservice in different work node partitions is calculated. The three are combined and substituted into the scoring function, which performs weighted average calculation on the three values, and the microservice will be allocated to the partition with a higher score.
[0058] The strategy performs scheduling and deployment on a microservice application basis. Deployment is performed only after the scheduling phase is fully completed to prevent the phenomenon of some deployed microservices being unable to provide complete application services and causing resource waste when resources are limited.
[0059] The topology-aware microservice application scheduling strategy in the cloud environment essentially provides a service scheduling algorithm based on resource management model and graph partitioning to achieve the microservice application scheduling of a group of multiple microservices, and under certain resource constraints, select some working nodes to host microservices so that they can provide services to the outside world normally.
[0060] In order to better understand the technical solution of the present invention, the present invention is further described below in conjunction with specific application scenarios.
[0061] In the multi-dimensional resource management model, the usage of resources in each dimension of the node needs to be quantitatively described first. For the resource utilization rate of a single resource dimension, γ is used to represent it:
[0062]
[0063] Among them, use exist i,x To describe whether the service will be deployed on a certain working node, where x means that the service is pre-deployed on working node n x , d represents the dimension of resources, working node n x The resource utilization rate of each dimension can be described as γ d (1≤d≤D).
[0064] For worker node n x In general, the exhaustion of any resource will cause the node to enter an unschedulable state, and the remaining unallocated resources of the node will form resource fragments σ x .
[0065]
[0066] Among them, R x Used to represent the weighted average sum of resource utilization in each dimension.
[0067]
[0068] The significance of setting different weights for different resources is that some resources can accept a certain degree of "overselling", that is, the allocated resources can exceed the maximum available value of the resource (such as CPU), while some other resources will seriously affect the service status when facing resource shortage. For example, when memory resources are insufficient, it will trigger memory exhaustion and cause downtime. When bandwidth resources are limited, it will not cause service unavailability, but will only lead to an increase in request latency and a decrease in service quality.
[0069] The size of resource fragments reflects the rationality of resource allocation of working nodes. When a working node reaches its maximum capacity, the smaller the unused resource fragments on it are, the more reasonable the resource allocation of the working node is, which can prove to a certain extent that the node can achieve higher utilization. The core purpose of the scheduling algorithm of the present invention is to reduce the generation of various resource fragments on the computing node, so that the size of resource fragments that cannot be used by applications is within an acceptable range. Therefore, the mathematical model definition of the overall resource fragmentation of the cluster is shown in formula (4):
[0070]
[0071] In actual scenarios, the resource fragmentation rate of some working nodes in the cluster is too large, resulting in premature exhaustion of one or several types of resources on the nodes. This scenario is called resource imbalance, and the extreme difference in resource utilization is used to define the cluster balance.
[0072] Considering that a large number of network calls in microservice applications are the key to affecting service performance, the communication overhead of each service in a microservice application is determined by the topology of the microservice application to be scheduled and the physical topology of the cluster. For upstream and downstream microservices that generate call relationships, the closer the distance in the physical topology, the lower the corresponding communication overhead. Therefore, the network communication overhead in a microservice application can be formally described as:
[0073]
[0074] COST(MS) analyzes the dependencies of each microservice in the application, accumulates and calculates the overhead generated by each call, and finally sums the full-link communication overhead to obtain the total communication overhead of the microservice application. Since the cluster infrastructure presents a tree-like topology, when calculating the microservice communication overhead, it is necessary to consider the shortest communication path between the working nodes where the two microservices are located, and record this path as LINKij ,because Figure 4 The overhead of each link is different, so LINK ij It contains multiple self-paths, and the link overhead of each path needs to be summed up to get the communication overhead generated by the microservice call.
[0075] The quality of network communication of microservice applications is affected not only by the communication overhead on the link, but also by the available bandwidth on the link. Since the communication traffic between microservices does not always remain at a constant value, but fluctuates with the change of the number of concurrent requests, in this embodiment, 90% of its peak value is used as a reference. Therefore, in the process of pre-allocating link bandwidth, it is necessary to consider the interference caused by other applications to the service. For this bandwidth interference, it is defined as:
[0076]
[0077] The smaller the ratio of the bandwidth required by the service to the available bandwidth of the link, the lower the possibility that other applications will affect the communication of the service. Considering the physical topology of the cluster, the calculation of bandwidth interference needs to consider all links on the calling link, and the cumulative sum is defined as the total interference INTER (MS) that the microservice application will bear.
[0078] Considering the scheduling problem of microservice containers in a large-scale distributed cluster environment, the scheduler needs to ensure the highest possible resource utilization to reduce the operating cost of the cluster. However, scheduling strategies designed solely for the purpose of improving resource utilization often lead to excessive congestion in the placement of microservice containers, and cause the service quality of microservice applications to decline due to resource contention.
[0079] For multiple microservices contained in a microservice application, the scheduler usually executes the scheduling logic serially, that is, at the same time, only one microservice instance is assigned a working node, and the next one is considered after the assignment is completed. Therefore, the goals of high resource utilization and high service quality required for the cluster as a whole are also converted to low fragmentation rate, low communication overhead and low network contention for the scheduling of a single microservice. Based on the above definition of the three goals, a multi-objective optimization model is established. The model simulates the situation of scheduling a single microservice and requires the simultaneous optimization of the three goals.
[0080] MIN FRAG(N) (7)
[0081] MIN COST(MS) (8)
[0082] MIN INTER(MS) (9)
[0083] Formulas (7) to (9) describe the goals of microservice deployment. These three expressions focus on describing the impact of a single microservice deployment on node resources, evaluating the communication overhead and network interference generated by a single microservice and its upstream microservices, and respectively represent the optimization of three goals: minimizing the fragmentation rate of working nodes, minimizing the network transmission overhead between microservices, and minimizing network interference.
[0084]
[0085]
[0086]
[0087]
[0088]
[0089] Formulas (10) to (14) are the constraints of the optimization model. Formula (10) is the resource constraint of the working node, formula (11) is the constraint of the available bandwidth, and formula (12) describes the deployment of the service instance on the working node. i,x Represents microservice ms i Deployed on working node n x superior.
[0090] The symbol T in formula (13) is defined as the node n x The range between resource utilization rates of each dimension in the pre-deployment state. If the range is set too low, the working node will often fall into an unschedulable state. If it is set too high, it will lead to excessive tolerance for fragmentation and ultimately low resource utilization. In this embodiment, the range T is set to 0.8, and a trade-off value is taken between the availability of the working node and the guarantee of resource utilization. Formula (14) limits the same microservice to only one instance.
[0091] Through the above implementation, the modeling and formalization of the microservice scheduling problem in the cloud environment are realized, and a microservice scheduling strategy based on topology awareness is further proposed. By recursively dividing the set of working nodes into two parts, different network partitions are divided, and the placement of microservices is finally determined. In the division of working nodes, the number of physical links and communication costs between working nodes are considered, aiming to reduce the communication overhead between different network partitions. The algorithm divides the physical topology, and adds the consideration of link communication cost on the basis of processing the minimum division, requiring that the edge through which the division line passes has the minimum link communication cost. However, since the topological structure of the working node is a typical tree structure, the node set is often divided into a "single point-set" form in the process of dividing the working node using the algorithm. Therefore, in the division of the microservice topological structure, the resource utilization rate is also considered to ensure that the principle of balanced resource allocation will not be violated in the case of single-point deployment.
[0092] like Figure 5 As shown, a device for topology-aware microservice application scheduling in a cloud environment according to a specific implementation manner of the present invention is introduced.
[0093] In an embodiment of the present invention, the apparatus for topology-aware microservice application scheduling in a cloud environment includes a construction module 501 , a screening module 502 and a scheduling module 503 .
[0094] The construction module 501 is used to construct a multi-dimensional resource management model for the working nodes in the cluster according to the summary description information of the cluster.
[0095] The screening module 502 is used to perform pre-deployment on the working nodes according to the summary description information of the microservice application and the multi-dimensional resource management model, and screen the scheduling nodes according to the resource balancing conditions.
[0096] The scheduling module 503 is used to obtain the scheduling result of the microservice application according to the topological diagram of the microservice application and the scheduling node, and execute the scheduling task according to the scheduling result.
[0097] The construction module 501 is also used to: calculate the resource utilization rate of the working node, where the resources include at least two of the CPU, memory size, memory bandwidth and video memory; and construct a multidimensional resource management model based on the resource utilization rate, where the multidimensional resource management model is used to describe the resource utilization of the working node.
[0098] The screening module 502 is also used to: calculate the resource usage of the working node after the microservice application is deployed on the working node; and traverse the resource usage, and when the extreme difference of the resource usage exceeds the balance constraint, eliminate the corresponding working node.
[0099] The scheduling module 503 is also used to: determine whether the microservice application has completed scheduling; if so, execute the deployment task according to the result in the deployment queue; if not, filter out the working nodes to be scheduled, and perform topological segmentation on the working nodes to be scheduled and the microservice application to be scheduled.
[0100] The scheduling module 503 is also used to: determine whether the working node is the current best scheduling node; if so, deploy the microservice application to be scheduled on the working node and add the deployment task to the deployment queue; if not, perform topological segmentation on the working node to be scheduled and the microservice application to be scheduled.
[0101] The scheduling module 503 is also used to: divide the topological map of the working nodes to be scheduled into a first zone and a second zone, and minimize the communication overhead between the first zone and the second zone; and allocate the microservice applications to be scheduled to the first zone and the second zone according to the segmentation result of the topological map of the working nodes to be scheduled.
[0102] The scheduling module 503 is also used to: calculate the communication overhead and network bandwidth occupancy ratio of the microservice application to be scheduled and the scheduled microservice applications in different work node partitions; calculate the resource fragmentation rate of the microservice application to be scheduled in different work node partitions; and obtain scores based on the communication overhead, network bandwidth occupancy ratio and resource fragmentation rate, and allocate the microservice application to be scheduled to the partition with a high score.
[0103] The scheduling module 503 is also used to determine whether the scheduling of the working node and the microservice application is completely completed, and if so, execute the microservice application deployed on the working node.
[0104] Figure 6 FIG. 6 shows a hardware structure diagram of a computing device 60 for topology-aware microservice application scheduling in a cloud environment according to an embodiment of the present specification. Figure 6 As shown, the computing device 60 may include at least one processor 601, a memory 602 (e.g., a non-volatile memory), a memory 603, and a communication interface 604, and the at least one processor 601, the memory 602, the memory 603, and the communication interface 604 are connected together via a bus 605. The at least one processor 601 executes at least one computer-readable instruction stored or encoded in the memory 602.
[0105] It should be understood that the computer executable instructions stored in the memory 602, when executed, cause at least one processor 601 to perform the above combined operations in various embodiments of this specification. Figure 1-6 Describes the various operations and functions.
[0106] In the embodiments of the present specification, the computing device 60 may include, but is not limited to: a personal computer, a server computer, a workstation, a desktop computer, a laptop computer, a notebook computer, a mobile computing device, and the like.
[0107] According to one embodiment, a program product such as a machine-readable medium is provided. The machine-readable medium may have instructions (i.e., the above-mentioned elements implemented in the form of software), which, when executed by a machine, causes the machine to perform the above-mentioned combination of various embodiments of this specification. Figure 1-6 Specifically, a system or device equipped with a readable storage medium may be provided, on which a software program code implementing the functions of any of the above-mentioned embodiments is stored, and a computer or processor of the system or device reads and executes the instructions stored in the readable storage medium.
[0108] According to the method and application of topology-aware microservice application scheduling in a cloud environment in accordance with the implementation manner of the present invention, it is possible to construct a multidimensional resource management model of cluster working nodes based on the summary description of microservice applications and clusters, and apply it to the topology-aware microservice application scheduling strategy, and ultimately find suitable working nodes for all microservices in the microservice application for deployment; it is also possible to comprehensively consider all the microservices contained in the application from the overall perspective of the application when providing topology-aware microservice application scheduling, calculate the scheduling results based on the topological relationship of the microservice application and the cluster and the constraints of available resources, reduce the communication cost between microservice applications while ensuring the overall resource utilization of the cluster, and improve the service quality.
[0109] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0110] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0111] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0112] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0113] The foregoing description of specific exemplary embodiments of the present invention is for the purpose of illustration and demonstration. These descriptions are not intended to limit the present invention to the precise form disclosed, and it is clear that many changes and variations can be made based on the above teachings. The purpose of selecting and describing the exemplary embodiments is to explain the specific principles of the present invention and its practical application, so that those skilled in the art can realize and utilize various different exemplary embodiments of the present invention and various different selections and changes. The scope of the present invention is intended to be limited by the claims and their equivalents.
Claims
1. A method for topology-aware microservice application scheduling in a cloud environment, characterized in that: The method comprises: Build a multi-dimensional resource management model for the working nodes in the cluster based on the cluster's summary description information; Pre-deploy the working node according to the summary description information of the microservice application and the multi-dimensional resource management model, and select the scheduling node according to the resource balance condition, specifically including: after the microservice application is deployed on the working node, calculating the utilization rate of various resources of the working node; traversing the resource utilization rate, and when the extreme difference of the resource utilization rate exceeds the balance constraint, eliminating the corresponding working node; and Obtaining the scheduling result of the microservice application according to the topological graph of the microservice application and the scheduling node, and executing the scheduling task according to the scheduling result, including: judging whether the microservice application has completed the scheduling; if so, executing the deployment task according to the result in the deployment queue; if not, screening out the working nodes to be scheduled, and performing topological graph segmentation on the working nodes to be scheduled and the microservice application to be scheduled; The screening out of the to-be-scheduled working nodes and performing topological segmentation on the to-be-scheduled working nodes and the to-be-scheduled microservice applications includes: determining whether the working node is the current best scheduling node; if so, deploying the to-be-scheduled microservice application on the working node and adding the deployment task to the deployment queue; if not, performing topological segmentation on the to-be-scheduled working nodes and the to-be-scheduled microservice applications; Performing a topological map segmentation on the work node to be scheduled and the microservice application to be scheduled, including: segmenting the topological map of the work node to be scheduled into a first area and a second area, and minimizing the communication overhead between the first area and the second area; and allocating the microservice application to be scheduled to the first area and the second area according to the segmentation result of the topological map of the work node to be scheduled; According to the segmentation result of the topological map of the working node to be scheduled, the microservice application to be scheduled is allocated to the first zone and the second zone, including: calculating the communication overhead and network bandwidth occupancy ratio of the microservice application to be scheduled and the scheduled microservice applications in different working node partitions; calculating the resource fragmentation rate of the microservice application to be scheduled in different working node partitions; and obtaining a score according to the communication overhead, the network bandwidth occupancy ratio and the resource fragmentation rate, and allocating the microservice application to be scheduled to the partition with a high score.
2. The method for topology-aware microservice application scheduling in a cloud environment as claimed in claim 1, characterized in that: The step of constructing a multi-dimensional resource management model for working nodes in the cluster according to the summary description information of the cluster includes: Calculating resource usage of the working node, wherein the resources include at least two of CPU, memory size, memory bandwidth, and video memory; A multi-dimensional resource management model is constructed according to the resource utilization rate, wherein the multi-dimensional resource management model is used to describe the resource utilization of the working node.
3. The method for topology-aware microservice application scheduling in a cloud environment as claimed in claim 1, characterized in that: The method further comprises: Determine whether the scheduling of the working node and the microservice application is completely completed, if so, Execute the microservice application deployed on the working node.
4. A device for topology-aware microservice application scheduling in a cloud environment, characterized in that: The device comprises: A construction module, used to construct a multi-dimensional resource management model for working nodes in the cluster according to the summary description information of the cluster; A screening module is used to perform pre-deployment on the working node according to the summary description information of the microservice application and the multi-dimensional resource management model, and screen the scheduling node according to the resource balance condition, specifically including: after the microservice application is deployed on the working node, calculating the utilization rate of various resources of the working node; traversing the resource utilization rate, and when the extreme difference of the resource utilization rate exceeds the balance constraint, eliminating the corresponding working node; and The scheduling module is used to obtain the scheduling result of the microservice application according to the topological map of the microservice application and the scheduling node, and execute the scheduling task according to the scheduling result, including: judging whether the microservice application has completed the scheduling; if so, executing the deployment task according to the result in the deployment queue; if not, screening out the working nodes to be scheduled, and performing topological map segmentation on the working nodes to be scheduled and the microservice application to be scheduled; The screening out of the to-be-scheduled working nodes and performing topological segmentation on the to-be-scheduled working nodes and the to-be-scheduled microservice applications includes: determining whether the working node is the current best scheduling node; if so, deploying the to-be-scheduled microservice application on the working node and adding the deployment task to the deployment queue; if not, performing topological segmentation on the to-be-scheduled working nodes and the to-be-scheduled microservice applications; Performing a topological map segmentation on the work node to be scheduled and the microservice application to be scheduled, including: segmenting the topological map of the work node to be scheduled into a first area and a second area, and minimizing the communication overhead between the first area and the second area; and allocating the microservice application to be scheduled to the first area and the second area according to the segmentation result of the topological map of the work node to be scheduled; According to the segmentation result of the topological map of the working node to be scheduled, the microservice application to be scheduled is allocated to the first zone and the second zone, including: calculating the communication overhead and network bandwidth occupancy ratio of the microservice application to be scheduled and the scheduled microservice applications in different working node partitions; calculating the resource fragmentation rate of the microservice application to be scheduled in different working node partitions; and obtaining a score according to the communication overhead, the network bandwidth occupancy ratio and the resource fragmentation rate, and allocating the microservice application to be scheduled to the partition with a high score.
5. An electronic device, characterized in that: include: at least one processor; as well as A memory storing instructions, which, when executed by the at least one processor, causes the at least one processor to execute the method for topology-aware microservice application scheduling in a cloud environment as described in any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for topology-aware microservice application scheduling in a cloud environment as described in any one of claims 1 to 3 are implemented.
