Micro-service migration method and device for coping with hot spot diffusion of processor, equipment and medium
By constructing a microservice relationship graph and optimizing migration overhead, the problem of hotspot diffusion in physical node processors was solved, thereby improving node stability with less migration overhead and avoiding hardware damage.
Patent Information
- Application Number
- CN202511758767.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-02-13
AI Technical Summary
In existing technologies, the problem of processor hotspot propagation on physical nodes has not been effectively solved, leading to performance degradation, slow processing speed, and even hardware damage and node crashes.
By constructing a microservice relationship graph, the microservices to be migrated that cause processor hotspot spread are identified, and the migration cost is calculated. The microservices are then migrated from the source physical node to the target physical node, which meets the preset screening conditions, in order to manage processor hotspot spread.
With minimal migration overhead, the system accurately identifies and migrates microservices that cause hotspots to spread, improving the stability of physical nodes, reducing computational load, and preventing hardware damage and crashes.
Smart Images

Figure CN121531027A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of performance governance, and in particular to a microservice migration method, device and equipment for coping with processor hotspot diffusion and a medium. BACKGROUND
[0002] In the existing distributed operation system, when the microservices in the physical node are called, the processor hotspot diffusion of the physical node may be caused due to resource competition, large amount of processing data, large network communication overhead, etc. If the processor hotspot diffusion problem is not handled in time, the performance of the physical node may be degraded, the processing speed may be slow, and more seriously, the hardware may be damaged, and the physical node may be crashed. Therefore, the processor hotspot diffusion problem of the physical node has become a key bottleneck affecting the stability of the physical node, that is, how to govern the processor hotspot diffusion problem of the physical node is a technical problem to be solved by the person skilled in the art. SUMMARY
[0003] Therefore, the purpose of the present application is to provide a microservice migration method, device and equipment for coping with processor hotspot diffusion and a medium, which can migrate the microservice causing the processor hotspot diffusion from the source physical node to the target physical node with small migration overhead, so as to realize the governance of the processor hotspot diffusion of the physical node. The specific scheme is as follows:
[0004] In a first aspect, the present application provides a microservice migration method for coping with processor hotspot diffusion, comprising:
[0005] determining target edges between each microservice based on the calling conditions of the microservices in the calling chain and the physical nodes where the microservices are located in the physical cluster, and constructing a microservice relationship graph based on the microservices and the target edges;
[0006] determining a to-be-migrated microservice from each microservice based on the microservice relationship graph; wherein the to-be-migrated microservice is a microservice causing the processor hotspot diffusion of the source physical node where the to-be-migrated microservice is located;
[0007] determining a candidate physical node corresponding to the to-be-migrated microservice from the physical cluster, and calculating the migration overhead of the to-be-migrated microservice from the source physical node to the candidate physical node;
[0008] determining a target physical node satisfying a preset screening condition from the candidate physical node according to the migration overhead, and migrating the to-be-migrated microservice from the source physical node to the target physical node.
[0009] Optionally, the target edges between the microservices are determined based on the calling conditions of the microservices in the calling chain and the physical nodes where the microservices are located in the physical cluster, and a microservice relationship graph is constructed based on the microservices and the target edges, including:
[0010] The target directed edges between the microservices are determined based on the calling sequence of the microservices in the calling chain, and the attribute parameters of the microservices are determined based on the calling conditions of the microservices, and the attribute parameters of the microservices are bound to the target directed edges connected to the microservices; the attribute parameters of the microservices include the calling time consumption and the traffic multiplier of the microservices;
[0011] Any two microservices located in the same physical node are determined from the microservices, and a target undirected edge is established between the any two microservices, and the parameter difference between the performance parameters of the any two microservices is bound to the target undirected edge; the intersection of the physical cores where the any two microservices are located in the same physical node is a non-empty set, and the cache groups where the any two microservices are located in the same physical node are the same;
[0012] A microservice relationship graph is constructed based on the microservices, the target directed edges between the microservices, and the target undirected edges between the microservices.
[0013] Optionally, the microservices to be migrated are determined from the microservices based on the microservice relationship graph, including:
[0014] The attribute parameters of the microservices are obtained from the microservice relationship graph, and the parameter amplification coefficients of the microservices are determined based on the attribute parameters of the microservices;
[0015] The microservice pairs connected by the target undirected edges are determined from the microservice relationship graph, and the parameter differences corresponding to the microservice pairs are obtained;
[0016] The first performance blocking parameters of the same physical core are determined based on the parameter differences corresponding to the microservice pairs on the same physical core, and the second performance blocking parameters of the same cache group are determined based on the first performance blocking parameters of the physical cores of the same cache group;
[0017] The second performance blocking parameters corresponding to the microservices are determined according to the cache groups where the microservices are located in the respective physical nodes;
[0018] The performance influence intensities corresponding to the microservices are determined according to the second performance blocking parameters corresponding to the microservices and the parameter amplification coefficients, and the microservices to be migrated are determined from the microservices based on the performance influence intensities corresponding to the microservices.
[0019] Optionally, determining the candidate physical node corresponding to the microservice to be migrated from the physical cluster includes:
[0020] A first physical node is determined from the physical cluster based on preset resource constraints; wherein the remaining resource capacity of the first physical node is not less than the resource capacity required by the microservice to be migrated.
[0021] A second physical node is determined from the physical cluster based on preset migration constraints; wherein, the number of round-trip hops between the source physical node and the second physical node of the microservice to be migrated is not greater than a preset number of hops according to the network topology of the physical cluster.
[0022] The intersection of the first physical node and the second physical node is determined to obtain the candidate physical nodes corresponding to the microservice to be migrated.
[0023] Optionally, calculating the migration cost of migrating the microservice to be migrated from the source physical node to the candidate physical node includes:
[0024] Based on the total amount of data to be migrated and the data transmission speed of the microservice to be migrated, the migration time of the microservice to be migrated from the source physical node to the candidate physical node is determined; the data transmission speed is the data transmission speed between the source physical node and the candidate physical node.
[0025] Based on the migration duration and the current number of live replicas of the microservice to be migrated, the migration cost of migrating the microservice to be migrated from the source physical node to the candidate physical node is determined.
[0026] Optionally, determining the target physical node that meets the preset screening criteria from the candidate physical nodes based on the migration cost includes:
[0027] Based on the migration overhead, a preset number of physical nodes with the lowest overhead are determined from the candidate physical nodes, and the selection probability corresponding to the preset number of physical nodes is determined based on the stability performance and remaining resource capacity of the preset number of physical nodes respectively.
[0028] The preset number of physical nodes are judged sequentially in descending order of the selection probability, so as to determine the first target physical node that meets the preset screening conditions from the preset number of physical nodes.
[0029] If the target physical node is not determined from the preset number of physical nodes, the preset screening condition is adjusted, and the step of determining the preset number of physical nodes in the order from large to small according to the selection possibility is re-executed.
[0030] If the cumulative adjustment times of the preset screening condition reach a preset number of times, the target physical node is directly determined from the preset number of physical nodes based on a preset selection strategy.
[0031] If the target physical node is determined from the preset number of physical nodes, the step of migrating the microservice to be migrated from the source physical node to the target physical node is triggered.
[0032] Optionally, the preset screening condition includes that the performance blocking weakening degree of the microservice to be migrated from the source physical node to the target physical node is not less than a preset degree, and the migration estimation risk is not greater than a preset risk, and / or a migration evaluation coefficient determined based on the performance blocking weakening degree and the migration estimation risk is greater than a preset coefficient.
[0033] The determination process of the performance blocking weakening degree and the migration estimation risk includes:
[0034] Based on the performance blocking contribution degrees of the microservice to be migrated to the source physical node and the target physical node respectively, a contribution degree difference value is determined, and the performance blocking weakening degree is determined according to the contribution degree difference value and a preset migration delay.
[0035] The migration estimation risk is determined according to the used resources of the local physical core and cache group of the target physical node respectively.
[0036] Correspondingly, the target physical node is directly determined from the preset number of physical nodes based on a preset selection strategy, which includes:
[0037] From the preset number of physical nodes, the target physical node with the maximum performance blocking weakening degree is determined.
[0038] In a second aspect, the application provides a microservice migration device for coping with processor hotspot diffusion, which includes:
[0039] A relationship graph construction module is configured to determine target edges between microservices based on the calling conditions of the microservices in the calling chain and the physical nodes where the microservices are located in a physical cluster, and construct a microservice relationship graph based on the microservices and the target edges.
[0040] The micro-service determination module is configured to determine, from the micro-services, a to-be-migrated micro-service based on the micro-service relationship diagram, wherein the to-be-migrated micro-service is a micro-service causing a hotspot diffusion of a processor of a source physical node where the to-be-migrated micro-service is located.
[0041] The migration overhead determination module is configured to determine, from the physical cluster, a candidate physical node corresponding to the to-be-migrated micro-service, and calculate a migration overhead of the to-be-migrated micro-service from the source physical node to the candidate physical node.
[0042] The micro-service migration module is configured to determine, from the candidate physical node, a target physical node satisfying a preset screening condition according to the migration overhead, and migrate the to-be-migrated micro-service from the source physical node to the target physical node.
[0043] In a third aspect, the present application provides an electronic device, comprising:
[0044] A memory configured to save a computer program;
[0045] A processor configured to execute the computer program to implement the foregoing micro-service migration method for coping with processor hotspot diffusion.
[0046] In a fourth aspect, the present application provides a computer readable storage medium configured to save a computer program, and the computer program is executed by a processor to implement the foregoing micro-service migration method for coping with processor hotspot diffusion.
[0047] In the present application, based on the calling conditions of each microservice in the calling chain and the physical nodes where the microservices are located in the physical cluster, target edges between each microservice are determined, and a microservice relationship graph is constructed based on the microservices and the target edges; based on the microservice relationship graph, a to-be-migrated microservice is determined from each microservice; wherein the to-be-migrated microservice is a microservice that causes processor hotspot diffusion of a source physical node where the to-be-migrated microservice is located; a candidate physical node corresponding to the to-be-migrated microservice is determined from the physical cluster, and a migration overhead of the to-be-migrated microservice migrating from the source physical node to the candidate physical node is calculated; according to the migration overhead, a target physical node satisfying a preset screening condition is determined from the candidate physical node, and the to-be-migrated microservice is migrated from the source physical node to the target physical node. As can be seen, based on the microservice relationship graph, the present application can more accurately determine the to-be-migrated microservice that causes processor hotspot diffusion of the source physical node where it is located, improve the determination accuracy of the to-be-migrated microservice, and through two-stage determination of the candidate physical node and the target physical node, the calculation of the migration overhead of all physical nodes can be avoided, the calculation amount is reduced, and further, according to the migration overhead, the target physical node satisfying the preset screening condition is determined from the candidate physical node, so as to migrate the to-be-migrated microservice causing processor hotspot diffusion from the source physical node to the target physical node using smaller migration overhead, thereby realizing the management of processor hotspot diffusion of the source physical node and improving the stability of the physical node. BRIEF DESCRIPTION OF DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor based on the provided drawings.
[0049] Figure 1 A microservice migration method flowchart for coping with processor hotspot diffusion is provided for the embodiments of the present application;
[0050] Figure 2 A to-be-migrated microservice determination flowchart is provided for the embodiments of the present application;
[0051] Figure 3 A candidate physical node determination flowchart is provided for the embodiments of the present application;
[0052] Figure 4 A target physical node determination flowchart is provided for the embodiments of the present application;
[0053] Figure 5A microservice migration device structure schematic diagram for coping with processor hotspot diffusion is provided for the embodiments of the present application.
[0054] Figure 6 A structure diagram of an electronic device is provided for the embodiments of the present application. DETAILED DESCRIPTION
[0055] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0056] When the microservices in the physical nodes are called, the processor hotspot diffusion of the physical nodes may be caused due to resource competition, large amount of processing data, large network communication overhead, etc. If the processor hotspot diffusion problem is not handled in time, the performance of the physical nodes may be finally degraded, the processing speed may be slow, and more seriously, the hardware may be damaged, the physical nodes may be crashed, etc. Therefore, the present application provides a microservice migration method for coping with processor hotspot diffusion, which can migrate the microservices causing the processor hotspot diffusion from the source physical nodes to the target physical nodes with small migration overhead, so as to realize the management of the processor hotspot diffusion of the physical nodes and ensure the stability of the physical nodes.
[0057] Referring to Figure 1 The embodiments of the present application disclose a microservice migration method for coping with processor hotspot diffusion, which comprises the following steps:
[0058] In step S11, the target edges between the microservices are determined based on the calling conditions of the microservices in the calling chain and the physical nodes where the microservices are located in the physical cluster, and a microservice relationship graph is constructed based on the microservices and the target edges.
[0059] In the embodiment of the present application, the control center of the physical cluster determines the target directed edges between the microservices based on the calling sequence of each microservice in the calling chain, determines the attribute parameters of each microservice based on the calling condition of each microservice, and binds the attribute parameters of the microservice to the target directed edges connected with the microservice; wherein the attribute parameters of the microservice include the calling time consumption and the traffic multiplier of the microservice; any two microservices located in the same physical node are determined from each microservice, and a target undirected edge is established between any two microservices, and the parameter difference between the performance parameters of any two microservices is bound to the target undirected edge; wherein the intersection of the physical cores where any two microservices are located in the same physical node is a non-empty set, and the cache groups where any two microservices are located in the same physical node are the same; and a microservice relationship graph is constructed based on each microservice and the target directed edges and the target undirected edges between each microservice.
[0060] Specifically, based on the upstream microservice and the downstream microservice of each hop in the last calling chain, a target directed edge from the upstream microservice to the downstream microservice is determined, and the calling time consumption of each microservice is determined based on the start calling time and the end calling time of each microservice in the last calling chain, at this time the calling time consumption = end calling time - start calling time, the traffic multiplier of each microservice is determined based on the access traffic change of each microservice in the last calling chain, and the calling time consumption and the traffic multiplier of the microservice are bound to the target directed edges connected with the microservice. In this way, the causal information that the traffic amplification (reflected by the traffic multiplier) leads to the lengthening of the calling time consumption can be directly fixed to the directed edge, so as to provide traceable basis for subsequent positioning of the microservice to be migrated.
[0061] Further, by constructing a mapping table of a NUMA (Non Uniform Memory Access) region, a physical core (for example, a CPU (Central Processing Unit) core), and a three-level cache group for each physical node in the physical cluster, and caching the mapping table locally, for each physical core C and cache group l in the mapping table, record the microservice w currently bound thereto, forming the binding relationship C(w) and l(w). From the microservices, determine any two microservices wi and wj located in the same physical node, at this time, any two microservices wi and wj satisfy the intersection of C(wi) and C(wj) is not equal to an empty set and l(wi) is equal to l(wj), then establish a target undirected edge for any two microservices wi and wj, and collect the performance parameters corresponding to any two microservices respectively by using a hardware performance counter, and calculate the parameter difference between the performance parameters of any two microservices, and then bind the parameter difference to the target undirected edge. Wherein, the performance parameters corresponding to the microservice include but are not limited to the running queue length corresponding to the microservice, the instruction occupancy rate, the LLC (Last Level Cache) hit rate. In this way, it is convenient to capture the instruction handover and local blocking caused by the mutual exclusion of the physical core or the cache group, thereby providing a basis for subsequent positioning of the microservice to be migrated.
[0062] Finally, based on the microservices and the target directed edges and the target undirected edges between the microservices, a microservice relationship graph is constructed. Moreover, the embodiment is to execute the construction steps of the microservice relationship graph in the case of time synchronization of the physical nodes, to ensure the consistency of time.
[0063] Further, the embodiment of the present application also determines the approaching coefficient of each microservice based on the CPU usage rate and the CPU quota of each microservice in the recent period of time, for example, the approaching coefficient = CPU usage rate / CPU quota, then determines the microservice whose approaching coefficient is greater than a preset threshold, and assigns a shielding coefficient to the microservice, wherein the shielding coefficient is negatively correlated with the degree of exceeding the threshold of the approaching coefficient, and then adjusts the parameters bound on the target edges connected to the microservice in the microservice relationship graph by using the shielding coefficient of the microservice.
[0064] Step S12, determining a microservice to be migrated from the microservices based on the microservice relationship graph; wherein the microservice to be migrated is a microservice causing the processor hotspot diffusion of the source physical node where the microservice to be migrated is located.
[0065] In the embodiment of the present application, as Figure 2According to the microservice relationship graph, attribute parameters of each microservice are obtained, and a parameter amplification coefficient of each microservice is determined based on the attribute parameters of each microservice; a microservice pair connected by a target undirected edge is determined from the microservice relationship graph, and a parameter difference corresponding to the microservice pair is obtained; based on the parameter difference corresponding to the microservice pair on the same physical core, a first performance blocking parameter of the same physical core is determined, and based on the first performance blocking parameter of the physical core for the same cache group, a second performance blocking parameter of the same cache group is determined; according to the cache group in which each microservice is located in the respective physical node, a second performance blocking parameter corresponding to each microservice is determined; according to the second performance blocking parameter corresponding to each microservice and the parameter amplification coefficient, a performance influence intensity corresponding to each microservice is determined, and based on the performance influence intensity corresponding to each microservice, a to-be-migrated microservice is determined from each microservice. It should be noted that the to-be-migrated microservice is a microservice that causes the processor (for example, a central processor) of the source physical node where the to-be-migrated microservice is located to be hot.
[0066] For each microservice parameter amplification coefficient, specifically based on the product of the traffic multiplier of each microservice and the call time of the upstream microservice in the call chain, the parameter amplification coefficient of each microservice is determined. It should be noted that when each microservice is the first microservice in the call chain, the parameter amplification coefficient of the first microservice is determined based on the product of the traffic multiplier of the first microservice and the preset reference call time.
[0067] For the microservice pair for the same physical core (each microservice pair contains two microservices connected by a target undirected edge, and the two microservices are for the same physical core), based on the running queue length difference and instruction occupancy rate difference corresponding to the microservice pair on the same physical core, the first performance blocking parameter of the same physical core is determined. Wherein, the calculation formula of the first performance blocking parameter of the same physical core is as follows:
[0068] ;
[0069] Wherein, represents the first performance blocking parameter of the physical core c; represents the microservice pair for the physical core c; (wi, wj) represents any one of the microservice pairs in the microservice pair for the physical core c; represents the instruction occupancy rate difference between the microservices wi and wj in the microservice pair; represents the running queue length difference between the microservices wi and wj in the microservice pair; represents the learnable gating coefficient of the physical core c on the running queue length difference.
[0070] For the second performance blocking parameter of the same cache group, the second performance blocking parameter of the same cache group is determined based on the first performance blocking parameter of the physical core for the same cache group. Wherein, the calculation formula of the second performance blocking parameter of the same cache group is as follows:
[0071] ;
[0072] Wherein, represents the second performance blocking parameter of the cache group l; C represents a set composed of all physical cores for the cache group l, and c represents any one physical core in the set C; represents the first performance blocking parameter of the physical core c; represents the learnable gating coefficient applied by the cache group l to the first performance blocking parameter.
[0073] After determining the second performance blocking parameter and the parameter amplification coefficient corresponding to each microservice respectively, the performance influence intensity corresponding to each microservice can be determined according to the product or the sum of the second performance blocking parameter and the parameter amplification coefficient corresponding to each microservice. Then, the average value of the performance influence intensity corresponding to each microservice is calculated, and the microservice with a performance influence intensity greater than a preset intensity is determined as a to-be-migrated microservice; wherein, the preset intensity can be equal to the average value, or equal to the sum of the average value and a preset deviation.
[0074] Step S13, determining the candidate physical node corresponding to the to-be-migrated microservice from the physical cluster, and calculating the migration overhead of the to-be-migrated microservice from the source physical node to the candidate physical node.
[0075] In the embodiment of the application, as shown in Figure 3 For determining the candidate physical node corresponding to the to-be-migrated microservice from the physical cluster, specifically, the first physical node can be determined from the physical cluster based on a preset resource constraint; wherein, the remaining resource capacity of the first physical node is not less than the resource capacity required by the to-be-migrated microservice; the second physical node can be determined from the physical cluster based on a preset migration constraint; wherein, the round trip hop number of the to-be-migrated microservice between the source physical node and the second physical node according to the network topology relationship of the physical cluster is not greater than the preset hop number; the intersection of the first physical node and the second physical node is determined to obtain the candidate physical node corresponding to the to-be-migrated microservice.
[0076] For determining the first physical node from the physical cluster based on the preset resource constraint, since each physical node includes multiple types of resources, such as physical cores, memories, bandwidths and cache groups, at this time, the remaining resource capacity of the first physical node with respect to various types of resources is not less than the resource capacity required by the to-be-migrated microservice with respect to the corresponding type of resource.
[0077] In an example, according to determining from a physical cluster a first physical node satisfying =1; wherein, R represents a set based on multiple types of resources, r represents any one type of resource in the set R; 1() represents outputting 1 if the condition is met, and outputting 0 otherwise; represents a set of to-be-migrated microservices, o represents any one to-be-migrated microservice in the set represents a physical cluster, n represents any one physical node in the physical cluster; represents the remaining resource capacity of the physical node n with respect to the resource r; represents the required resource capacity of the to-be-migrated microservice o with respect to the resource r.
[0078] In the embodiment of the application, for calculating the migration overhead of the to-be-migrated microservice migrating from the source physical node to the candidate physical node, the migration time length of the to-be-migrated microservice migrating from the source physical node to the candidate physical node can be determined based on the total amount of to-be-migrated data of the to-be-migrated microservice and the data transmission speed, wherein the data transmission speed is the data transmission speed between the source physical node and the candidate physical node; and the migration overhead of the to-be-migrated microservice migrating from the source physical node to the candidate physical node can be determined according to the migration time length and the current number of live replicas of the to-be-migrated microservice.
[0079] In step S14, a target physical node satisfying a preset screening condition is determined from the candidate physical nodes according to the migration overhead, and the to-be-migrated microservice is migrated from the source physical node to the target physical node.
[0080] In the embodiment of the application, as shown in Figure 4 , for determining a target physical node satisfying a preset screening condition from the candidate physical nodes according to the migration overhead, the following steps can be included: determining a preset number of physical nodes with the smallest overhead from the candidate physical nodes according to the migration overhead, and determining the selection likelihoods of the preset number of physical nodes respectively corresponding to the stable performance and the remaining resource capacity of the preset number of physical nodes; judging the preset number of physical nodes in turn in the order of the selection likelihoods from large to small to determine a first target physical node satisfying the preset screening condition from the preset number of physical nodes; if the target physical node is not determined from the preset number of physical nodes this time, adjusting the preset screening condition, and jumping back to the step of judging the preset number of physical nodes in turn in the order of the selection likelihoods from large to small; if the cumulative adjustment times of the preset screening condition reach a preset number of times, determining the target physical node directly from the preset number of physical nodes based on a preset selection strategy; if the target physical node is determined from the preset number of physical nodes, triggering the step of migrating the to-be-migrated microservice from the source physical node to the target physical node.
[0081] For determining the selection likelihood of the preset number of physical nodes corresponding to the stable performance and the residual resource capacity of the preset number of physical nodes respectively, specifically, the stable performance vector corresponding to each physical node can be determined based on the P99 delay, SLO (Service Level Objective) deviation, access failure rate and other stable performance parameters of each physical node through a gated loop; the residual resource capacity vector corresponding to each physical node can be obtained by inputting the residual resource capacity corresponding to each physical node into a fully connected network which is contracted layer by layer; the stable performance vector and the residual resource capacity vector corresponding to each physical node are spliced and fused, and are subjected to a softmax activation function with a temperature parameter to finally determine the selection likelihood of each physical node.
[0082] In the embodiment of the application, the preset screening condition includes that the performance blocking weakening degree of the to-be-migrated microservice from the source physical node to the target physical node is not less than a preset degree, the migration estimated risk is not greater than a preset risk, and / or the migration evaluation coefficient determined based on the performance blocking weakening degree and the migration estimated risk is greater than a preset coefficient.
[0083] The determination process of the performance blocking weakening degree and the migration estimated risk can specifically include: determining a contribution degree difference based on the performance blocking contribution degrees of the to-be-migrated microservice to the source physical node and the target physical node respectively, and determining the performance blocking weakening degree according to the contribution degree difference and a preset migration delay; determining the migration estimated risk according to the used resources of the physical core and the cache group of the target physical node respectively.
[0084] For determining the performance blocking weakening degree according to the contribution degree difference and the preset migration delay, specifically, a first sum of the contribution degree difference and the preset migration delay can be calculated, and the first sum is adjusted by using a first preset weight to obtain the performance blocking weakening degree.
[0085] For determining the migration estimated risk according to the used resources of the physical core and the cache group of the target physical node respectively, specifically, a second sum of the used resources of the physical core and the cache group of the target physical node respectively can be calculated, and the second sum is adjusted by using a second preset weight to obtain the migration estimated risk.
[0086] According to one of the examples, for determining the migration estimated risk according to the used resources of the physical core and the cache group of the target physical node respectively, specifically, a third sum of the used resources of the last level cache in the physical core and the cache group of the target physical node respectively can be calculated, and the third sum is adjusted by using a third preset weight to obtain the migration estimated risk.
[0087] Correspondingly, for determining the target physical node directly from the preset number of physical nodes based on the preset selection strategy, specifically can include: from the preset number of physical nodes, determine the target physical node with the maximum performance blocking weakening degree.
[0088] Correspondingly, adjusting the preset screening condition, specifically can include reducing the preset degree, and / or increasing the preset risk.
[0089] In the embodiment of the application, for determining the migration evaluation coefficient based on the performance blocking weakening degree and the migration estimated risk, specifically can include:
[0090] The first channel (gain side) interfaces the input performance blocking weakening degree, adopts a three-layer progressive one-way gain network: the bottom layer introduces a linear mapping with bias limitation, which maps the performance blocking weakening degree to a high-dimensional positive half-space; the middle layer stacks several fully connected blocks with ReLU (Rectified Linear Unit) activation, and the weight matrix of each layer is subject to non-negative constraint in the training process, thereby ensuring the gradient propagation direction is always upward; the top layer applies Softplus activation for continuous amplification, and finally outputs the revenue estimate v1.
[0091] It should be noted that the weight matrix of the first channel is all hard-clipped to be non-negative, which ensures that the network only gives a positive response to the performance blocking weakening degree at any stage, and eliminates the negative revenue misjudgment caused by local minimum.
[0092] The second channel (penalty side) interfaces the input migration estimated risk, adopts a symmetric deep one-way penalty network: the bottom layer also uses a constrained linear mapping, but all weight matrices are limited to be non-positive; the middle layer stacks fully connected blocks with Leaky-ReLU activation, and through the negative weight matrix, the output of the second channel is reduced as the migration estimated risk increases; the top layer uses Softplus deactivation to smooth the negative trend, and finally outputs the penalty estimate v2.
[0093] It should be noted that the second channel realizes strict risk monotonicity through the non-positive constraint of the weight matrix, avoiding that the high-risk migration action (migration action refers to the action of migrating the microservice from the source physical node to other physical nodes) is misjudged as acceptable due to noise.
[0094] In the tail of the two paths, a learnable scaling gate m1 and m2 are inserted. The scaling gate outputs a value (0, 1) in the form of Sigmoid, which can adaptively adjust the weight ratio of gain attention and penalty attention according to the running stage: when link jitter occurs during business peak period, the system automatically increases m2, thereby increasing the penalty attention; when the microservice runs smoothly and the processor hotspot influence diffusion is obvious, m1 will be amplified, thereby increasing the gain attention, to encourage more aggressive migration action.
[0095] Finally, the gain and penalty estimates of the two paths are combined linearly to obtain the state value: V = m1 * v1 + m2 * v2. It should be noted that the state value is subtracted from the preset reference value to obtain the migration evaluation coefficient. Moreover, the preset coefficient can be set to 0.
[0096] In the embodiment of the application, after the target physical node is determined, the microservice to be migrated is suspended, and the microservice to be migrated is migrated from the source physical node to the target physical node, and a new CPU quota is configured for the microservice to be migrated in the target physical node. At the same time, the current live copy of the microservice to be migrated also needs to be migrated to the target physical node.
[0097] As can be seen, the present application can more accurately determine the microservice to be migrated that causes the processor hotspot diffusion of the source physical node from each microservice based on the microservice relationship graph, improve the determination accuracy of the microservice to be migrated, and through the two-stage determination of the candidate physical node and the target physical node, the calculation of the migration overhead of all physical nodes can be avoided, the amount of calculation is reduced, and further, the target physical node that meets the preset screening condition is determined from the candidate physical node according to the migration overhead, so as to migrate the microservice to be migrated that causes the processor hotspot diffusion from the source physical node to the target physical node under the condition of using smaller migration overhead, thereby realizing the governance of the processor hotspot diffusion of the source physical node, and improving the stability of the physical node.
[0098] Referring to Figure 5 The embodiment of the application discloses a microservice migration device for coping with processor hotspot diffusion, comprising:
[0099] The relationship graph construction module 11 is configured to determine target edges between each microservice based on the calling conditions of the microservices in the calling chain and the physical nodes where the microservices are located in the physical cluster, and construct a microservice relationship graph based on the microservices and the target edges;
[0100] The microservice determination module 12 is configured to determine a microservice to be migrated from each microservice based on the microservice relationship graph; wherein the microservice to be migrated is a microservice that causes the processor hotspot diffusion of a source physical node where the microservice to be migrated is located;
[0101] The migration overhead determination module 13 is configured to determine a candidate physical node corresponding to the microservice to be migrated from the physical cluster, and calculate migration overhead of the microservice to be migrated from the source physical node to the candidate physical node;
[0102] The microservice migration module 14 is configured to determine a target physical node satisfying a preset screening condition from the candidate physical node according to the migration overhead, and migrate the microservice to be migrated from the source physical node to the target physical node.
[0103] Therefore, the application can more accurately determine the microservice to be migrated causing the processor hotspot diffusion of the source physical node based on the microservice relationship graph, improve the determination accuracy of the microservice to be migrated, and avoid directly calculating the migration overhead of all physical nodes through the two-stage determination of the candidate physical node and the target physical node, thereby reducing the calculation amount. Further, the application determines the target physical node satisfying the preset screening condition from the candidate physical node according to the migration overhead, so as to migrate the microservice causing the processor hotspot diffusion from the source physical node to the target physical node using smaller migration overhead, thereby realizing the management of the processor hotspot diffusion of the source physical node and improving the stability of the physical node.
[0104] In some embodiments, the relationship graph construction module 11 comprises:
[0105] The directed edge determination unit is configured to determine a target directed edge between each microservice based on the calling sequence of each microservice in the calling chain, determine attribute parameters of each microservice based on the calling condition of each microservice, and bind the attribute parameters of the microservice to the target directed edge connected to the microservice; the attribute parameters of the microservice include the calling time consumption and the traffic rate of the microservice;
[0106] The undirected edge determination unit is configured to determine any two microservices located in the same physical node from each microservice, establish a target undirected edge between the any two microservices, and bind a parameter difference between performance parameters of the any two microservices to the target undirected edge; the intersection of physical cores where the any two microservices are located in the same physical node is a non-empty set, and the cache groups where the any two microservices are located in the same physical node are the same;
[0107] The relationship graph construction unit is configured to construct a microservice relationship graph based on each microservice and the target directed edge and the target undirected edge between each microservice.
[0108] In some embodiments, the microservice determination module 12 comprises:
[0109] The amplification coefficient determination unit is configured to acquire attribute parameters of each microservice from the microservice relationship diagram, and determine a parameter amplification coefficient of each microservice based on the attribute parameters of each microservice.
[0110] The microservice pair determination unit is configured to determine a microservice pair connected by the target undirected edge from the microservice relationship diagram, and acquire the parameter difference value corresponding to the microservice pair.
[0111] The first parameter determination unit is configured to determine a first performance blocking parameter of the same physical core based on the parameter difference value corresponding to the microservice pair on the same physical core, and determine a second performance blocking parameter of the same cache group based on the first performance blocking parameter of the physical core of the same cache group.
[0112] The second parameter determination unit is configured to determine the second performance blocking parameter corresponding to each microservice according to the cache group in which each microservice is located in the respective physical node.
[0113] The microservice determination unit is configured to determine the performance influence intensity corresponding to each microservice according to the second performance blocking parameter and the parameter amplification coefficient corresponding to each microservice, respectively, and determine a to-be-migrated microservice from each microservice based on the performance influence intensity corresponding to each microservice, respectively.
[0114] In some embodiments, the migration overhead determination module 13 comprises:
[0115] The first node determination unit is configured to determine a first physical node from the physical cluster based on a preset resource constraint; wherein the remaining resource capacity of the first physical node is not less than the resource capacity required by the to-be-migrated microservice.
[0116] The second node determination unit is configured to determine a second physical node from the physical cluster based on a preset migration constraint; wherein the round trip hop count between the source physical node and the second physical node of the to-be-migrated microservice according to the network topology relationship of the physical cluster is not greater than a preset hop count.
[0117] The candidate node determination unit is configured to determine the intersection of the first physical node and the second physical node to obtain the candidate physical node corresponding to the to-be-migrated microservice.
[0118] In some embodiments, the migration overhead determination module 13 comprises:
[0119] The migration duration determination unit is configured to determine a migration duration of the to-be-migrated microservice from the source physical node to the candidate physical node based on a total amount of to-be-migrated data of the to-be-migrated microservice and a data transmission speed between the source physical node and the candidate physical node.
[0120] The migration overhead determination unit is configured to determine a migration overhead of the to-be-migrated microservice from the source physical node to the candidate physical node according to the migration duration and a current number of live replicas of the to-be-migrated microservice.
[0121] In some embodiments, the microservice migration module 14 includes:
[0122] The possibility determination unit is configured to determine a preset number of physical nodes with minimum overhead from the candidate physical nodes according to the migration overhead, and determine selection likelihoods of the preset number of physical nodes respectively corresponding to stable performance and residual resource capacity of the preset number of physical nodes respectively corresponding to the stable performance and the residual resource capacity.
[0123] The target node determination unit is configured to determine a first target physical node that meets a preset screening condition from the preset number of physical nodes in a sequence of the selection likelihoods from large to small.
[0124] The step jump unit is configured to adjust the preset screening condition and jump back to the step of determining the preset number of physical nodes in the sequence of the selection likelihoods from large to small if the target physical node is not determined from the preset number of physical nodes.
[0125] The node selection unit is configured to determine the target physical node from the preset number of physical nodes directly based on a preset selection strategy if a cumulative adjustment frequency of the preset screening condition reaches a preset frequency.
[0126] The step triggering unit is configured to trigger the step of migrating the to-be-migrated microservice from the source physical node to the target physical node if the target physical node is determined from the preset number of physical nodes.
[0127] In some embodiments, the preset screening condition includes that a performance block weakening degree of the to-be-migrated microservice from the source physical node to the target physical node is not less than a preset degree, a migration estimation risk is not greater than a preset risk, and / or a migration evaluation coefficient determined based on the performance block weakening degree and the migration estimation risk is greater than a preset coefficient.
[0128] The performance blocking weakening degree and the migration estimation risk in the microservice migration device for coping with processor hotspot diffusion are determined by the following process:
[0129] The weakening degree determination unit is configured to determine a contribution difference based on the performance blocking contribution degrees of the to-be-migrated microservice to the source physical node and the target physical node respectively, and determine the performance blocking weakening degree based on the contribution difference and a preset migration delay.
[0130] The estimation risk determination unit is configured to determine the migration estimation risk based on the used resources of the local physical core and cache group of the target physical node respectively.
[0131] Correspondingly, the node selection unit comprises:
[0132] The third node determination unit is configured to determine the target physical node with the maximum performance blocking weakening degree from the preset number of physical nodes.
[0133] Further, the embodiment of the present application also discloses an electronic device, Figure 6 The electronic device 20 is shown in the structure diagram according to an exemplary embodiment, and the content in the diagram cannot be considered as any limitation on the use range of the present application.
[0134] Figure 6 A structure diagram of an electronic device 20 is provided in the embodiment of the present application. The electronic device 20 specifically can comprise at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25 and a communication bus 26. The memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to realize the related steps in the microservice migration method for coping with processor hotspot diffusion disclosed in any of the preceding embodiments. In addition, the electronic device 20 in the embodiment can be an electronic computer.
[0135] In the embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol followed by the communication interface 24 can be any communication protocol applicable to the technical solution of the present application, which is not limited here; the input / output interface 25 is used to obtain external input data or output data to the outside, and the specific interface type can be selected according to the specific application needs, which is not limited here.
[0136] In addition, the memory 22 can be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc. as a carrier for storing resources, and the resources stored thereon can include an operating system 221, a computer program 222, etc. The storage mode can be temporary storage or permanent storage.
[0137] The operating system 221 is used to manage and control each hardware device on the electronic device 20 and the computer program 222, and can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program capable of completing the micro-service migration method for coping with processor hotspot diffusion disclosed in any of the preceding embodiments and executed by the electronic device 20, the computer program 222 can further include a computer program capable of completing other specific work.
[0138] Further, the present application also discloses a computer readable storage medium for storing a computer program, wherein the computer program is executed by a processor to implement the micro-service migration method for coping with processor hotspot diffusion disclosed in the preceding embodiments. For the specific steps of the method, reference can be made to the corresponding content disclosed in the preceding embodiments, which will not be described here.
[0139] The embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. For the same or similar parts between the embodiments, reference can be made to each other. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and reference can be made to the method part.
[0140] The skilled person can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized by electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in the above description in general. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0141] The steps of the method or algorithm described in combination with the embodiments disclosed herein can be directly implemented by hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0142] Finally, it needs to be pointed out that in this document, relational terms such as first and second and the like can only be intended to distinguish one entity or operation from another entity or operation without necessarily requiring or implying any actual such relationship or order between such entities or operations. Moreover, the terms "comprising", "including", or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without more limitations, an element defined by the statement "comprising a" does not exclude the existence of additional identical elements in the process, method, article, or apparatus including the stated element.
[0143] The above detailed description of the technical solutions provided by the present application has been provided, and the principles and implementation modes of the present application have been described by applying specific examples. The above description of the examples is only for the purpose of helping to understand the method of the present application and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed, and the above description of the content of the specification should not be understood as a limitation of the present application.
Claims
1. A microservice migration method for addressing processor hotspot diffusion, characterized in that, include: Based on the call status of each microservice in the call chain and the physical node where the microservice is located in the physical cluster, the target edge between each microservice is determined, and a microservice relationship graph is constructed based on the microservice and the target edge. Based on the microservice relationship graph, the microservice to be migrated is determined from each of the microservices; wherein, the microservice to be migrated is the microservice that causes the spread of processor hotspots on the source physical node where the microservice to be migrated is located; Determine the candidate physical nodes corresponding to the microservice to be migrated from the physical cluster, and calculate the migration cost of migrating the microservice to be migrated from the source physical node to the candidate physical node; Based on the migration cost, a target physical node that meets the preset screening conditions is determined from the candidate physical nodes, and the microservice to be migrated is migrated from the source physical node to the target physical node.
2. The microservice migration method for addressing processor hotspot diffusion according to claim 1, characterized in that, The process of determining target edges between microservices based on the call status of each microservice in the call chain and the physical node of each microservice in the physical cluster, and constructing a microservice relationship graph based on the microservices and the target edges, includes: Based on the sequential invocation order of each microservice in the call chain, target directed edges between each microservice are determined, and attribute parameters of each microservice are determined based on the invocation status of each microservice. The attribute parameters of each microservice are then bound to the target directed edges connected to the microservice. The attribute parameters of the microservice include the invocation time and traffic multiplier of the microservice. From the microservices, identify any two microservices located on the same physical node, establish a target undirected edge between the two microservices, and bind the parameter difference between the performance parameters of the two microservices to the target undirected edge; the intersection of the physical cores where the two microservices are located in the same physical node is a non-empty set, and they are in the same cache group in the same physical node. A microservice relationship graph is constructed based on each microservice and the target directed edges and target undirected edges between each microservice.
3. The microservice migration method for addressing processor hotspot diffusion according to claim 2, characterized in that, The step of determining the microservices to be migrated from the microservices based on the microservice relationship graph includes: Obtain the attribute parameters of each microservice from the microservice relationship graph, and determine the parameter amplification coefficient of each microservice based on the attribute parameters of each microservice; From the microservice relationship graph, determine the microservice pair that adopts the target undirected edge connection, and obtain the parameter difference corresponding to the microservice pair; Based on the parameter differences corresponding to the microservices on the same physical core, a first performance blocking parameter for the same physical core is determined, and based on the first performance blocking parameter for the physical cores of the same cache group, a second performance blocking parameter for the same cache group is determined. The second performance blocking parameter corresponding to each microservice is determined based on the cache group in which each microservice is located in its respective physical node; Based on the second performance blocking parameter and the parameter amplification coefficient corresponding to each microservice, the performance impact intensity corresponding to each microservice is determined, and based on the performance impact intensity corresponding to each microservice, the microservice to be migrated is determined from each microservice.
4. The microservice migration method for addressing processor hotspot diffusion according to claim 1, characterized in that, The step of determining the candidate physical node corresponding to the microservice to be migrated from the physical cluster includes: A first physical node is determined from the physical cluster based on preset resource constraints; wherein the remaining resource capacity of the first physical node is not less than the resource capacity required by the microservice to be migrated. A second physical node is determined from the physical cluster based on preset migration constraints; wherein, the number of round-trip hops between the source physical node and the second physical node of the microservice to be migrated is not greater than a preset number of hops according to the network topology of the physical cluster. The intersection of the first physical node and the second physical node is determined to obtain the candidate physical nodes corresponding to the microservice to be migrated.
5. The microservice migration method for addressing processor hotspot diffusion according to claim 1, characterized in that, The calculation of the migration cost of the microservice to be migrated from the source physical node to the candidate physical node includes: Based on the total amount of data to be migrated and the data transmission speed of the microservice to be migrated, the migration time of the microservice to be migrated from the source physical node to the candidate physical node is determined; the data transmission speed is the data transmission speed between the source physical node and the candidate physical node. Based on the migration duration and the current number of live replicas of the microservice to be migrated, the migration cost of migrating the microservice to be migrated from the source physical node to the candidate physical node is determined.
6. The microservice migration method for addressing processor hotspot diffusion according to any one of claims 1 to 5, characterized in that, The step of determining the target physical node that meets the preset screening conditions from the candidate physical nodes based on the migration cost includes: Based on the migration overhead, a preset number of physical nodes with the lowest overhead are determined from the candidate physical nodes, and the selection probability corresponding to the preset number of physical nodes is determined based on the stability performance and remaining resource capacity of the preset number of physical nodes respectively. The preset number of physical nodes are judged sequentially in descending order of the selection probability, so as to determine the first target physical node that meets the preset screening conditions from the preset number of physical nodes. If the target physical node is not determined from the preset number of physical nodes in this step, the preset filtering conditions are adjusted, and the process jumps back to the step of judging the preset number of physical nodes in descending order of the probability of selection. If the cumulative number of adjustments to the preset filtering conditions reaches the preset number, the target physical node is directly determined from the preset number of physical nodes based on the preset selection strategy. If the target physical node is determined from the preset number of physical nodes, the step of migrating the microservice to be migrated from the source physical node to the target physical node is triggered.
7. The microservice migration method for addressing processor hotspot diffusion according to claim 6, characterized in that, The preset screening conditions include that the performance blocking attenuation degree of the microservice to be migrated from the source physical node to the target physical node is not less than a preset degree and the estimated migration risk is not greater than a preset risk, and / or that the migration evaluation coefficient determined based on the performance blocking attenuation degree and the estimated migration risk is greater than a preset coefficient. The process of determining the degree of performance blocking attenuation and the migration prediction risk includes: Based on the performance blocking contribution of the microservice to be migrated to the source physical node and the target physical node respectively, the contribution difference is determined, and the degree of performance blocking reduction is determined according to the contribution difference and the preset migration delay. The migration risk is determined based on the used resources of the target physical node for its local physical core and cache group. Accordingly, determining the target physical node directly from the preset number of physical nodes based on a preset selection strategy includes: From the preset number of physical nodes, determine the target physical node with the greatest performance blocking attenuation.
8. A microservice migration device for addressing processor hotspot propagation, characterized in that, include: The relationship graph construction module is used to determine the target edge between each microservice based on the call status of each microservice in the call chain and the physical node where the microservice is located in the physical cluster, and to construct a microservice relationship graph based on the microservice and the target edge. The microservice determination module is used to determine the microservice to be migrated from each of the microservices based on the microservice relationship graph; wherein the microservice to be migrated is the microservice that causes the processor hotspot spread of the source physical node where the microservice to be migrated is located; The migration cost determination module is used to determine the candidate physical node corresponding to the microservice to be migrated from the physical cluster, and calculate the migration cost of migrating the microservice to be migrated from the source physical node to the candidate physical node. The microservice migration module is used to determine the target physical node that meets the preset screening conditions from the candidate physical nodes according to the migration cost, and migrate the microservice to be migrated from the source physical node to the target physical node.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the microservice migration method for addressing processor hotspot proliferation as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, Used to store computer programs, which, when executed by a processor, implement the microservice migration method for addressing processor hotspot proliferation as described in any one of claims 1 to 7.