Service configuration method and apparatus

By configuring services based on business affinity in a multi-core system, the problem of low data throughput caused by inconsistent memory access architecture is solved, and more efficient system throughput is achieved.

WO2026051415A1PCT designated stage Publication Date: 2026-03-12HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-05-13
Publication Date
2026-03-12

AI Technical Summary

Technical Problem

The problem of low data throughput in multi-core systems due to inconsistent memory access architecture, especially when the number of processor cores increases.

Method used

By acquiring historical interaction information between services, affinity relationships can be determined, and services with affinity can be configured to the same or nearest child node to reduce cross-child node service interaction latency and improve the overall system throughput.

Benefits of technology

Dynamically adjust service configurations to ensure services run on child nodes with affinity, reduce latency, and improve overall system throughput.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025094665_12032026_PF_FP_ABST
    Figure CN2025094665_12032026_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a service configuration method and apparatus. The method comprises: on the basis of affinity relationships between services, configuring a target service to a sub-node to which a service having an affinity relationship with the target service belongs or a sub-node of which the delay with the sub-node satisfies a condition, thereby effectively shortening service processing delay and improving system throughput.
Need to check novelty before this filing date? Find Prior Art

Description

Method and apparatus for service configuration

[0001] The present application claims priority to the Chinese patent application No. 202411246992.6, filed on September 5, 2024, and entitled "Method and apparatus for service configuration", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD

[0002] Embodiments of the present application relate to the field of information technology, and in particular to a method and apparatus for service configuration. BACKGROUND

[0003] With the development of computer technology, the number of processor cores in the processor of a computer is increasing. To avoid the problem of low data throughput caused by the multi-core shared memory solution, a Non-Uniform Memory Access (Numa) architecture is usually used in a multi-core system to improve system throughput. SUMMARY

[0004] The present application provides a method and apparatus for service configuration. In the method, services are configured based on affinity to reduce service processing latency and improve overall system throughput.

[0005] In a first aspect, the present application provides a method for service configuration, comprising: obtaining first affinity information based on historical interaction information between services, the first affinity information being used to indicate an affinity relationship between the services; determining whether there is an affinity service having affinity with a target service based on the first affinity information; and configuring the target service to a first target sub-node, wherein the first target sub-node comprises a first sub-node and / or a second sub-node, the first sub-node being a sub-node to which a first affinity service having affinity with the target service belongs, and the second sub-node being a sub-node between which and the first sub-node a delay satisfies a preset condition. In this way, the resources of the services are configured based on the affinity between the services, so that the services having affinity are configured to the same or the nearest sub-node, thereby reducing the service interaction delay caused by crossing sub-nodes and improving the overall system throughput.

[0006] For example, the preset condition can be that the delay (or latency) between the first sub-node is the smallest.

[0007] For example, the first affinity service can be one or more affinity services. The first sub-node can be one or more sub-nodes. The second sub-node can be one or more sub-nodes.

[0008] For example, the first target sub-node can be the first sub-node, the second sub-node, or a combination of the first sub-node and the second sub-node.

[0009] In a possible implementation, the method further includes: obtaining second affinity information based on historical interaction information between the target service and other services up to the current time. Based on the second affinity information, it is determined whether the affinity service having the affinity with the target service changes. If the affinity service having the affinity with the target service changes from the first affinity service to a second affinity service, the target service is configured to a second target subnode. The second target subnode includes a third subnode and / or a fourth subnode, where the third subnode is a subnode to which the second affinity service belongs, and the fourth subnode is a subnode that satisfies a preset condition with the third subnode in terms of delay. In this way, the affinity of a service can dynamically change during service execution, and the application can dynamically adjust the configuration of the service based on the updated affinity relationship, so that the service can always be in the same subnode with the service having the affinity relationship with it as the affinity relationship changes. Moreover, the affinity relationship is obtained as the service proceeds, and the obtained affinity is more accurate, which can further improve the throughput.

[0010] In a possible implementation, the method further includes: obtaining second affinity information based on historical interaction information between the target service and other services up to the current time. Based on the second affinity information, it is determined whether the affinity service having the affinity with the target service changes. If the affinity service having the affinity with the target service changes from the first affinity service to a second affinity service, the target service is configured to a second target subnode. The second target subnode includes a third subnode and / or a fourth subnode, where the third subnode is a subnode to which the second affinity service belongs, and the fourth subnode is a subnode that satisfies a preset condition with the third subnode in terms of delay. In this way, the affinity of a service can dynamically change during service execution, and the application can dynamically adjust the configuration of the service based on the updated affinity relationship, so that the service can always be in the same subnode with the service having the affinity relationship with it as the affinity relationship changes. Moreover, the affinity relationship is obtained as the service proceeds, and the obtained affinity is more accurate, which can further improve the throughput.

[0011] In a possible implementation, the first subnode and the second subnode belong to the same node, and resources in the node are allocated to the first subnode and the second subnode, and the resources include processor resources, memory resources, and device resources. In this way, the application targets the resource allocation object as the subnode in the Node, and can achieve more fine-grained resource allocation according to the affinity.

[0012] In a possible implementation, the node is a non-uniform memory access (NUMA) architecture, and the first subnode and the second subnode are NUMA nodes. In this way, the method provided by the application can be applied to a system of the NUMA architecture, such as a K8s system or other virtualization systems, which are not limited by the application.

[0013] In a possible implementation, the first affinity information further indicates an affinity degree between the services having the affinity relationship, and the affinity degree between the first affinity service and the target service is the highest. In this way, in the application, the higher the affinity degree, the more frequent the interaction between the services, and the services can be in the same subnode or close to the subnode to reduce the delay.

[0014] In a possible implementation, the first target sub-node is the first sub-node when the first sub-node meets the resource requirement of the target service; or the first target sub-node is a second sub-node and the second sub-node is one of the sub-nodes that meet the resource requirement of the target service and has a delay that meets a preset condition with the first sub-node when the first sub-node does not meet the resource requirement of the target service and there is a sub-node that meets the resource requirement of the target service in the node to which the first sub-node belongs; or the first target sub-node is a combination of the first sub-node and the second sub-node when none of the sub-nodes meets the resource requirement of the target service, and the resource of the combination of the first sub-node and the second sub-node meets the resource requirement of the target service. In this way, in the present application, the fewer the number of cross-node is, the better, which can reduce the frequency of remote access, reduce the delay, and improve the throughput. In addition, the affinity is given priority in selection, which can further reduce the delay and improve the throughput.

[0015] In a possible implementation, if there are multiple affinity services having affinity with the target service, and the multiple affinity services belong to different sub-nodes, the target service is configured to the first target sub-node, including: obtaining resource usage of each sub-node in multiple sub-nodes corresponding to the multiple affinity services; determining the first target sub-node from the sub-nodes that meet the resource requirement of the target service in the multiple sub-nodes based on the resource usage of each sub-node. In this way, in the case where there are multiple selectable sub-nodes, a corresponding sub-node can be selected according to different algorithms and resource states to meet different scene requirements.

[0016] In a possible implementation, the first target sub-node is the first sub-node when the first sub-node meets the resource requirement of the target service; or the first target sub-node is a second sub-node and the second sub-node is one of the sub-nodes that meet the resource requirement of the target service and has a delay that meets a preset condition with the first sub-node when the first sub-node does not meet the resource requirement of the target service and there is a sub-node that meets the resource requirement of the target service in the node to which the first sub-node belongs; or the first target sub-node is a combination of the first sub-node and the second sub-node when none of the sub-nodes meets the resource requirement of the target service, and the resource of the combination of the first sub-node and the second sub-node meets the resource requirement of the target service. In this way, in the present application, the fewer the number of cross-node is, the better, which can reduce the frequency of remote access, reduce the delay, and improve the throughput. In addition, the affinity is given priority in selection, which can further reduce the delay and improve the throughput.

[0017] In a second aspect, the present application provides a service configuration apparatus, comprising: an obtaining module, configured to obtain first affinity information based on historical interaction information between services, the first affinity information being used to indicate an affinity relationship between the services; a determining module, configured to determine whether there is an affinity service having an affinity with a target service based on the first affinity information; and a configuration module, configured to configure the target service to a first target sub-node, wherein the first target sub-node comprises a first sub-node and / or a second sub-node, the first sub-node being a sub-node to which a first affinity service having an affinity with the target service belongs, and the second sub-node being a sub-node between which and the first sub-node a delay satisfies a preset condition.

[0018] In a possible implementation, the obtaining module is further configured to obtain second affinity information based on historical interaction information between services up to the present; the determining module is further configured to determine whether an affinity service having an affinity with the target service changes based on the second affinity information; and the configuration module is further configured to configure the target service to a second target sub-node if the affinity service having an affinity with the target service changes from the first affinity service to a second affinity service, the second target sub-node comprising a third sub-node and / or a fourth sub-node, wherein the third sub-node is a sub-node to which the second affinity service belongs, and the fourth sub-node is a sub-node between which and the third sub-node a delay satisfies a preset condition.

[0019] In a possible implementation, the configuration module is specifically configured to modify a first configuration parameter of the target service to a second configuration parameter, wherein the first configuration parameter is used to indicate that the target service is deployed to the first target sub-node, and the second configuration parameter is used to indicate that the target service is deployed to the second target sub-node.

[0020] In a possible implementation, the first sub-node and the second sub-node belong to a same node, and resources in the node are allocated to the first sub-node and the second sub-node, the resources comprising processor resources, memory resources and device resources.

[0021] In a possible implementation, the node is a non-uniform memory access (NUMA) architecture, and the first sub-node and the second sub-node are NUMA nodes.

[0022] In a possible implementation, the first affinity information is further used to indicate an affinity degree between services having an affinity relationship, wherein the affinity degree between the first affinity service and the target service is the highest.

[0023] In a possible implementation, the first target sub-node is the first sub-node when the first sub-node meets the resource requirement of the target service; or the first target sub-node is a second sub-node and the second sub-node is one of the sub-nodes that meet the resource requirement of the target service and has a delay that meets a preset condition with the first sub-node when the first sub-node does not meet the resource requirement of the target service and there is a sub-node that meets the resource requirement of the target service in the node to which the first sub-node belongs; or the first target sub-node is a combination of the first sub-node and the second sub-node when no single sub-node meets the resource requirement of the target service, and the resource of the combination of the first sub-node and the second sub-node meets the resource requirement of the target service.

[0024] In a possible implementation, if there are multiple affinity services having affinity with the target service, and the multiple affinity services belong to different sub-nodes, the configuration module is specifically configured to: acquire resource usage of each sub-node in multiple sub-nodes corresponding to the multiple affinity services; and determine the first target sub-node from the sub-nodes that meet the resource requirement of the target service based on the resource usage of each sub-node.

[0025] In a possible implementation, the configuration module is specifically configured to: select, based on a binning algorithm, a sub-node with the smallest serial number from the sub-nodes that meet the resource requirement of the target service as the first target sub-node; or select, based on a load balancing algorithm, a sub-node with the smallest load from the sub-nodes that meet the resource requirement of the target service as the first target sub-node; or determine, based on the resource requirement of the target service, whether the resource requirement of the target service is greater than a preset resource threshold; if the resource requirement of the target service is greater than the preset resource threshold, determine the first target sub-node based on the load balancing algorithm; and if the resource requirement of the target service is less than or equal to the preset resource threshold, determine the first target sub-node based on the binning algorithm.

[0026] In a third aspect, the present application provides a service configuration method, which includes: determining a first sub-node set based on a resource requirement of a target service, the first sub-node set including multiple candidate sub-nodes, the candidate sub-node being a single sub-node or a combination of multiple sub-nodes; wherein each candidate sub-node meets the resource requirement of the target service; determining a target sub-node from the first sub-node set based on a preset algorithm; and configuring the target service to the target sub-node.

[0027] In a possible implementation, if the candidate sub-node is a combination of multiple sub-nodes, the determining, based on the preset algorithm, of the first target sub-node from the first sub-node set comprises: determining a second sub-node set from the first sub-node set, wherein one or more candidate sub-nodes in the second sub-node set are candidate sub-nodes with minimum delay in the first sub-node set; and selecting the target sub-node from the second sub-node set based on the preset algorithm.

[0028] In a possible implementation, the preset algorithm comprises: a bin packing algorithm, which indicates that a candidate sub-node with a minimum sequence number in the first sub-node set is the target sub-node; or a load balancing algorithm, which indicates that a candidate sub-node with minimum load in the first sub-node set is the target sub-node; or a task aggregation algorithm, which indicates that if the resource requirement of the target service is greater than a preset resource threshold, the target sub-node is determined based on the load balancing algorithm; and if the resource requirement of the target service is less than or equal to the preset resource threshold, the target sub-node is determined based on the bin packing algorithm.

[0029] In a fourth aspect, the present application provides a service configuration apparatus, which comprises: a determining module configured to determine a first sub-node set based on a resource requirement of a target service, the first sub-node set comprising multiple candidate sub-nodes, each candidate sub-node being a single sub-node or a combination of multiple sub-nodes, and each candidate sub-node satisfying the resource requirement of the target service; the determining module is further configured to determine a target sub-node from the first sub-node set based on a preset algorithm; and a configuration module configured to configure the target service to the target sub-node.

[0030] In a possible implementation, if the candidate sub-node is a combination of multiple sub-nodes, the determining module is further configured to: determine a second sub-node set from the first sub-node set, wherein one or more candidate sub-nodes in the second sub-node set are candidate sub-nodes with minimum delay in the first sub-node set; and select the target sub-node from the second sub-node set based on the preset algorithm.

[0031] In a possible implementation, the preset algorithm comprises: a bin packing algorithm, which indicates that a candidate sub-node with a minimum sequence number in the first sub-node set is the target sub-node; or a load balancing algorithm, which indicates that a candidate sub-node with minimum load in the first sub-node set is the target sub-node; or a task aggregation algorithm, which indicates that if the resource requirement of the target service is greater than a preset resource threshold, the target sub-node is determined based on the load balancing algorithm; and if the resource requirement of the target service is less than or equal to the preset resource threshold, the target sub-node is determined based on the bin packing algorithm.

[0032] In a fifth aspect, an embodiment of the present application provides a computer device, comprising: a transceiver / transceiver pin and a processor, and optionally further comprising a memory. The transceiver / transceiver pin, the processor and the memory are in communication with each other through internal connection paths; the processor is configured to execute instructions to control the transceiver / transceiver pin to send or receive signals; and the memory is configured to store the instructions. When the processor executes the instructions, the processor executes the method in the first aspect or any possible implementation manner of the first aspect.

[0033] In a sixth aspect, an embodiment of the present application provides a computer readable medium for storing a computer program, the computer program comprising instructions for executing the method in the first aspect or any possible implementation manner of the first aspect.

[0034] In a seventh aspect, an embodiment of the present application provides a computer program comprising instructions for executing the method in the first aspect or any possible implementation manner of the first aspect.

[0035] In an eighth aspect, an embodiment of the present application provides a chip, comprising a processing circuit and a transceiver pin. The transceiver pin and the processing circuit are in communication with each other through internal connection paths, and the processing circuit executes the method in the first aspect or any possible implementation manner of the first aspect to control the receiving pin to receive signals and to control the sending pin to send signals.

[0036] In a ninth aspect, an embodiment of the present application provides a service configuration apparatus, comprising a processor and a memory. The memory stores a computer program, and when the computer program is executed by the processor, the service configuration apparatus executes the method in the first aspect or any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF DRAWINGS

[0037] FIG. 1 is a system architecture diagram of Kubernetes, which is illustratively shown;

[0038] FIG. 2a is an architecture diagram of a node, which is illustratively shown;

[0039] FIG. 2b is an architecture diagram of a node, which is illustratively shown;

[0040] FIG. 3 is a Numa Node access diagram, which is illustratively shown;

[0041] FIG. 4 is a flow diagram of a service configuration method, which is illustratively shown;

[0042] FIG. 5 is a flow diagram of a service configuration, which is illustratively shown;

[0043] FIG. 6 is an affinity relationship deployment diagram, which is illustratively shown;

[0044] FIG. 7 is a flow diagram illustrating an example of dynamically adjusting configuration information of a service;

[0045] FIG. 8 is a diagram illustrating an example of affinity relationship deployment;

[0046] FIG. 9 is a flow diagram illustrating an example of a preset algorithm;

[0047] FIG. 10 is a structural diagram illustrating an example of an apparatus;

[0048] FIG. 11 is a structural diagram illustrating an example of an apparatus. DETAILED DESCRIPTION

[0049] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application.

[0050] First, the technical terms and systems that may be involved in the present application will be briefly described:

[0051] 1) Kubernetes, referred to as K8s.

[0052] Kubernetes is a portable, extensible, open source platform for managing containerized workloads and services. Kubernetes has a large and rapidly growing ecosystem, and its services, support and tools are used quite widely.

[0053] FIG. 1 is a system architecture diagram of Kubernetes, which is an example. Referring to FIG. 1, the system includes but is not limited to an application programming interface service (API Server), a node (Node), and the like.

[0054] The API Sever is configured to provide functions such as authorization, authentication, access control, API registration, and the like.

[0055] The Node is configured to provide hardware and software resources to run services. In the embodiments of the present application, the system can include at least one Node, for example, Node 1 to Node n, which can be set according to actual needs, and the present application is not limited thereto.

[0056] In the embodiments of the present application, the system described in FIG. 1 can be deployed in a computer cluster or a server cluster. Taking a server cluster as an example, the server cluster includes one or more servers. Each Node is optionally a server, or a motherboard in a server. Usually, a server includes a motherboard.

[0057] Optionally, in some instances, multiple servers can be integrated into one rack, forming a large server. In this scenario, each server (or motherboard) can be a Node, i.e., the large server includes multiple Nodes. It can be understood that, at the physical level, the Node can be divided into a motherboard as the minimum granularity.

[0058] 2) Node

[0059] FIG. 2a is an exemplary architecture diagram of a Node, which can be used to describe any one Node (e.g., Node 1) in the scenario of FIG. 1. Referring to FIG. 2a, the resources in the Node can be classified into hardware (which can also be referred to as hardware resources) and software (which can also be referred to as software resources).

[0060] For example, the hardware resources of a Node include, but are not limited to, a processor, a memory, a device, and the like. The device resources include, but are not limited to, a network card and the like.

[0061] For example, the processor is the operation core and control core of the Node. The processor includes one or more processor cores. The processor can be a central processing unit (CPU), or an application specific integrated circuit (ASIC). The processor can also be other general-purpose processors, digital signal processors (DSPs), field programmable gate arrays (FPGAs), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, and the like. In actual applications, a Node includes only one processor, or can include multiple processors.

[0062] The processor is connected to the memory through a double data rate (DDR) bus. Here, different memories can use different data buses to communicate with the processor, so the DDR bus can be replaced by other types of data buses, and the embodiments of the present application do not limit the type of bus.

[0063] The memory is the main memory of the Node. The memory is usually used to store various running software, input and output data and the like in the operating system. In order to improve the access speed of the processor, the memory needs to have the advantage of fast access speed. In the traditional computer system architecture, dynamic random access memory (DRAM) is usually used as the memory. In addition to DRAM, the memory is also other random access memories, such as static random access memory (SRAM) and the like. In addition, the memory can also be a read only memory (ROM). For the read only memory, for example, it can be a programmable read only memory (PROM), an erasable programmable read only memory (EPROM) and the like. The number and type of the memory are not limited in the embodiment. In addition, the memory can be configured to have a power retention function. The power retention function refers to that after the system is powered off and then powered on again, the data stored in the memory will not be lost. The memory with the power retention function is called a non-volatile memory.

[0064] Still referring to FIG. 2a, the software architecture of a Node can be layered, for example, including an operating system and an application layer (only for illustrative example, more or less layers can be included, which are not limited in the present application).

[0065] Illustratively, the application layer can include but is not limited to: Kubelet, Container Runtime, Resource-aware operator and POD and the like.

[0066] Illustratively, the Kubelet is a core component running in each node in the Kubernetes cluster, responsible for managing the node (Node). Optionally, the Kubelet can include but is not limited to: a topology management module (Topology Manager), a device management module (Device Manager), a central processing unit management module (CPU Manager) and the like.

[0067] Among them, the Topology Manager is used to call various modules in the Node. The "call" described in the embodiment of the present application can be understood as interacting with the corresponding module through the interface between each module (the interface type provided by each module can be the same or different), and the data or control signal (or control information, control signaling, etc.).

[0068] Device Manager, configured to provide a device management policy, and manage device resources corresponding to each POD according to the device management policy.

[0069] CPU Manager, configured to provide a CPU management policy, and manage processor resources corresponding to each POD according to the CPU management policy.

[0070] Container Runtime, configured to respond to lifecycle events of runtime PODs and containers. Optionally, the Container Runtime includes, but is not limited to, a container engine (also referred to as a container runtime interface (CRI) module) and a non-uniform memory access runtime interface plugin (NRI Plugin). It should be noted that the module names and quantities involved in the embodiments of the present application are only illustrative examples, and the present application is not limited.

[0071] The container engine is configured to provide a CRI interface to interact with Kubelet (specifically, Topology Manager) in data or instructions. The interaction data or instructions between the container engine and Kubelet conforms to the format rules of CRI. Of course, the interface types in the embodiments of the present application are only illustrative examples, and other types can be used in other systems (for example, virtualization scenarios), and the present application is not limited.

[0072] NRI Plugin, used to determine the configuration parameters of the POD and has the right to modify the configuration parameters of the POD. In the embodiments of the present application, the configuration parameters are optionally saved and transmitted in the form of a specification (spec) file. The NRI Plugin can read the Spec file of each POD in the node and modify the configuration parameters in the file. The configuration parameters include, but are not limited to, at least one of the following: processor configuration parameters, device configuration parameters, memory configuration parameters, etc. corresponding to the POD. The NRI Plugin can modify any one parameter corresponding to the POD when creating the POD or when the POD is running, to change the hardware resource configuration of the POD, which can also be understood as changing the Numa Node corresponding to the POD, thereby achieving dynamic adjustment of the configuration parameters of the POD. The specific implementation will be described in detail below. It needs to be explained that, as described above, the Numa Node is associated with the hardware resource, therefore, in the embodiments of the present application, the modification of the configuration parameters of the POD can be understood as the modification of the hardware resource corresponding to the POD, and can also be understood as the modification of the Numa Node corresponding to the POD. For example, as shown in FIG. 2, the hardware resource corresponding to Numa Node0 includes Core-0~Core-3, and the hardware resource corresponding to Numa Node1 includes Core-4~Core-7. Assuming that POD1 is configured to Numa Node0 when created, and the configuration parameters corresponding to POD1 indicate that the hardware resource corresponding to POD1 includes Core-0 and Core-1, etc. When POD1 is running, the NRI Plugin can modify the configuration parameters of POD1, so that the modified configuration parameters indicate that the hardware resource corresponding to POD1 is updated to Core-5 and Core-6. Correspondingly, in this example, POD1 is migrated from Numa Node0 to Numa Node1. It can be understood that the configuration of the POD from one Numa Node to another Numa Node in the embodiments of the present application is equivalent to the update of the hardware resource of the POD, which will not be repeated below.

[0073] The resource-aware operator is configured to obtain historical interaction information of the PODs, and obtain affinity information of the PODs based on the historical interaction information of the PODs. The affinity information is used to indicate the affinity relationship between the PODs. Optionally, the historical interaction information can include, but is not limited to, process ID (PID), thread ID (TID), CPU, memory virtual address (VA), memory physical address (PA), and inter-process socket interaction information, and the like. In the embodiment of the present application, the resource-aware operator can obtain the historical interaction information from the kernel in real time or periodically. The resource-aware operator performs an affinity information updating process each time the historical interaction information is obtained. Specifically, the resource-aware operator can be pre-configured with an affinity model. The resource-aware operator inputs the historical interaction information into the affinity model, and obtains the affinity relationship output by the affinity model. The affinity relationship can be understood as the interaction relationship of each POD when accessing a memory page (also referred to as a memory address or a memory space). It can be understood that the more frequent the interaction between the threads corresponding to different PODs, the higher the affinity of the corresponding PODs. Optionally, the affinity model can be obtained by online or offline training, which can obtain the affinity relationship between different PODs based on the input historical information, and output the affinity relationship information.

[0074] Optionally, the resource-aware operator can be provided with an affinity information list (only a list is exemplified, and the present application is not limited), as shown in Table 1:

[0075] Table 1

[0076] As shown in Table 1, the Resource-aware operator can record the identification information (for example, which can be a POD Name) of the POD, the hardware resource information (including processor, memory, device, etc.) currently belonging to the POD, and the corresponding relationship between the identification information of at least one POD having an affinity relationship with the POD. Among them, as described above, the hardware resource information can be equivalent to the Numa Node, that is, the affinity relationship information recorded by the Resource-aware operator can also be understood as the corresponding relationship among the POD, the Numa Node, and the affinity POD. Among them, the affinity POD is the POD having an affinity relationship with the POD as an index in the table item.

[0077] Optionally, the affinity POD of each POD can include one or more, which is not limited in the present application.

[0078] Optionally, in some instances, the affinity relationship can also record the degree of affinity relationship (which can also be referred to as affinity degree) of the affinity POD. Among them, the higher the degree, the higher the affinity, and vice versa.

[0079] In a possible implementation, the degree of affinity relationship can be determined based on the interaction frequency in the historical interaction information, which can be set according to actual needs, which is not limited in the present application.

[0080] 3) Numa architecture

[0081] Numa architecture, that is, non-uniform memory architecture, is a computer architecture. Each node (Node) in the embodiment of the present application is a Numa architecture. The architecture allows multiple processor cores to access physical memory through shared memory. Optionally, different memory regions can be processed by different processor cores, and this kind of memory access method is non-uniform memory access.

[0082] In the Kubernetes system, the hardware resources of a Node can be integrated into multiple Numa Nodes (that is, the sub-nodes described in the embodiment of the present application), which can also be understood as a Numa Node being configured with processor resources, memory resources, device resources, etc. It can also be understood that the Numa Node is a set of processor core resources, memory resources, and device resources.

[0083] Figure 2b is a schematic diagram of an exemplary Numa Node structure. Referring to Figure 2b, a single processor is included in the Node, and the processor includes multiple processor cores (may also be referred to as processing units, or simply cores, which are not limited in the present application). Assume that the processor includes 64 cores. In the chip design stage, the designer divides the 64 cores, and divides each group of 4 cores into the same Numa Node. Alternatively, the configuration method in the embodiments of the present application can be applied to a cluster of one or more servers, and can be applied to a server (or computer device, etc.) including one or more processors, which are not limited in the present application.

[0084] Alternatively, the hardware resources (including processor resources, memory resources, and device resources) configured by each Numa Node are not the same. For example, as shown in Figure 2b, Numa Node0 is configured with Core-0~Core-3, and other memory and device resources (not shown in the figure). Numa Node1 is configured with Core-4~Core-7, and other memory and device resources (not shown in the figure).

[0085] It should be noted that the number of Numa Nodes and the resource allocation involved in the embodiments of the present application are exemplary, and can be set according to actual needs, which are not limited in the present application.

[0086] For example, the designer designs the internal circuit and external circuit of each Numa Node according to the division result of the Numa Node. For example, the internal circuit of the Numa Node can include but is not limited to the connection circuit between the processor and the memory. Alternatively, the cores on one Numa Node can quickly access the local memory of the Numa Node through the on-chip bus. For example, the external circuit of the Numa Node can include but is not limited to the high-speed interconnection network connection between the Numa Nodes. For example, Numa Node0 is connected with Numa Node1~Numa Node n respectively.

[0087] It should be understood that the number of Numa Nodes and the number of processor cores included in each Numa Node involved in the present application are only exemplary, which are not limited in the present application.

[0088] 4) Numa Node local access and remote access.

[0089] FIG. 3 is a schematic diagram of Numa Node access, as shown in FIG. 3, a Numa Node corresponds to local memory, and the processor core in the Numa Node can quickly access the local memory in the Numa Node through the on-chip bus, which can be referred to as local access or local memory access. For example, the processor core (including Core-0~Core-3) in FIG. 3 can quickly access the local memory in Node Node0 through the on-chip bus.

[0090] For example, the Numa Node can also access the memory of other Numa Nodes through the high-speed interconnection network. This access method can be referred to as remote access or remote memory access. For example, as shown in FIG. 3, the processor core in Numa Node0 can access the memory in Numa Node1 through the high-speed interconnection network connection.

[0091] The access between the modules or devices described in the embodiments of the present application can include but is not limited to query, delete, add, etc., which is not limited by the present application.

[0092] It can be understood that the high-speed interconnection network connection is a kind of public bus, if a plurality of Numa Nodes access the memory of a Numa Node through the high-speed interconnection network connection, there can be bandwidth competition between different Numa Nodes, resulting in large delay. And based on different circuit types, the data transmission delay on the high-speed interconnection network connection is greater than the data transmission delay of the on-chip bus. That is, the speed of local memory access is faster than that of remote memory access, and the delay is smaller. For example, if the POD is deployed in two or more Numa Nodes, during the execution of the service, the data A of the service can be saved in the local memory of Numa Node0, and the data B can be saved in the local memory of Numa Node1. When Numa Node1 runs the thread 1 corresponding to the POD, if data A needs to be read, it can be accessed through the local memory to obtain data A. If data B needs to be read, it needs to be accessed remotely to obtain data B from the local memory of Numa Node1.

[0093] Therefore, in the embodiment of the present application, when the POD is laid out, the POD is preferentially deployed on the same Numa Node, so that the business of the POD can call the processor in the Numa Node to access the local memory at runtime, thereby speeding up the business process of the POD. When the POD needs to be deployed across Numa Nodes, the condition considered for deployment is that the number of crossed Numa Nodes is the least preferred solution. For example, if the current system is heavy and a single Numa Node cannot meet the resource requirements of the POD, the resources of multiple Numa Nodes can be integrated together to meet the running requirements of the POD. In this scenario, if the resources of 2 Numa Nodes integrated together can meet the running requirements of the POD,

[0094] The business configuration method in the embodiment of the present application can be applied to the K8s system and can also be applied to other virtualization system architectures. The implementation manners can all refer to the flow of the present application, and the present application is only described by taking the K8s system as an example, and other scenarios are not described one by one.

[0095] FIG. 4 is a flowchart of an exemplary business configuration method. Please refer to FIG. 4, which specifically includes but is not limited to the following steps:

[0096] S401, obtaining first affinity information based on historical interaction information between businesses, the first affinity information being used to indicate the affinity relationship between the businesses.

[0097] For example, the system (which can also be referred to as a business configuration apparatus, etc., which is not limited in the present application) obtains the historical interaction information between the businesses from the operating system. Optionally, the historical interaction information can include but is not limited to PID, TID, CPU, VA, PA, and inter-process socket interaction information, etc.

[0098] In one possible implementation manner, the system can obtain the historical interaction information from the kernel (i.e., the operating system) in real time, or can periodically obtain the historical interaction information, which is not limited in the present application.

[0099] In one example, the historical interaction information obtained by the system can be all historical interaction information from the system initialization to the present.

[0100] In another example, the historical interaction information obtained by the system can be all historical interaction information in the current period (i.e., from the start of the period to the present).

[0101] Exemplarily, the system can acquire corresponding affinity information based on the acquired historical interaction information (since subsequent affinity information will be updated, the acquired affinity information can be referred to as first affinity information). The affinity information is used to indicate the affinity relationship between services, and can also be understood as the affinity relationship between services up to the current moment.

[0102] In the embodiments of the present application, in the K8s system, a service can be understood as a POD in K8s. One POD executes one service, and one service (i.e., a POD) can run multiple processes or threads. The service can also be an application service or a data service, which is not limited in the present application.

[0103] Exemplarily, after the system acquires the historical interaction information, the system can calculate the access behavior of each service to at least one memory page (also referred to as a memory address or a memory space) in the node based on an affinity model, so as to count the interaction relationship between each thread. Based on the interaction relationship between each thread, the affinity relationship between the service corresponding to each thread and other services is acquired. It can be understood that the more frequent the interaction between the threads corresponding to different services is, the higher the affinity of the corresponding services is.

[0104] S402, determining whether there is an affinity service having affinity with the target service based on the first affinity information.

[0105] Exemplarily, after the system acquires the first affinity information, the system can further determine whether there is an affinity service having affinity with the target service.

[0106] In the embodiments of the present application, the system can maintain (i.e., record or save) an affinity information relationship table (only in the form of a list, which can be in other forms, and the present application is not limited thereto). The affinity relationship table can include but is not limited to the corresponding relationship of services, affinity services and Numa Nodes. Among them, the service refers to all services in the node, including historical services and services running. The historical service refers to a service that has been created and run in the node and has been deleted. The relationship table can include the identification information corresponding to the service. Each service corresponds to a table item (also referred to as an affinity relationship table item), and the identification information of the service can be used as the index of the table item. Optionally, the affinity service is optionally a service having an affinity relationship with the service as the index of the table item.

[0107] Optionally, the service having an affinity relationship with a single service can be one or more. The system can be provided with a preset condition (or a preset algorithm) to select one service having the highest affinity relationship with the service from multiple services having an affinity relationship (for example, the first affinity service described in the embodiments of the present application, which can also be referred to as the first affinity service).

[0108] Optionally, the service indicated by the affinity relationship in the affinity relationship table (see Table 1) can be the service with the closest affinity relationship to the corresponding service. Of course, in some instances, all services with an affinity relationship to the corresponding service can also be recorded, and the degree of the corresponding affinity relationship is recorded. The higher the degree, the higher the affinity, and vice versa.

[0109] In a possible implementation, the degree of the affinity relationship can be determined based on the interaction frequency in the historical interaction information, which can be set according to actual needs, and is not limited in the present application.

[0110] In one example, if there is at least one affinity service with an affinity relationship to the target service, S403 is executed.

[0111] In another example, if there is no affinity service with an affinity relationship to the target service, the user can be requested to manually set the affinity service of the target service, and S403 is executed. Alternatively, the system can also allocate a child node that meets the resource requirement of the target service to the target service according to the resource requirement of the target service, and dynamically adjust the child node of the target service in real time or periodically during the running of the target service.

[0112] S403, the target service is configured to the target child node.

[0113] For example, if the system obtains the first affinity service corresponding to the target service, the system can configure the target service to the target child node. The target child node includes the first child node and / or the second child node. The first child node is a child node to which the first affinity service belongs, and the second child node is a child node that satisfies a preset condition with the first child node. The preset condition is optionally the minimum time delay (or delay) between the first child node.

[0114] In the embodiment of the present application, the first affinity service can be one or more affinity services, and correspondingly, the first child node can optionally include one or more child nodes. Specifically, if there are multiple affinity services with an affinity relationship to the target service in the system, i.e., an affinity service set is formed. The system can select the corresponding first child node (which can be one or more) based on the resource requirement of the target service, the degree of the affinity of the affinity service, and the resource usage of the child node corresponding to the affinity service (which can be recorded as the alternative child node) and the Distance between the alternative child nodes. The Distance is used to indicate the time delay between the child nodes.

[0115] ​Specifically, the system can obtain the affinity service and the corresponding affinity degree, the resource usage of the candidate sub-node (also referred to as a backup sub-node or an available sub-node, which is not limited in the present application) corresponding to each affinity service, and the Distance of each candidate sub-node. The system can select a first sub-node that meets the resource requirement of the target service from the candidate sub-nodes according to a preset condition algorithm and a preset condition.

[0116] Optionally, the preset algorithm can optionally calculate the weight between the affinity degree of the affinity service and the Distance of the sub-node, and determine the first sub-node based on the weight value.

[0117] Optionally, the preset condition includes but is not limited to at least one of the following:

[0118] 1) At least one sub-node in the sub-node meets the affinity relationship.

[0119] 2) The remaining resources of the sub-node can meet the demand of the target service.

[0120] 2) The smaller the number of sub-nodes is, the better. For example, in a K8s system, the sub-node involved in the embodiments of the present application can be a Numa Node. If the combination of Numa Node0 and Numa Node1 (for example, the Numa Node is the first Numa Node) can meet the service requirement of the target service, Numa Node1, Numa Node2 and Numa Node3 can also meet the service requirement of the target service, the system selects the combination of Numa Node0 and Numa Node1 as the target Numa Node of the target service.

[0121] For example, the businesses having the affinity relationship with the target business include affinity business 1, affinity business 2, affinity business 3, and the like, and the degrees of the affinity relationship are affinity business 1, affinity business 2, and affinity business 3 from high to low, and the affinity businesses belong to different Numa Nodes. In one example, if the available resources (i.e., the remaining resources) of the Numa Node corresponding to the affinity business 1 do not meet the demand of the target business, and the Numa Node to which the affinity business 2 belongs meets the demand of the target business, the affinity business 2 is the first affinity business in the embodiment of the present application, and the Numa Node corresponding to the affinity business 2 is the first Numa Node. In another example, if the Numa Node corresponding to the affinity business 1 does not meet the demand of the target business, and the combination of the Numa Node to which the affinity business 2 belongs and the Numa Node to which the affinity business 1 belongs can meet the demand of the target business, the affinity business 1 and the affinity business 2 are the first affinity business (i.e., the first affinity business includes multiple businesses), and the combination of the corresponding Numa Nodes is the first Numa Node. It can be understood that the affinity between the target business and the affinity business 1 is higher, that is, the process interaction between the target business and the affinity business 1 is more frequent during the running of the business, and if the target business is deployed into another Numa Node, the Numa Node to which the target business belongs will frequently access the Numa Node to which the affinity business 1 belongs through remote access, which will increase the business processing delay. However, deploying the Numa Node into the combination of the Numa Nodes including the Numa Node to which the affinity business 1 belongs, although the scheme is implemented across the Numa Nodes, the delay can be less than that of directly deploying into another Numa Node. Of course, in this example, the system can also prefer the condition of the minimum number of Numa Nodes when creating the target business, and the system can dynamically adjust the deployment of the Numa Node of the target business according to the increase of the degree of the affinity between the target business and the affinity business 1 during the running of the target business.

[0122] In one possible implementation, if the sub-node to which the affinity business exists in the system and has the affinity with the target business does not meet the resource demand of the target business. In the embodiment of the present application, the system can select one or more sub-nodes (i.e., the second sub-node, wherein the second sub-node also follows the condition that the fewer the better) from other sub-nodes in the system as the target sub-node. Alternatively, one or more sub-nodes can also be selected in combination with the sub-node to which the affinity business belongs as the target sub-node and configured to the target business.

[0123] In the embodiments of the present application, the system can allocate all or part of the resources (including processors, memories, devices, etc.) corresponding to the first sub-node to the target service based on the resource requirement of the target service. For example, the system can obtain the first affinity service corresponding to the target service during the creation or running of the target service, and allocate all or part of the resources corresponding to the first sub-node to the target service by updating the configuration parameters of the target service, that is, by updating the configuration parameters of the target service to configure the target service to the first sub-node.

[0124] Optionally, the configuration parameters corresponding to each service can be stored in the database of the system. The configuration parameters include but are not limited to at least one of the following: processor configuration parameters (also referred to as processor core configuration parameters), memory configuration parameters, and device configuration parameters, etc. For example, the system queries that the sub-node to which the first affinity service corresponding to the target service belongs is Numa Node0 (i.e. the first sub-node). Numa Node0 includes Core-0~Core-9. The resource requirement of the target service is 4 Cores (only the processor resource is taken as an example for illustration), that is, the target service needs to be supported by 4 Cores during running. For example, the system allocates Core-0~Core-3 (which refers to idle Cores) of Numa Node0 to the target service, and updates the configuration parameters of the target service accordingly, wherein the processor configuration parameters are updated to Core-0~Core-3 to indicate that Core-0~Core-3 are configured to the target service, that is, the target service is configured to Core-0~Core-3. In this way, during the running of the target service, Core-0~Core-3 will run the processes or threads corresponding to the target service.

[0125] For example, the system can query the configuration parameters corresponding to the first affinity service from the database, and the configuration parameters are also used to indicate the hardware resources corresponding to the first affinity service. The system can determine the corresponding sub-node based on the hardware resources. For example, if the hardware resource corresponding to the first affinity service is Core-7, then the corresponding Numa Node is Numa Node0.

[0126] In a possible implementation, the first affinity service can refer to one affinity service or multiple affinity services. That is, the system can obtain at least one affinity service corresponding to the target service. Specifically, the system can determine the number of sub-nodes required by the target service according to the resource usage (which can also be understood as the resource remaining condition) of the sub-node and the service requirement (which can also be understood as the resource requirement) of the target service.

[0127] The service configuration method shown in FIG. 4 in the embodiments of the present application can be applied to a service creation scenario, so that the service can be configured based on affinity when the service is created. In addition, the service configuration method can also be applied to a service running scenario, to provide a dynamic adjustment configuration manner, which can dynamically adjust the configuration of the service according to the change of the affinity of the service. In the two scenarios, the service configuration apparatus can determine the corresponding affinity relationship based on the obtained historical information, and configure the corresponding sub-node for the target service based on the affinity relationship. The method in FIG. 4 will be described in detail below in combination with the service creation scenario and the dynamic adjustment scenario.

[0128] FIG. 5 is a flow diagram of an example service configuration. The method in FIG. 4 will be described in detail below in combination with an embodiment in a K8s scenario of FIG. 5. Please refer to FIG. 5, which specifically includes but is not limited to the following steps:

[0129] S501, the Topology Manager obtains a creation task of POD-1.

[0130] For example, the API Sever obtains the creation task of POD-1 in response to the received user instruction, which includes but is not limited to the resource requirement of POD-1 and the identification information of POD-1.

[0131] For example, the resource requirement of POD-1 includes but is not limited to at least one of the following: processor resource requirement, memory (Mem) resource requirement, and device resource requirement. In the embodiments of the present application, only the processor resource requirement and the memory resource requirement are taken as examples for description, and the number and type of the resource requirement of the service (i.e., POD) are not limited, which are illustrative.

[0132] For example, the identification information of POD-1 can be specified by the user or generated by the API Sever, which is not limited in the present application. Optionally, the identification information of POD-1 can be the name of POD-1, which is denoted as POD-1 in the embodiments of the present application.

[0133] The API Sever selects a Node from the system (the selection manner can refer to the prior art, which is not limited in the present application), and sends a POD creation instruction information to the Kubelet in the Node, to instruct to create POD-1. The POD creation instruction information includes but is not limited to the creation task of POD-1, i.e., includes but is not limited to the resource requirement of POD-1 and the identification information of POD-1.

[0134] The Topology Manager in the Kubelet obtains the creation task of the corresponding POD-1 in response to the received POD creation instruction information.

[0135] S502, the Topology Manager sends a POD creation instruction to the container engine.

[0136] Illustratively, after the Topology Manager obtains the creation task of the POD-1, the Topology Manager performs the task creation process of the POD-1. Specifically, the Topology Manager sends a POD creation instruction to the Container Runtime, and the POD creation instruction is used to instruct to create the POD-1. The POD creation instruction includes but is not limited to the resource requirement of the POD-1 and the identification information of the POD-1.

[0137] The container engine receives the POD creation instruction.

[0138] S503, the container engine sends a Spec file to the NRI Plugin.

[0139] Illustratively, the container engine detects whether the NRI Plugin is installed in the system in response to the received POD creation instruction. Optionally, after the NRI Plugin is installed in the system, the NRI Plugin is registered on the side of the container engine, and the container engine can obtain the interface and other information provided by the NRI Plugin. In use, the container engine can find the registration information to determine whether the NRI Plugin is installed and registered. In the case of detecting the NRI Plugin, the subsequent process is continued.

[0140] Illustratively, the container engine indicates the Spec file to the NRI Plugin, which can also be referred to as the Spec file of the POD-1. Optionally, the container engine can indicate the Spec file to the NRI Plugin in the following manner: the container engine caches the Spec file of the POD-1 in the database. The Spec file of the POD-1 includes the configuration information (or can be referred to as the configuration parameter) of the POD-1, and the configuration information includes but is not limited to the processor configuration parameter, the memory configuration parameter, the device configuration parameter, etc. Then, the container engine can send the Spec file indication information to the NRI Plugin, which is used to instruct the NRI Plugin to obtain the Spec file of the POD-1 from the database.

[0141] Optionally, the configuration information in the Spec file of the POD-1 indicated by the container engine to the NRI Plugin can be all or part of null, or be a default value, which is not limited by the present application.

[0142] S504, the NRI Plugin requests affinity information from the Resource-aware Operator (hereinafter referred to as the Operator).

[0143] For example, the NRI Plugin sends an affinity information request message to the Operator in response to the acquired Spec file of the POD-1, to request the affinity information of the POD-1 from the Operator, the affinity information request message including but not limited to the identification information of the POD-1.

[0144] S505, the Resource-aware Operator acquires the first affinity information based on the historical interaction information.

[0145] For example, the Operator can acquire the first affinity information based on the historical interaction information after acquiring the historical interaction information. The first affinity information is used to indicate the affinity relationship between services. Alternatively, the first affinity information can also be used to indicate the affinity relationship between services and the affinity degree thereof.

[0146] In this example, the Operator can acquire the affinity information in real time or periodically. For details, refer to the foregoing description, which will not be repeated here.

[0147] S506, the Resource-aware Operator feeds back the affinity information of the POD-1 to the NRI Plugin.

[0148] For example, the Operator detects whether the first affinity information includes the affinity information corresponding to the POD-1 based on the identification information of the POD-1 after acquiring the first affinity information.

[0149] Specifically, the Operator acquires the first affinity information, and the first affinity information includes the corresponding relationship of all PODs in the system up to the current time (which can be in the current period, or from the system initialization to the current time) and the PODs having the affinity relationship (referred to as affinity PODs). In some examples, if a POD does not have an affinity relationship, the affinity relationship thereof can be empty, or does not include the table item corresponding to the POD.

[0150] The Operator can take the identification information of the POD-1 acquired from the NRI Plugin as an index to find whether the first affinity information includes the affinity information corresponding to the POD-1. For example, the Operator takes the identification information of the POD-1 as an index to find the affinity relationship table (as shown in Table 1).

[0151] In a possible implementation, if there is affinity information corresponding to the POD-1, it can also be understood that there is a table entry in the affinity relationship table that matches the identification information of the POD-1. The Operator obtains the identification information of the affinity POD having the affinity relationship with the POD-1 from the affinity information (that is, the table entry) corresponding to the POD-1.

[0152] Optionally, the affinity POD can be one or more, which is not limited in the present application.

[0153] Optionally, the Operator can also obtain the affinity degree corresponding to each affinity POD (the concept can refer to the above), and accordingly, the affinity information of the POD-1 fed back by the Operator can include the affinity POD having the affinity relationship with the POD-1 and the corresponding affinity degree (which can also be referred to as affinity degree information or affinity degree information, which is not limited in the present application).

[0154] For example, after the Operator obtains at least one affinity POD corresponding to the POD-1, the Operator sends an affinity information response message to the NRI Plugin, and the message includes but is not limited to the identification information of the at least one affinity POD of the POD-1.

[0155] S507, the NRI Plugin determines a first Numa Node set corresponding to the POD-1 based on the affinity information of the POD-1.

[0156] For example, the NRI Plugin receives the affinity information response message, and in response to the affinity information response message, obtains at least one affinity POD having the affinity with the POD-1, for example, obtains the identification information of the at least one affinity POD of the POD-1.

[0157] Then, the NRI Plugin can select a first affinity POD (which can be one or more) based on the affinity POD, and further determine a corresponding first Numa Node set, which can include one or more Numa Nodes. Optionally, the one or more Numa Nodes can include a first Numa Node (which can be one or more) to which the first affinity POD (which can be one or more) belongs.

[0158] Specifically, the NRI Plugin can find the configuration information (including but not limited to processor configuration parameters, memory configuration parameters, and device configuration parameters) of each affinity POD from the database based on the identification information of each affinity POD, so as to determine the Numa Node corresponding to each affinity POD.

[0159] In the embodiments of the present application, the NRI Plugin can determine the first Numa Node set according to preset conditions.

[0160] Optionally, the preset conditions include, but are not limited to, at least one of the following:

[0161] 1) At least one Numa Node in the Numa Node satisfies the affinity relationship.

[0162] 2) The remaining resources of the Numa Node can satisfy the demand of the target service.

[0163] 3) The smaller the distance to the Numa Node to which the affinity service belongs is, the better.

[0164] 3) The smaller the number of Numa Nodes is, the better. For example, if the combination of Numa Node0 and Numa Node1 (for example, the Numa Node is the first Numa Node) can satisfy the service demand of the target service, Numa Node1, Numa Node2 and Numa Node3 can also satisfy the service demand of the target service, the system selects the combination of Numa Node0 and Numa Node1 as the target Numa Node of the target service.

[0165] In a possible implementation, if there are multiple selectable Numa Nodes, for example, multiple affinity PODs belong to different Numa Nodes, the NRI Plugin can select the first affinity POD (which can be one or more) and the corresponding first Numa Node (which can be one Numa Node or a combination of multiple Numa Nodes, which will not be repeated hereinafter) based on the algorithm shown in FIG. 9.

[0166] In another possible implementation, if there are multiple selectable Numa Nodes, for example, multiple affinity PODs belong to different Numa Nodes, the NRI Plugin can select a first affinity POD and its corresponding first Numa Node based on the resource requirement of the POD-1, the remaining resources of the multiple selectable Numa Nodes, and the affinity degrees of the multiple affinity PODs. Among them, the first Numa Node is optionally smaller the better. For example, the NRI Plugin can set corresponding weight values for the resource requirement of the POD-1, the remaining resources of the multiple selectable Numa Nodes, and the affinity degrees of the multiple affinity PODs, respectively, and calculate the first Numa Node based on the weight values. For example, if the affinity degree of POD-2 to POD-1 is the highest, and the affinity degree of POD-3 to POD-1 is much smaller than that of POD-2, if the remaining resources of the Numa Node to which POD-3 belongs satisfy the resource requirement of POD-1, and the remaining resources of the Numa Node to which POD-2 belongs do not satisfy the resource requirement of POD-1, in one example, the NRI Plugin can configure the POD-1 to the Numa Node to which the POD-3 belongs, to satisfy the condition that the number of cross-Numa Nodes is smaller the better. In another example, the NRI Plugin can configure the POD-1 to the Numa Nodes to which the POD-2 and the POD-3 belong, so as to reduce the number of remote accesses to reduce the latency. It can be understood that in the scenario where the affinity of POD-1 to POD-2 is high, the business interaction between POD-1 and POD-2 is more, and if the POD-1 is deployed to other Numa Nodes, the number of accesses of the Numa Node to which the POD-1 belongs to the memory of the Numa Node to which the POD-2 belongs will be increased, and the throughput will be reduced. Therefore, in the case where the Numa Node of the POD with the highest affinity does not satisfy the resource requirement of the POD-1, the Numa Node of the POD can be combined with the Numa Nodes of other affinity PODs to satisfy the remaining resources, so as to reduce the number of remote accesses and improve the throughput.

[0167] In yet another possible implementation, if there are multiple selectable Numa Nodes, for example, multiple affinity PODs belong to different Numa Nodes, the NRI Plugin can select a first affinity POD and its corresponding first Numa Node based on the resource requirement of the POD-1, the remaining resources of the multiple selectable Numa Nodes, the affinity degrees of the multiple affinity PODs, and the Distance between different Numa Nodes.

[0168] In yet another possible implementation, if there are multiple selectable Numa Nodes, for example, multiple affinity PODs belong to different Numa Nodes, and none of the multiple selectable Numa Nodes meets the resource requirement of the POD-1. In one example, the NRI Plugin can select at least one Numa Node from the other Numa Nodes to combine with the Numa Node to which the affinity POD belongs, to select the first Numa Node, which can be performed according to the flow in FIG. 9. Alternatively, in this example, the NRI Plugin can set a priority selection condition, that is, the selected Numa Node combination includes at least one Numa Node to which the affinity POD belongs. Alternatively, in some examples, if one Numa Node can meet the resource requirement of the POD-1, the Numa Node preferentially selects the Numa Node to which the affinity POD with the largest affinity degree belongs, and the distance between the Numa Node and the POD-1 is the smallest. Alternatively, if there are multiple Numa Nodes with the smallest distance, one Numa Node can be selected from the other Numa Nodes according to the flow in FIG. 9 to reduce the number of Numa Nodes across nodes. It can be understood that in the embodiments of the present application, if multiple Numa Nodes are decided based on the preset condition, the flow in FIG. 9 can be further performed to select the Numa Node in which the POD-1 is deployed.

[0169] In yet another possible implementation, if there is one affinity POD, and the Numa Node to which the affinity POD belongs meets the resource requirement of the POD-1, the affinity POD is the first affinity POD in the embodiments of the present application, and the corresponding Numa Node is the first Numa Node.

[0170] In yet another possible implementation, if there is one affinity POD, and the Numa Node to which the affinity POD belongs does not meet the resource requirement of the POD-1. The NRI Plugin can select the second Numa Node from the other Numa Nodes according to the flow in FIG. 9. In another example, the NRI Plugin can also combine the other Numa Nodes with the Numa Node to which the affinity POD belongs based on the resource requirement of the POD-1, wherein the number of Numa Nodes in the combination still meets the less the better, and / or the smaller the distance the better.

[0171] In another possible implementation, if there is no affinity POD having an affinity relationship with the POD-1 in the system. Optionally, the NRI Plugin can send an affinity request information to the API Server, for requesting the user to indicate the affinity relationship corresponding to the POD-1, and the affinity request information can include but is not limited to the identification information of the POD-1. The API Server can display prompt information in the user interface provided by the system in response to the received affinity request information, for prompting the user to indicate the affinity POD having an affinity relationship with the POD-1 for the POD-1. The user can configure the affinity relationship of the POD-1 in the user interface, for example, indicating that the POD-1 has an affinity with the POD-2, and the API Server can determine the affinity POD of the POD-1 as the POD-2 in response to the received user instruction. The API Server can send an affinity response information to the NRI Plugin, and the information can include but is not limited to the identification information of the POD-1 and the identification information of the POD-2, for indicating that the POD-1 has an affinity relationship with the POD-2. The NRI Plugin can determine the affinity POD having an affinity relationship with the POD-1 as the POD-2 in response to the received affinity response information, and continue to execute the subsequent processes. If the user indicates that there is no POD having an affinity relationship with the POD-1, the NRI Plugin can assign a Numa Node satisfying the resource requirement of the POD-1 to the POD-1. Alternatively, the NRI Plugin can process according to the processes in FIG. 9.

[0172] Optionally, as described above, the Operator can record the affinity information of the POD, that is, in the process of executing the creation process of the POD-1, the POD-1 can be a service that has been created before and deleted, and the Operator still retains the affinity information of the POD-1. Of course, the historical affinity information can be inaccurate, and the system in the embodiment of the present application can dynamically adjust the Numa Node deployment of the POD-1 to make it more consistent with the current requirement of the POD-1 to improve the throughput according to the dynamic updating process in FIG. 7 during the running process of the POD-1.

[0173] S508, the NRI Plugin updates the Spec file.

[0174] For example, after the NRI Plugin determines the first Numa Node set corresponding to the POD-1, it allocates all or part of the resources of each Numa Node in the first Numa Node to the POD-1. And obtains the Spec file of the POD-1 from the database, and modifies the configuration information (including processor configuration parameters, memory configuration parameters, device configuration parameters, etc.) of the POD-1 according to the allocated resources of the POD-1.

[0175] S509, the NRI Plugin sends the updated indication information to the container engine.

[0176] For example, after the NRI Plugin updates the Spec file of the POD-1, the NRI Plugin sends the updated indication information to the container engine, where the updated indication information indicates that the Spec file (or the configuration information) of the POD-1 is updated.

[0177] S510, the container engine creates the POD-1 based on the updated Spec file.

[0178] For example, the container engine creates the POD-1 based on the updated Spec file, and deploys the POD-1 to at least one Numa Node in the first Numa Node set.

[0179] FIG. 6 is a schematic diagram of an affinity relationship deployment, as an example. Referring to FIG. 6, after the system obtains the creation task of the POD-1, the system can find the affinity POD (for example, the POD-2) having the affinity relationship with the POD-1 based on the affinity relationship of the POD-1. The system can deploy the POD-1 to the Numa Node 1 to which the POD-2 belongs, so that the two PODs that need to frequently interact with each other can be deployed to the same Numa Node, so as to reduce the remote access times of the Numa Node and improve the business throughput.

[0180] FIG. 7 is a schematic diagram of a flow of dynamically adjusting the configuration information of the business, as an example. Referring to FIG. 7, the flow includes but is not limited to the following steps:

[0181] S701, the Topology Manager sends the optimization instruction to the Resource-aware Operator.

[0182] For example, the user can issue the periodic update instruction through the user interface, and the Topology Manager determines the period of the dynamic update of the configuration information (which can be set according to the actual demand) in response to the received user instruction.

[0183] Alternatively, the user can also issue the instant update instruction through the user interface, and the instruction can include but is not limited to the range of the PODs that need to be updated (for example, the identification information of the PODs that need to be updated). The Topology Manager performs the update flow in FIG. 7 on the PODs indicated by the user in response to the received user instruction.

[0184] Exemplarily, taking the periodic update as an example, when the Topology Manager detects that the update cycle trigger moment is reached, the Topology Manager sends an optimization instruction to the Operator, and the optimization instruction is used to instruct to update the affinity information. Of course, in some examples, the Topology Manager can also instruct to update the affinity information of part of the PODs, which is not limited in the present application.

[0185] S702, the Operator obtains the second affinity information based on the historical interaction information.

[0186] Exemplarily, as described above, the Operator can obtain the historical interaction information in real time or periodically, and update the recorded affinity relationship of each POD based on the historical interaction information, for example, update the affinity relationship table shown in Table 1.

[0187] The Operator can obtain the second affinity information in response to the received optimization instruction, and the second affinity information is used to indicate the current recorded affinity relationship of each POD. Wherein, the affinity relationship of each POD indicated by the second affinity information can be all or part different from the affinity relationship indicated in the first affinity information, of course, it can also be the same, which is not limited in the present application.

[0188] S703, the Operator feeds back the affinity information of POD-1 to the NRI Plugin.

[0189] In one example, the Operator can feed back the affinity information of the POD whose affinity has changed to the NRI Plugin. In another example, the Operator can also send the current corresponding affinity information of all PODs to the NRI Plugin, which is not limited in the present application.

[0190] Exemplarily, the NRI can judge whether the affinity information of each service has changed. In one example, if it has changed, the subsequent configuration change process is continued. If it has not changed, the configuration of the service is not modified, that is, the Numa Node of the service remains unchanged.

[0191] In this example, taking the change of the affinity information of POD-1 as an example. The Operator feeds back the affinity information of POD-1 to the NRI Plugin, for example, the affinity information of POD-1 indicates that the POD having the affinity relationship with POD-1 is POD-3. That is, the affinity POD having the affinity relationship with POD-1 changes from POD-2 shown in FIG. 6 to POD-3.

[0192] S704, the NRI Plugin determines a second Numa Node set corresponding to the POD-1 based on the affinity information of the POD-1.

[0193] For example, the NRI Plugin can re-determine the second Numa Node set for the POD-1 based on the affinity information of the POD-1. The Numa Nodes in the second Numa Node set can be the same as, or all or part different from, the Numa Nodes in the first Numa Node set, which is not limited in the present application. The specific selection manner can refer to the above, and will not be described here.

[0194] S705, the NRI Plugin updates the Spec file.

[0195] For example, the NRI Plugin determines that the configuration information of the POD-1 changes, obtains the Spec file of the POD-1 from the database, and modifies the configuration information corresponding to the POD-1. For example, the POD-1 is deployed in the Numa Node1 when it is created (or after the last dynamic adjustment). In the present adjustment (or optimization) process, the NRI Plugin determines that the POD-1 is configured on the Numa Node0. The NRI Plugin can allocate all or part of the resources of the Numa Node0 to the POD-1 according to the resource requirement of the POD-1, and modify the configuration information of the POD-1 in the Spec file based on the allocation result. For example, the processor parameters are modified from Core-3 and Core-4 (the two Cores belong to the Numa Node1) to Core-0 and Core-1 (the two Cores belong to the Numa Node0). Thus, the POD-1 is dynamically adjusted from the Numa Node1 to the Numa Node0 by modifying the configuration parameters.

[0196] S706, the NRI Plugin sends update indication information to the container engine.

[0197] For example, the NRI Plugin sends the update indication information to the container engine, which is used to indicate that the Spec file of the POD-1 is updated. Optionally, the update indication information can include but is not limited to the identification information of the POD-1. The container engine can read the updated Spec file of the POD-1 from the database, and make the updated configuration information effective.

[0198] In a possible implementation, the system can set a migration period, and in the migration period, the system can set a migration number. For example, in each migration period, the migration number is 1. That is, in the migration period, the Numa Node of any POD can be dynamically adjusted only once, thereby avoiding the problem of system instability caused by frequent adjustment of configuration parameters.

[0199] FIG. 8 is a schematic diagram of an affinity relationship deployment, which is exemplarily shown. As shown in FIG. 8, in the embodiment of the present application, after the system obtains the tuning task of the POD-1, the system can find the affinity POD, for example, the POD-3, which has the affinity relationship with the POD-1 based on the affinity relationship of the POD-1. The system can migrate the POD-1 from the original Numa Node1 to the Numa Node1 to which the POD-3 belongs. That is, in the process of running the POD-1, the affinity relationship of the POD-1 changes, that is, the frequency of business interaction between the POD-1 and the POD-3 is greater than the business interaction frequency of the POD-2. Therefore, by means of dynamic adjustment, the two PODs which need to frequently interact with each other can be deployed in the same Numa Node, so as to minimize the remote access number of the Numa Node and improve the business throughput. Of course, the scheme can also gradually improve the rationality of the deployment of the POD. For example, when the POD-1 is created, the affinity is historical. In the process of running the POD-1, as the running time gradually lengthens, the affinity relationship obtained by the system is more and more accurate, and the rationality of the deployment is higher and higher, thereby effectively improving the system throughput.

[0200] FIG. 9 is a flowchart of a preset algorithm, which is exemplarily shown. In the embodiment of the present application, the preset algorithm shown in FIG. 9 can be used in combination with the flowcharts in FIG. 4 or FIG. 5. In some examples, the flowchart in FIG. 9 can also be used independently to select a suitable Numa Node for the target business. As shown in FIG. 9, the flowchart specifically includes but is not limited to the following steps.

[0201] S901, the NRI Plugin sends the Numa Node set-1 to the Topology Manager.

[0202] Exemplarily, as described above, when selecting the Numa Node, the NRI Plugin can obtain a plurality of selectable Numa Nodes (for example, denoted as the Numa Node set-1). The NRI Plugin can call the preset algorithm of the Topology Manager to select the first Numa Node set or the second Numa Node set.

[0203] The NRI Plugin sends the Numa Node Set-1 to the Topology Manager, which can include but is not limited to the identification information of each Numa Node in the Numa Node Set-1.

[0204] In the embodiments of the present application, the Numa Node Set-1 includes at least one Numa Node with the smallest distance to the Numa Node to which the affinity POD-1 belongs, and / or the Numa Node to which the affinity POD-1 belongs.

[0205] S902a, the Topology Manager requests CPU Hits (objects) from the CPU Manager.

[0206] For example, the Topology Manager requests CPU Hits of each Numa Node in the Numa Node Set-1 from the CPU Manager.

[0207] S902b, the CPU Manager feeds back the CPU Hits to the Topology Manager.

[0208] S903a, the Topology Manager requests Mem Hits from the Memory (Mem) Manager.

[0209] For example, the Topology Manager requests Mem Hits of each Numa Node in the Numa Node Set-1 from the Mem Manager.

[0210] S903b, the Mem Manager feeds back the Mem Hits to the Topology Manager.

[0211] For example:

[0212] Table 2

[0213] Table 2 shows the Mem Hits and CPU Hits. In the table, each value represents the remaining resources of the processor (or processor core) and the memory of the corresponding Numa Node.

[0214] S904, Topology Manager merges hits, gets Numa Node set-2.

[0215] In this example, there are 3 Numa Nodes, so the length of the hit object is 3 bits, and each bit is 1, indicating that this combination needs to use this NUMA node. Among them, the position in hit from low to high corresponds to the serial number of Numa Node from small to large, for example, the lowest bit in hit corresponds to Numa Node0. For example, if a combination that meets the requirements of a 3-core CPU is NUMA0+NUMA1, then the hit value is

[0011] .

[0216] For example, when merging hits, Topology Manager can obtain Numa Node set-2 based on the resource requirements of POD-1 and the preset conditions set in the embodiments of the present application. For example, the resource requirements of POD-1 are 3 cores and 3G memory, so at least two Numa Nodes are required to meet the requirements. In the embodiments of the present application, two Numa Node combinations are taken as an example for illustration, and the cases of single Numa and multiple Numa Nodes can also be implemented accordingly, and the present application will not illustrate each case.

[0217] For example, please refer to Table 3:

[0218] Table 3

[0219] Topology Manager can obtain Table 3 based on the resource requirements of POD-1 and the available resources of each Numa Node memory and CPU. For example,

[0101] of MEM indicates that the combination of Numa Node0 and Numa Node2 can meet the memory resource requirements of POD-1.

[0220] Topology Manager can obtain a total of hits combinations by combining MEM and CPU through the above hits, as shown in Table 4. When the binary is consistent, it means that the resources match, that is, the combination is available.

[0221] Table 4

[0222] As shown in Table 4, wherein,

[0101] ,

[0011] represent the Numa Node combinations available, constituting the Numa Node set-2. Wherein

[0101] represents the combination of Numa Node0 and Numa Node2,

[0011] represents the combination of Numa Node0 and Numa Node1.

[0223] In a possible implementation, if the Numa Node combination in the obtained Numa Node set-2 does not include any Numa Node to which the affinity POD-1 belongs, the Topology Manager can expand the number of Numa Node combinations to improve the probability of including the Numa Node to which the affinity POD belongs in the Numa Node set-2, so that the Numa Node set-2 can always include at least one combination containing the Numa Node to which the affinity POD belongs.

[0224] S905, the Topology Manager selects the Numa Node set-3 with the shortest distance from the Numa Node set-2.

[0225] For example, the Topology Manager can select at least one Numa Node combination with the shortest distance from the Numa Node set-2 to constitute the Numa Node set-3.

[0226] In a possible implementation, the Topology Manager can also select at least one Numa Node combination containing the Numa Node to which the affinity POD belongs and having the shortest distance to constitute the Numa Node set-3.

[0227] In some examples, if there is only one combination in the Numa Node set-2 or the Numa Node set-3 during the processing process, the combination is the target hit, that is, the target Numa Node.

[0228] S906, the Topology Manager selects the target Numa Node from the Numa Node set-3 according to a preset algorithm.

[0229] In the embodiments of the present application, the Topology Manager can be provided with at least one preset algorithm, including but not limited to at least one of the following:

[0230] 1) bin packing algorithm.

[0231] Select target Numa Node from small to large or from large to small according to the sequence number of Numa Node. Or, after filling the Numa Node to which the affinity POD belongs, select target Numa Node from small to large or from large to small according to the sequence number. Thus, Numa Node fragmentation can be avoided as much as possible.

[0232] For example:

[0233] Suppose that the current Numa Node set-3 includes the combination of Numa Node0 and Numa Node1, and the combination of Numa Node2 and Numa Node1. Numa Node1 is optionally the Numa Node to which the affinity POD belongs.

[0234] In one example, the Topology Manager can first fill all the resources of Numa Node1 according to the resource requirements of POD-1, and then allocate all or part of the resources of Numa Node0 to POD-1.

[0235] In another example, the Topology Manager can first fill all the resources of Numa Node0 according to the sequence number from small to large, and then allocate all or part of the resources of Numa Node1 to POD-1.

[0236] 2) Load balancing algorithm. When allocating resources, select one or more Numa Nodes with the lowest resource load as target Numa Nodes. Thus, the problem of excessive pressure on a certain Numa Node leading to reduced business performance can be avoided.

[0237] For example:

[0238] Topology Manager can obtain the load state of each Numa Node combination in Numa Node set-3. Topology Manager can select a Numa Node combination with the lowest load as the target Numa Node.

[0239] 3) Task aggregation algorithm.

[0240] The Topology Manager can determine whether the CPU resource requirement of the POD-1 is greater than a preset threshold based on the CPU resource requirement of the POD-1 (only the CPU is taken as an example, and the processor resource requirement, CPU core resource requirement, or processor core resource requirement can also be understood, and the present application does not make any limitation). The preset threshold can be set by the Topology Manager according to the resource environment in the system, or can be set by the user, and the present application does not make any limitation. Alternatively, the preset threshold can be dynamically adjusted, and the present application does not make any limitation.

[0241] In one example, if the CPU resource requirement of the POD-1 is greater than or equal to the preset threshold, it can be understood that the POD-1 is a large task, and then a load balancing algorithm can be called to select the target Numa Node.

[0242] In another example, if the CPU resource requirement of the POD-1 is less than or equal to the preset threshold, it can be understood that the POD-1 is a small task, and then a binning algorithm can be called to select the target Numa Node. In this way, the small task and the large task can be avoided to be deployed to the same Numa Node, so as to reduce the business interference of the small task on the large task as much as possible. The business interference can be that multiple businesses access the same cache, and one business clears the data in the cache of another business, so that the other business needs to read the data from the memory again, resulting in performance reduction of the business.

[0243] S907, the Topology Manager feeds back the result to the NRI Plugin.

[0244] For example, after the Topology Manager obtains the target Numa Node, the Topology Manager can send the target Numa Node (including one or more) to the NRI Plugin. After the NRI Plugin obtains the target Numa Node, the NRI Plugin can update the configuration information of the POD-1.

[0245] Alternatively, all or part of the steps performed by the Topology Manager in FIG. 9 can also be performed by the NRI Plugin, and the present application does not make any limitation.

[0246] It should be understood that, in order to implement the above functions, the access device comprises a hardware structure and / or a software module corresponding to each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of the examples described in the embodiments disclosed in the present text, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is implemented in hardware or computer software driven hardware depends on the specific application of the technical solution and the design constraints. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0247] The embodiments of the present application can divide the functional modules of the access device according to the above method examples. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The integrated module can be implemented in the form of hardware or software functional module. It should be noted that the division of modules in the embodiments of the present application is illustrative, and is only a logical functional division. When actually implemented, there can be another division method.

[0248] In the case of dividing each functional module according to each function, in the case of dividing each functional module according to each function, FIG. 10 shows a possible structure diagram of the service configuration device 1000 involved in the above embodiments. As shown in FIG. 10, the service configuration device can comprise: an acquisition module 1001, configured to acquire first affinity information based on historical interaction information between services, the first affinity information being used to indicate an affinity relationship between services; a determination module 1002, configured to determine whether there is an affinity service having affinity with a target service based on the first affinity information; and a configuration module 1003, configured to configure the target service to a first target sub-node, wherein the first target sub-node comprises a first sub-node and / or a second sub-node, the first sub-node is a sub-node to which a first affinity service having affinity with the target service belongs, and the second sub-node is a sub-node between which and the first sub-node a delay satisfies a preset condition.

[0249] In a possible implementation, the acquisition module 1001 is further configured to acquire second affinity information based on historical interaction information between the target service and other services up to the current time; the determination module 1002 is further configured to determine whether the affinity service having the affinity with the target service changes based on the second affinity information; and the configuration module 1003 is further configured to, if the affinity service having the affinity with the target service changes from the first affinity service to a second affinity service, configure the target service to a second target subnode; the second target subnode includes a third subnode and / or a fourth subnode, where the third subnode is a subnode to which the second affinity service belongs, and the fourth subnode is a subnode that has a delay satisfying a preset condition with the third subnode.

[0250] In a possible implementation, the configuration module 1003 is specifically configured to modify a first configuration parameter of the target service to a second configuration parameter; where the first configuration parameter is used to indicate that the target service is deployed to the first target subnode, and the second configuration parameter is used to indicate that the target service is deployed to the second target subnode.

[0251] In a possible implementation, the first subnode and the second subnode belong to a same node Node, and resources in the Node are allocated to the first subnode and the second subnode, where the resources include processor resources, memory resources, and device resources.

[0252] In a possible implementation, the node is a non-uniform memory access (Numa) architecture, and the first subnode and the second subnode are non-uniform memory access nodes (Numa Nodes).

[0253] In a possible implementation, the first affinity information is further used to indicate an affinity degree between the services having the affinity, where the affinity degree between the first affinity service and the target service is the highest.

[0254] In a possible implementation, in a case where the first subnode satisfies a resource requirement of the target service, the first target subnode is the first subnode; or in a case where the first subnode does not satisfy the resource requirement of the target service and there is a subnode satisfying the resource requirement of the target service in a node to which the first subnode belongs, the first target subnode is the second subnode, and the second subnode is one of the subnodes satisfying the resource requirement of the target service and having a delay satisfying a preset condition with the first subnode; or in a case where no single subnode satisfies the resource requirement of the target service, the first target subnode is a combination of the first subnode and the second subnode, and a resource of the combination of the first subnode and the second subnode satisfies the resource requirement of the target service.

[0255] In a possible implementation, if there are multiple affinity services having affinity with the target service, and the multiple affinity services belong to different sub-nodes, the configuration module 1003 is specifically configured to: acquire resource usage of each sub-node in the multiple sub-nodes corresponding to the multiple affinity services; and determine a first target sub-node from the sub-nodes that meet the resource requirement of the target service based on the resource usage of each sub-node.

[0256] In a possible implementation, the configuration module 1003 is specifically configured to: select, based on a bin packing algorithm, a sub-node with the smallest serial number from the sub-nodes that meet the resource requirement of the target service as the first target sub-node; or select, based on a load balancing algorithm, a sub-node with the smallest load from the sub-nodes that meet the resource requirement of the target service as the first target sub-node; or determine, based on the resource requirement of the target service, whether the resource requirement of the target service is greater than a preset resource threshold; if the resource requirement of the first target service is greater than the preset resource threshold, determine the first target sub-node based on the load balancing algorithm; and if the resource requirement of the first target service is less than or equal to the preset resource threshold, determine the first target sub-node based on the bin packing algorithm.

[0257] In another example, FIG. 11 shows a schematic block diagram of a service configuration apparatus 1100 according to an embodiment of the present application. The service configuration apparatus can include a processor 1101 and a transceiver / transceiver pin 1102, and optionally further include a memory 1103. The processor 1101 can be configured to execute the steps performed by the service configuration apparatus or Kubelet in the methods of the foregoing embodiments, and control the receiving pin to receive signals and the sending pin to send signals.

[0258] The various components of the service configuration apparatus 1100 are coupled through a bus system 1104, which can include a data bus, a power bus, a control bus, and a state signal bus. However, for clarity, only a bus system 1104 is shown in the figure.

[0259] Optionally, the memory 1103 can be configured to store instructions in the foregoing method embodiments.

[0260] It should be understood that the service configuration apparatus 1100 according to the embodiments of the present application can correspond to the computer device in the methods of the foregoing embodiments, and the above and other management operations and / or functions of the various elements in the service configuration apparatus 1100 are respectively used to implement the corresponding steps of the foregoing methods, and for brevity, will not be described here.

[0261] Wherein, all the related contents of the steps involved in the method embodiments are described in the function description of the corresponding function modules, and will not be described here.

[0262] Based on the same technical concept, the embodiment of the present application further provides a computer readable storage medium, which stores a computer program containing at least one code, and the at least one code can be executed by a computer device to control the computer device to implement the above-mentioned method embodiment.

[0263] Based on the same technical concept, the embodiment of the present application further provides a computer program, which, when executed by a computer device, is used to implement the above-mentioned method embodiment.

[0264] The program can be stored in a storage medium packaged together with the processor or in a storage medium not packaged together with the processor.

[0265] Based on the same technical concept, the embodiment of the present application further provides a processor, which is used to implement the above-mentioned method embodiment. The processor can be a chip.

[0266] The steps of the method or algorithm described in connection with the embodiments disclosed in the present application can be implemented in the form of hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in a random access memory (RAM), a flash memory, a read only memory (ROM), an erasable programmable ROM (EPROM), an electrically EPROM (EEPROM), a register, a hard disk, a mobile hard disk, a compact disk read only memory (CD-ROM) or any other form of storage medium well known in the art. An exemplary storage medium is coupled to the processor, so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor.

[0267] Those skilled in the art should realize that, in one or more of the examples described above, the functions described in the embodiments of the present application can be implemented by hardware, software, firmware or any combination thereof. When implemented by software, these functions can be stored in a computer readable medium or transmitted as one or more instructions or codes on a computer readable medium. The computer readable medium includes a computer storage medium and a communication medium, wherein the communication medium includes any medium that facilitates the transfer of computer programs from one place to another. The storage medium can be any available medium accessible by a general or special purpose computer.

[0268] The embodiments of the present application are described above with reference to the accompanying drawings, but the present application is not limited to the specific embodiments described above, and the specific embodiments described above are merely illustrative, but not restrictive, and a person of ordinary skill in the art can make many forms under the inspiration of the present application without departing from the purpose of the present application and the scope protected by the claims.

Claims

1. A service configuration method, characterized by, The method comprises: obtaining first affinity information based on historical interaction information between services, the first affinity information being used to indicate an affinity relationship between services; determining whether there is an affinity service having affinity with a target service based on the first affinity information; configuring the target service to a first target sub-node, wherein the first target sub-node comprises a first sub-node and / or a second sub-node, the first sub-node being a sub-node to which a first affinity service having affinity with the target service belongs, and the second sub-node being a sub-node between which and the first sub-node a delay satisfies a preset condition.

2. The method of claim 1, wherein, The method further comprises: obtaining second affinity information based on historical interaction information between services up to the present; determining whether an affinity service having affinity with the target service changes based on the second affinity information; if the affinity service having affinity with the target service changes from the first affinity service to a second affinity service, configuring the target service to a second target sub-node; the second target sub-node comprises a third sub-node and / or a fourth sub-node, wherein the third sub-node is a sub-node to which the second affinity service belongs, and the fourth sub-node is a sub-node between which and the third sub-node a delay satisfies the preset condition.

3. The method of claim 2, wherein, The configuring the target service to the second target sub-node comprises: modifying a first configuration parameter of the target service to a second configuration parameter; wherein the first configuration parameter is used to indicate that the target service is deployed to the first target sub-node, and the second configuration parameter is used to indicate that the target service is deployed to the second target sub-node.

4. The method of claim 1, wherein, The first sub-node and the second sub-node belong to the same node, and resources in the node are allocated to the first sub-node and the second sub-node, the resources comprising processor resources, memory resources, and device resources.

5. The method of claim 4, wherein, The node is a non-uniform memory access (NUMA) architecture, and the first sub-node and the second sub-node are non-uniform memory access nodes (NUMA nodes).

6. The method of claim 1, wherein, The first affinity information is also used to indicate an affinity degree between services having an affinity relationship, wherein the affinity degree between the first affinity service and the target service is the highest.

7. The method of claim 1, wherein, in a case where the first sub-node satisfies a resource requirement of the target service, the first target sub-node is the first sub-node; or, in a case where the first sub-node does not satisfy the resource requirement of the target service, and there is a sub-node satisfying the resource requirement of the target service in a node to which the first sub-node belongs, the first target sub-node is the second sub-node, and the second sub-node is one of the sub-nodes satisfying the resource requirement of the target service, between which and the first sub-node a delay satisfies the preset condition; or, In a case where none of the single sub-nodes satisfies the resource requirement of the target service, the first target sub-node is a combination of the first sub-node and the second sub-node, and the resources of the combination of the first sub-node and the second sub-node satisfy the resource requirement of the target service.

8. The method of claim 1, wherein, If there are multiple affinity services having affinity with the target service, and the multiple affinity services belong to different sub-nodes, the configuring the target service to the first target sub-node comprises: obtaining resource usage of each sub-node in multiple sub-nodes corresponding to the multiple affinity services; determining the first target sub-node from the multiple sub-nodes satisfying the resource requirement of the target service based on the resource usage of each sub-node.

9. The method of claim 8, wherein, The determining the first target sub-node from the multiple sub-nodes satisfying the resource requirement of the target service comprises: selecting a sub-node with the smallest serial number as the first target sub-node from the multiple sub-nodes satisfying the resource requirement of the target service based on a bin packing algorithm; or, selecting a sub-node with the smallest load as the first target sub-node from the multiple sub-nodes satisfying the resource requirement of the target service based on a load balancing algorithm; or, judging whether the resource requirement of the target service is greater than a preset resource threshold based on the resource requirement of the target service; if the resource requirement of the target service is greater than the preset resource threshold, determining the first target sub-node based on the load balancing algorithm; if the resource requirement of the target service is less than or equal to the preset resource threshold, determining the first target sub-node based on the bin packing algorithm.

10. A service configuration apparatus characterized by comprising: comprises: an obtaining module, configured to obtain first affinity information based on historical interaction information between services, the first affinity information being used to indicate an affinity relationship between services; a determining module, configured to determine whether there is an affinity service having affinity with a target service based on the first affinity information; a configuring module, configured to configure the target service to a first target sub-node, wherein the first target sub-node comprises a first sub-node and / or a second sub-node, the first sub-node is a sub-node to which a first affinity service having affinity with the target service belongs, and the second sub-node is a sub-node having a delay satisfying a preset condition with the first sub-node.

11. The apparatus of claim 10, wherein: the obtaining module is further configured to obtain second affinity information based on historical interaction information between services up to the present; the determining module is further configured to determine whether an affinity service having affinity with the target service changes based on the second affinity information; The configuration module is further configured to: if an affinity service having affinity with the target service changes from the first affinity service to a second affinity service, configure the target service to a second target sub-node; the second target sub-node includes a third sub-node and / or a fourth sub-node, wherein the third sub-node is a sub-node to which the second affinity service belongs, and the fourth sub-node is a sub-node between which and the third sub-node a delay satisfies the preset condition.

12. The apparatus of claim 11, wherein, The configuration module is specifically configured to: modify a first configuration parameter of the target service to a second configuration parameter; wherein the first configuration parameter is used to indicate that the target service is deployed on the first target sub-node, and the second configuration parameter is used to indicate that the target service is deployed on the second target sub-node.

13. The apparatus of claim 10, wherein, The first sub-node and the second sub-node belong to the same node, and resources in the node are allocated to the first sub-node and the second sub-node, and the resources include processor resources, memory resources and device resources.

14. The apparatus of claim 13, wherein, The node is a non-uniform memory access (NUMA) architecture, and the first sub-node and the second sub-node are NUMA nodes.

15. The apparatus of claim 10, wherein, The first affinity information is further used to indicate an affinity degree between services having affinity, wherein the affinity degree between the first affinity service and the target service is the highest.

16. The apparatus of claim 10, wherein, in a case where the first sub-node satisfies a resource requirement of the target service, the first target sub-node is the first sub-node; or, in a case where the first sub-node does not satisfy the resource requirement of the target service, and there is a sub-node satisfying the resource requirement of the target service in a node to which the first sub-node belongs, the first target sub-node is the second sub-node, and the second sub-node is one of the sub-nodes satisfying the resource requirement of the target service, and a delay between the first sub-node and the second sub-node satisfies the preset condition; or, in a case where no single sub-node satisfies the resource requirement of the target service, the first target sub-node is a combination of the first sub-node and the second sub-node, and a resource of the combination of the first sub-node and the second sub-node satisfies the resource requirement of the target service.

17. The apparatus of claim 10, wherein, If there are multiple affinity services having affinity with the target service, and the multiple affinity services belong to different sub-nodes, the configuration module is specifically configured to: obtain resource usage of each sub-node in multiple sub-nodes corresponding to the multiple affinity services; determine the first target sub-node from the sub-nodes satisfying the resource requirement of the target service based on the resource usage of each sub-node.

18. The apparatus of claim 17, wherein, The configuration module is specifically configured to: select a sub-node with the smallest serial number from the sub-nodes satisfying the resource requirement of the target service as the first target sub-node based on a bin packing algorithm; or, select a sub-node with the smallest load from the sub-nodes satisfying the resource requirement of the target service as the first target sub-node based on a load balancing algorithm. Or, determining, based on the resource requirement of the target service, whether the resource requirement of the target service is greater than a preset resource threshold; if the resource requirement of the first target service is greater than the preset resource threshold, determining the first target sub-node based on the load balancing algorithm; if the resource requirement of the first target service is less than or equal to the preset resource threshold, determining the first target sub-node based on the bin packing algorithm.

19. A computer program product, characterised in that, When the computer program product runs on the computer device, the computer device is caused to perform the method in any one of claims 1-9.

Citation Information

Patent Citations

  • Container deployment affinity configuration optimization method based on NUMA architecture

    CN114416277A

  • Dispatching method and device based on distributed cluster

    CN117149423A

  • NUMA perception scheduling method and system based on k8s

    CN117519994A

  • Service configuration method and device

    CN119396563A

  • Cloud affinity based on evaluation of static and dynamic workload characteristics

    US11928513B1