Workload preheating method and device based on service grid

By configuring the correspondence between load ratio and preheating time in the service grid, the problem of unstable flow control during the preheating process of newly built workloads in microservices is solved, and the stable introduction of traffic is achieved, avoiding the problem of excessive load. , ensuring the stable operation of microservices.

CN114244898BActive Publication Date: 2024-12-10ALIBABA (CHINA) CO LTD
1 Cites 0 Cited by

Patent Information

Application Number
CN202111357500.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-16
Publication Date
2024-12-10
Estimated Expiration
2041-11-16

AI Technical Summary

Technical Problem

In the microservice architecture, it is difficult to effectively control traffic during the preheating process, resulting in traffic introduction too fast and exceeding the load capacity of the application service instance, which may lead to microservice shutdown or crash.

Method used

By configuring warm-up rules in the service mesh, defining the correspondence between the load ratio of the application service instance and the preheating time, the service mesh agent instance manages the traffic flowing into the application service instance according to the warm-up rules, and gradually introduces traffic to avoid overloading Heavy.

Benefits of technology

Stable control of traffic transmission speed, so that application service instances gradually adapt to their own load capacity, avoid the problem of traffic exceeding load capacity, and ensure the stable operation of microservices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114244898B_ABST
    Figure CN114244898B_ABST
Patent Text Reader

Abstract

One or more embodiments of the present specification provide a workload preheating method and device based on a service grid. The method includes: in response to detecting a new workload created for a microservice, configuring a preheating rule for the new workload; the new workload includes an application service instance corresponding to the microservice and a service grid proxy instance corresponding to the service grid; the preheating rule is used to define the corresponding relationship between the load ratio of the application service instance and the preheating duration, and the preheating duration is positively correlated with the load ratio; the preheating rule is sent to the service grid proxy instance so that the service grid proxy instance manages the traffic flowing into the application service instance according to the preheating rule.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of the present specification relate to the field of terminal technology, and in particular, to a method and device for preheating a workload based on a service grid. Background Art

[0002] Service Mesh refers to a configurable infrastructure layer for microservice applications, and microservice applications refer to applications deployed using the microservice architecture. In the microservice architecture, each function of a microservice application is split into separate microservices for deployment. After deployment, each microservice can share data through the service mesh, thereby jointly realizing the functions of the entire microservice application.

[0003] In practical applications, it is necessary to create a workload for microservices to process the acquired traffic through the workload. However, in the process of preheating the newly created workload, the related technology is difficult to effectively control the traffic introduced into the newly created workload, and it is very easy to exceed the load capacity of the workload. Summary of the invention

[0004] In view of this, one or more embodiments of the present specification provide a method and apparatus for preheating a workload based on a service grid.

[0005] To achieve the above objectives, one or more embodiments of this specification provide the following technical solutions:

[0006] According to a first aspect of one or more embodiments of this specification, a workload preheating method based on a service grid is proposed, comprising:

[0007] In response to detecting a new workload created for a microservice, configuring a preheating rule for the new workload; the new workload includes an application service instance corresponding to the microservice and a service grid proxy instance corresponding to the service grid; the preheating rule is used to define a corresponding relationship between a load ratio of the application service instance and a preheating duration, and the preheating duration is positively correlated with the load ratio;

[0008] The preheating rule is sent to the service grid proxy instance so that the service grid proxy instance manages the traffic flowing into the application service instance according to the preheating rule.

[0009] According to a second aspect of one or more embodiments of this specification, a workload preheating method based on a service grid is proposed, including:

[0010] Receive a preheating rule configured for a newly created workload, wherein the newly created workload includes an application service instance corresponding to a microservice and a service grid proxy instance corresponding to the service grid; wherein the preheating rule is used to define a corresponding relationship between a load ratio of the application service instance and a preheating duration, and the preheating duration is positively correlated with the load ratio;

[0011] The traffic flowing into the application service instance is managed according to the preheating rule.

[0012] According to a third aspect of one or more embodiments of this specification, a workload preheating device based on a service grid is proposed, including:

[0013] A configuration unit, in response to detecting a new workload created for a microservice, configures a preheating rule for the new workload; the new workload includes an application service instance corresponding to the microservice and a service grid proxy instance corresponding to the service grid; the preheating rule is used to define a corresponding relationship between a load ratio of the application service instance and a preheating duration, and the preheating duration is positively correlated with the load ratio;

[0014] The issuing unit issues the preheating rule to the service grid proxy instance, so that the service grid proxy instance manages the traffic flowing into the application service instance according to the preheating rule.

[0015] According to a fourth aspect of one or more embodiments of this specification, a workload preheating device based on a service grid is proposed, including:

[0016] A receiving unit receives a preheating rule configured for a newly created workload, wherein the newly created workload includes an application service instance corresponding to a microservice and a service grid proxy instance corresponding to the service grid; wherein the preheating rule is used to define a corresponding relationship between a load ratio of the application service instance and a preheating duration, and the preheating duration is positively correlated with the load ratio;

[0017] A management unit manages the traffic flowing into the application service instance according to the preheating rule.

[0018] According to a fifth aspect of one or more embodiments of this specification, an electronic device is provided, including:

[0019] processor;

[0020] a memory for storing processor-executable instructions;

[0021] The processor implements the method as described in any one of the first aspect or the second aspect by running the executable instructions.

[0022] According to a sixth aspect of one or more embodiments of the present specification, a computer-readable storage medium is provided, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in any one of the first aspect or the second aspect are implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 This is a schematic diagram of the logical architecture of a service grid provided by an exemplary embodiment.

[0024] Figure 2 It is a flowchart of a workload preheating method based on a service grid provided by an exemplary embodiment.

[0025] Figure 3 It is a flowchart of another service grid-based workload preheating method provided by an exemplary embodiment.

[0026] Figure 4 A logical interaction diagram for gradually warming up a newly created workload is provided by an exemplary embodiment.

[0027] Figure 5 It is a structural schematic diagram of a device provided by an exemplary embodiment.

[0028] Figure 6 It is a block diagram of a workload preheating device based on a service grid provided by an exemplary embodiment.

[0029] Figure 7 It is a block diagram of another service grid-based workload preheating device provided by an exemplary embodiment. DETAILED DESCRIPTION

[0030] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.

[0031] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.

[0032] Applications deployed based on the microservice architecture are called microservice applications. When deploying microservice applications, the functions that the microservice application can provide are usually split into separate microservices for deployment. This allows developers to upgrade a function of the microservice application by simply modifying the corresponding microservice without having to redeploy the entire application.

[0033] Service Mesh refers to a configurable infrastructure layer that can provide network communication services for each microservice contained in a microservice application. Specifically, from a logical level, it can be abstracted into the following Figure 1 The control layer and data layer shown in the figure. The control layer can be used to control and manage each microservice in the data layer; each microservice in the data layer can contain several workloads, each of which contains an application service instance and a service mesh proxy instance. In actual applications, it is the workloads in the microservices that provide processing resources to implement the corresponding functions. In any workload, the application service instance it contains carries the traffic processing task, and the service mesh proxy instance is used to control the process of introducing traffic into the application service instance.

[0034] In the related art, if a new workload is created in a microservice, the new workload needs to be preheated first so that it can enter a stable working state. However, when preheating the new workload, it is difficult to effectively control the traffic in the related art, and it is very easy to introduce traffic too quickly, resulting in exceeding the load capacity of the application service instance.

[0035] For example, developers found during testing and actual use that for any microservice in a microservice application, if the newly created workload is not preheated, the processing time required for the newly created workload to process the first received request will inevitably exceed the normal value, reaching hundreds of ms or even 1s. In microservices, a timeout period is usually set, which can easily cause the processing time to exceed the timeout period, thereby causing the microservice to shut down. To this end, developers proposed a preheating solution for microservice applications. Specifically, after a new workload is created for a microservice, the new workload can call all redundant processing resources to process traffic, thereby preheating the new workload. However, in this method, the speed at which the new workload introduces traffic to the application service instance through the service grid proxy instance depends on the redundant processing resources (such as CPU resources), which is a long-term fluctuating value. As a result, although the speed of traffic introduction can be controlled, the control is extremely unstable, and there is still a situation where traffic is introduced too quickly, resulting in exceeding the load capacity of the application service instance, and then the microservice is shut down, or even the microservice application crashes.

[0036] In response to the above technical problems, this specification proposes a workload preheating method based on a service grid. When a new workload is created for a microservice, the method can preheat the new workload according to preconfigured preheating rules, avoiding the situation in the related technology where the load capacity of the application service instance is exceeded due to unstable control of traffic introduction speed during the preheating process.

[0037] Figure 2 FIG. 1 is a flowchart of a workload preheating method based on a service grid, shown in an exemplary embodiment of this specification. Figure 2 As shown, the method may include the following steps:

[0038] Step 202, in response to detecting a new workload created for a microservice, configure a preheating rule for the new workload; the new workload includes an application service instance corresponding to the microservice and a service grid proxy instance corresponding to the service grid; the preheating rule is used to define a corresponding relationship between a load ratio of the application service instance and a preheating duration, and the preheating duration is positively correlated with the load ratio.

[0039] In this specification, developers can deploy microservices for implementing different functions at different nodes in advance. For example, if the microservice application to be deployed is an instant messaging application, microservice A for providing text input function can be deployed, microservice B for providing message receiving function can be deployed, and microservice C for providing voice input function can be deployed. On this basis, if a certain upgrade of the instant messaging application is to improve the accuracy of its voice recognition, only microservice C can be upgraded without redeploying the entire instant messaging application. It should be stated that the node used to deploy microservices can be either a physical device or a virtual device created after virtualizing the cloud processing resources on the cloud platform. The node can be understood as a carrier for deploying microservices. How to select the carrier for deploying microservices can be determined by technicians in this field according to actual conditions, and this specification does not limit this.

[0040] In this specification, the control layer of the service grid can monitor each microservice in the data layer to determine whether a new workload is created for the microservice in the data layer. In the case of detecting that a new workload is created for the microservice, a preheating rule can be configured for the new workload. Among them, the preheating rule is used to define the corresponding relationship between the load ratio and the preheating time of the application service instance in the new workload, and the preheating time in the preheating rule is positively correlated with the load ratio. On this basis, the control layer can send the preheating rule to the service grid proxy instance in the new workload, so that the service grid proxy instance introduces traffic into the application service instance of the new workload according to the preheating rule, thereby realizing the preheating of the new workload. Of course, it is also possible not to determine whether a new workload is created for the microservice by monitoring the control layer, but in the case of creating a new workload for the microservice, the data layer can actively report the message of creating a new workload.

[0041] It should be understood that since the service grid proxy instance in this specification controls the traffic entering the application service instance according to the correspondence between the load ratio and the preheating time specified in the preheating rules, the service grid can stably control the speed of introducing traffic into the application service instance, avoiding the problem of exceeding the load capacity due to the difficulty in stably controlling the introduction of traffic into the application service instance in related technologies.

[0042] In practical applications, this specification can pre-deploy a set of preheating rules in the control layer, and the set of preheating rules includes several preheating rules that match different attribute information, wherein each preheating rule includes several sets of corresponding relationships between load ratios and preheating durations. In the actual configuration process, those skilled in the art can configure preheating rules for workloads with different attribute information respectively, so as to ensure the preheating effect of the newly created workload in the process of introducing traffic to the application service instance according to the preheating rules.

[0043] After the preheating rule set is deployed, the control layer can obtain the attribute information of the new workload when detecting that a new workload is created for the microservice, and determine the target preheating rule that matches the attribute information in the preconfigured preheating rule set. The target preheating rule is sent to the service grid proxy instance of the new workload, so that the service grid proxy instance can introduce traffic to the application service instance according to the corresponding relationship between the load ratio and the preheating duration specified in the received target preheating rule to preheat the new workload.

[0044] For example, if it is detected that a new workload is created for microservice C, the attribute information of the new workload can be obtained to determine the target preheating rule that matches the new workload. In practical applications, the attribute information can include multiple aspects of information. For example, the attribute information can include at least one of the following: version information of the microservice, type information of the microservice, real-time hardware load information of the controlled end, type information of the workload itself, and version information of the workload itself. Specifically, what kind of information the attribute information is can be determined by those skilled in the art according to actual conditions, and this specification does not limit this.

[0045] In this specification, the microservice may be upgraded during use, which may cause the newly created workload to be updated accordingly. Therefore, this specification may also monitor the attribute information of the newly created workload, and in the case where the attribute information changes, re-determine the preheating rule that matches the changed attribute information in the preheating rule set, and then send the re-determined preheating rule to the service grid proxy instance, so that the service grid proxy instance can introduce traffic into the application service instance according to the corresponding relationship between the load ratio and the preheating time specified in the received preheating rule, and then re-preheat the newly created workload. In this way, it is avoided that the introduced traffic exceeds the load capacity of the application service instance due to the failure to re-preheat the newly created workload after it is updated.

[0046] Step 204: Send the preheating rule to the service grid proxy instance so that the service grid proxy instance manages the traffic flowing into the application service instance according to the preheating rule.

[0047] In this specification, different types of traffic can be used to preheat a newly created workload in different situations.

[0048] As mentioned above, for any microservice, it usually contains at least one workload in order to provide the corresponding service. In this specification, the workload that originally exists in the microservice can be referred to as the original workload. In one case, at least a portion of the traffic carried by the application service instance contained in the original workload can be used as the traffic for preheating the newly created workload, that is, the service grid proxy service in the newly created workload can introduce this at least a portion of the traffic into the application service instance of the newly created workload according to the configured preheating rules. In another case, new traffic that is unrelated to the original workload can also be used as traffic for preheating the newly created workload, that is, the service grid proxy service in the newly created workload can introduce new traffic that is unrelated to the original workload, such as traffic obtained from the network, into the application service instance in the newly created workload according to the configured preheating rules.

[0049] It should be understood that when the traffic in the original workload is used as the traffic for preheating the newly created workload, it is equivalent to sharing the load pressure of the original workload with the newly created workload, that is, load balancing is performed between the original workload and the newly created workload, avoiding the problem of affecting the traffic processing efficiency due to excessive load pressure of the original workload.

[0050] In this specification, the service grid proxy instance can control the traffic size so that the load ratio of the application service instance at different running times meets the configured preheating rules.

[0051] In one case, when the running time of the application service instance reaches any preheating time defined in the preheating rule, the service grid proxy instance can adjust the size of the traffic introduced to the application service instance so that the load ratio of the application service instance meets the load ratio corresponding to the any preheating time defined in the preheating rule. In other words, in this case, the running time reaching any preheating time is used as the trigger condition for "adjusting the load ratio in the application service instance to the load ratio corresponding to the any time in the preheating rule", that is, when any preheating time is reached, the traffic size is adjusted so that the actual load ratio gradually reaches the load ratio corresponding to the any preheating time.

[0052] In another case, when the running time of the application service instance reaches any preheating time defined in the preheating rule, the service grid proxy instance can adjust the size of the traffic introduced to the application service instance so that when the running time of the application service instance reaches the next preheating time, its actual load ratio meets the load ratio corresponding to the next preheating time defined in the preheating rule. In other words, in this case, the running time reaching any preheating time is used as the trigger condition for "adjusting the load ratio in the application service instance to the load ratio corresponding to the next preheating time of any preheating time in the preheating rule", that is, when any preheating time is reached, the traffic size is adjusted so that the actual load ratio gradually reaches the load ratio corresponding to the next preheating time.

[0053] It can be seen from the above technical solution that the control layer in the service grid in this specification, when detecting that a new workload has been created for a microservice, will preferentially configure a preheating rule for the new workload, so that the service grid proxy instance in the new workload can gradually introduce traffic into the application service instance of the new workload according to the correspondence between the preheating time and the load ratio contained in the preheating rule. It should be understood that since this specification gradually introduces traffic into the application service instance of the new workload according to the preheating rule, it is obviously able to stably control the transmission speed of the traffic, thereby enabling the application service instance to gradually adapt to its own load capacity, avoiding the situation in the related art where the traffic introduced exceeds the load capacity of the application service instance due to too fast traffic introduction (since the load capacity of the new workload is provided by the application service instance it contains, it can also be referred to as the load capacity of the new workload as mentioned above).

[0054] Furthermore, this specification can also configure a preheating rule set, wherein the preheating rule set includes several preheating rules that match different attribute information, and each preheating rule includes several groups of correspondences between preheating durations and load ratios. On this basis, when the control layer detects that a new workload has been created for a microservice, it can obtain the attribute information of the new workload to configure preheating rules that match its attribute information. In this way, this specification can configure targeted preheating rules for workloads with different attribute information, thereby ensuring the effect of preheating the new workload based on the preheating rules.

[0055] As mentioned above, the related art allows the newly created workload to call all processing resources within the available range for preheating, so that the speed of introducing traffic to the application service instance of the newly created workload by the service grid proxy instance depends on its available processing resources, which is not stable and controllable, and it is also very easy to exceed the load capacity of the newly created workload, thereby causing the application to crash. In this specification, as mentioned above, the speed of traffic entering the application service instance can be stably controlled, which can obviously solve the situation in the related art that the speed of traffic introduction cannot be stably controlled, resulting in exceeding the load capacity of the newly created workload. In addition, in the above-mentioned processing method of the related art, the code for preheating the newly created workload is written in the program code of the microservice application, which is an intrusive code. In the technical solution of this specification, the newly created workload is preheated through the preheating rules deployed in advance, and there is no need to implant the code for preheating into the program code of the microservice application. It is a non-intrusive code and is suitable for multi-language and multi-framework scenarios.

[0056] In this specification, another workload preheating method based on service grid is also disclosed. This method is applied to the service grid proxy instance included in the new workload created for the microservice. Figure 3 It should be noted that in this method, most of the operation modes, such as how to configure the preheating rules and how to introduce traffic into the application service instance of the newly created workload, are similar to those in the previous embodiment, except that the execution subject is changed to the service grid proxy instance. The specific method can be referred to the introduction of the previous embodiment, and will not be repeated in the next embodiment.

[0057] Figure 3 FIG. 1 is a flowchart of another service grid-based workload preheating method shown in an exemplary embodiment of this specification. Figure 3 As shown, the method may include the following steps:

[0058] Step 302, receiving a preheating rule configured for a newly created workload, wherein the newly created workload includes an application service instance corresponding to a microservice and a service grid proxy instance corresponding to the service grid; wherein the preheating rule is used to define a corresponding relationship between a load ratio of the application service instance and a preheating duration, and the preheating duration is positively correlated with the load ratio.

[0059] As described above, a new workload can be created for a microservice at the data layer to improve the service capabilities of the microservice or expand the service scope. On this basis, the control layer can configure a preheating rule for the new workload, so that the service grid proxy instance in the new workload can introduce traffic to the application service instance of the new workload according to the correspondence between the preheating time and the load ratio specified in the preheating rule, thereby achieving preheating of the new workload.

[0060] As described above, the present specification can deploy a preheating rule set at the control layer, and the preheating rule set includes several preheating rules matching different attribute information, wherein each preheating rule includes several sets of corresponding relationships between load ratios and preheating durations. In the actual configuration process, those skilled in the art can configure preheating rules for workloads with different attribute information respectively, so as to ensure the preheating effect of the newly created workload in the process of introducing traffic to the application service instance of the newly created workload according to the preheating rules.

[0061] In actual applications, the control layer can monitor whether a new workload is created for the microservice in the data layer, and when detected, actively request the attribute information of the new workload from the data layer, and determine the preheating rule that matches the acquired attribute information from the preheating rule set, and then return the determined preheating rule to the service grid proxy instance included in the new workload. On this basis, the service grid proxy instance can introduce traffic into the application service instance of the new workload according to the correspondence between the preheating time and the load ratio defined in the received preheating rule, so as to realize the preheating of the new workload; of course, after the new workload is created for the microservice, the data layer can actively upload the attribute information of the new workload to the control layer, so as to match the preheating rule in the preheating rule set deployed in the control layer. Specifically, how to configure the preheating rule for the new workload can be determined by those skilled in the art according to actual needs, and this specification does not limit this.

[0062] Step 304: manage the traffic flowing into the application service instance according to the preheating rule.

[0063] As described above, when it is detected that the attribute information of the newly created workload has changed, the data layer can also upload the changed attribute information to the control layer, so as to determine the preheating rule that matches the changed attribute information in the preheating rule set deployed by the control layer, and return the matched preheating rule; accordingly, after receiving the preheating rule returned by the control layer according to the changed attribute information, the service grid proxy instance in the newly created workload can introduce traffic into the application service instance of the newly created workload according to the corresponding relationship between the load ratio and the preheating time specified in the preheating rule, so as to re-preheat the newly created workload. In this way, it is avoided that the introduced traffic exceeds the load capacity of the newly created workload due to the failure to re-preheat the newly created workload after it is updated.

[0064] As mentioned above, for any microservice, it usually contains at least one workload in order to provide the corresponding service. In this specification, the workload that originally exists in the microservice can be referred to as the original workload. In one case, at least a portion of the traffic carried by the application service instance contained in the original workload can be used as the traffic for preheating the newly created workload, that is, the service grid proxy service in the newly created workload can introduce this at least a portion of the traffic into the application service instance in the newly created workload according to the configured preheating rules. In another case, new traffic that is unrelated to the original workload can also be used as traffic for preheating the newly created workload, that is, the service grid proxy service in the newly created workload can introduce new traffic that is unrelated to the original workload, such as traffic obtained from the network, into the application service instance in the newly created workload according to the configured preheating rules.

[0065] As described above, the service mesh proxy instance can control the traffic size so that the load ratio of the application service instance at different running times meets the configured preheating rules.

[0066] In one case, when the running time of the application service instance reaches any preheating time defined in the preheating rule, the service grid proxy instance can adjust the size of the traffic introduced to the application service instance so that the load ratio of the application service instance meets the load ratio corresponding to any preheating time defined in the preheating rule. In another case, when the running time of the application service instance reaches any preheating time defined in the preheating rule, the service grid proxy instance can adjust the size of the traffic introduced to the application service instance so that when the running time of the application service instance reaches the next preheating time, its actual load ratio meets the load ratio corresponding to the next preheating time defined in the preheating rule.

[0067] It can be seen from the above technical solution that the control layer in the service grid in this specification, when detecting that a new workload has been created for a microservice, will preferentially configure a preheating rule for the new workload, so that the service grid proxy instance in the new workload can gradually introduce traffic into the application service instance of the new workload according to the correspondence between the preheating time and the load ratio contained in the preheating rule. It should be understood that since this specification gradually introduces traffic into the application service instance of the new workload according to the preheating rule, it is obviously able to stably control the transmission speed of the traffic, thereby enabling the application service instance to gradually adapt to its own load capacity, avoiding the situation in the related technology where the introduced traffic exceeds the load capacity of the application service instance due to the too fast introduction of traffic.

[0068] Next, we take a cloud-native application built on the microservice framework Kubernetes as an example to create a new workload for a microservice in the cloud-native application. Figure 4 This article introduces how to implement progressive preheating control on the newly created workload through the technical solution of this specification. In this embodiment, the cloud-native application is deployed based on the microservice architecture, so it can be regarded as the microservice application described above. In addition, this embodiment can integrate any service grid into the above-mentioned Kubernetes to achieve control and management of cloud-native applications. For example, the service grid can be either of the two service grids, Istio or Linkerd, in the related technology. Which service grid to use can be determined by technicians in this field according to actual needs, and this specification does not limit this.

[0069] Figure 4FIG. 1 is a logical interaction diagram for gradually warming up a newly created workload, as shown in an exemplary embodiment of this specification. Figure 4 As shown, the method may include the following steps:

[0070] Step 401: The warm-up rule controller instructs the workload controller to monitor the workload in the data layer.

[0071] In this embodiment, several controllers may be deployed in the control layer to control the execution of various instructions. Figure 4 The preheating rule controller, workload controller, attribute information listener, and preheating rule configurator are shown.

[0072] After completing the deployment of the controller, developers can input the specific content of the preheating rule set into the preheating rule controller through the cloud-native declarative API, and then complete the deployment of the preheating rule set in the control layer.

[0073] After the deployment of the preheating rule set is completed, the preheating rule controller can instruct the workload controller to monitor the workload in the data layer to determine whether a new workload is created in the data layer.

[0074] In actual applications, when a microservice needs to expand its service scope or enhance its service capabilities, a new workload can be created for the microservice. Specifically, the microservice source code pre-deployed in the data layer can be called and a new workload can be created based on the source code.

[0075] For example, the cloud native application may be an instant messaging application, and the microservice targeted by this embodiment may be microservice X for providing voice input function in the instant messaging application. Assuming that the developer currently wants to improve the voice recognition accuracy of the instant messaging application, a new workload can be created based on the source code of microservice X pre-deployed in the data layer. If the original workload contained in microservice X is: load a; then the workload created at this time may be load b.

[0076] Step 402: When the workload controller detects that a new workload is created in the data layer, it instructs the attribute information listener to obtain attribute information of the new workload.

[0077] When the workload controller detects that a new workload has been created, it can inform the attribute information listener of the information so that it can obtain the attribute information of the new workload from the data layer. In this embodiment, the version and type information of the microservice to which the new workload belongs can be used as the attribute information of the new workload.

[0078] Continuing with the above example, assume that the type information of microservice X is: voice class; and the version information is: version 10.1. Then, the attribute information listener can obtain the attribute information of "voice class, version 10.1" from the data layer.

[0079] Step 403: the attribute information listener uploads the acquired attribute information to the preheating rule controller.

[0080] After the attribute information listener obtains the attribute information of the newly created workload, the attribute information can be uploaded to the preheating rule controller so that the preheating rule can be matched for the newly created workload.

[0081] Step 404 : The preheating rule controller matches the target preheating rule in the pre-deployed preheating rule set according to the received attribute information.

[0082] After receiving the attribute information, the preheating rule controller can determine the target preheating rule matching the attribute information from the pre-deployed preheating rule set.

[0083] Following the above example, the preheating rules pre-configured in the control terminal can be shown in Table 1 below:

[0084]

[0085] Table 1

[0086] Then, the preheating rule controller can match the target preheating rule of "10s / 30%, 20s / 50%, 30s / 65%...70s / 88%, 80s / 96%, 90s / 100%" from the preheating rule set shown in the above table according to the attribute information of "voice class, version 10.1", and send and configure the target preheating rule in the service grid proxy instance b' of load b.

[0087] Step 405: The preheating rule controller instructs the preheating rule configurator to issue and configure the target preheating rule in the service grid proxy instance of the newly created workload.

[0088] After deployment, the target warm-up rule code in the service grid proxy instance can be as follows:

[0089] warmupDuration:[10,20,30…70,80,90];

[0090] warmupWeight:[30,50,65…88,96,100].

[0091] Among them, warmupDuration represents the preheating duration, and warmupWeight represents the load ratio.

[0092] Step 406, the service grid proxy instance directs traffic to the application service instance according to the target warm-up rule.

[0093] In this embodiment, after the service grid proxy instance completes the deployment of the target preheating rule, the traffic can be introduced into the application service instance according to the target preheating rule to preheat the newly created workload.

[0094] Continuing with the above example, when the service mesh proxy instance b' in load b gradually introduces traffic to the application service instance b" of load b, it should ensure that when the preheating time reaches 10 seconds, the load ratio in the application service instance b" is 20%; when the preheating time reaches 20 seconds, the load ratio in the application service instance b" is 50%; when the preheating time reaches 30 seconds, the load ratio in the application service instance b" is 65%; until the preheating time reaches 90 seconds, the load ratio in the application service instance b" reaches 100%.

[0095] It should be noted that the traffic introduced into application service instance b" can come from the network or from the original workload of microservice X. Specifically, assuming that load a includes application service instance a" and service mesh proxy instance a', when the traffic used for preheating comes from load a, service mesh proxy instance a' and service mesh proxy instance b' can interact to transmit traffic from application service instance a" to application service instance b".

[0096] In the case of transferring traffic from application service instance a'' to application service instance b'', the setting code in service grid proxy instance b'' may be as follows:

[0097] kind:Pod

[0098] app:httpbin

[0099] category:primary ....

[0101] kind:Pod

[0102] app:httpbin

[0103] category:canary

[0104] In the above code, httpbin is the label of the above cloud native application, primary is used to represent the original workload, and canary is used to represent the new workload. The whole code is used to represent the traffic obtained from the original workload to preheat the new workload.

[0105] In the actual code running, the load weights of the original workload and the newly created workload are also recorded when each warm-up time is reached. Specifically, assume that load a continues to obtain traffic from the network while transmitting traffic to load b, so that it always maintains a full load state, that is, the load ratio is 100%. Then, the load weights of load a and load b in the entire application can be as follows:

[0106] When the preheating time reaches 10 seconds, the load ratio of load b is 20%, the load weight of load a in the entire application is "100% / (100%+20%)=83.3%", and the load weight of load b in the entire application is "20% / (100%+20%)=16.7%". At this time, the load weight recorded by the code can be as follows:

[0107] subset:primary

[0108] weight:83.3

[0109] subset:canary

[0110] Weight:16.7

[0111] When the preheating time reaches 20 seconds, the load ratio of load b is 50%, the load weight of load a in the entire application is "100% / (100%+50%)=66.7%", and the load weight of load b in the entire application is "50% / (100%+50%)=33.3%". At this time, the load weight recorded by the code can be as follows:

[0112] subset:primary

[0113] Weight:66.7

[0114] subset:canary

[0115] weight:33.3

[0116] When the preheating time reaches 30 seconds, the load proportion in load b is 65%, the load weight of load a in the entire application is "100% / (100%+65%)=60.6%", and the load weight of load b in the entire application is "65% / (100%+65%)=39.4%". At this time, the load weight recorded by the code refers to the above example and will not be repeated here.

[0117] When the preheating time reaches the 90th second, the load proportion in load b reaches 100%, and the load weights of load a and load b in the entire application are both "100% / (100%+100%)=50%". At this time, the load weight recorded by the code can also refer to the above example, which will not be repeated here.

[0118] In the above code, the concept of Pod is also mentioned. In fact, both application service instances and service mesh proxy instances need to be hosted in the corresponding operating environment during actual operation, and the operating environment is usually provided by the corresponding container. Different containers can form a container group, which is called a Pod in the Kubernetes framework. Taking the above load a and load b as examples, both are workloads created for microservice X, then the application service instance a” and service mesh proxy instance a' in load a, and the application service instance b” and service mesh proxy instance b' in load b all need to be hosted in the corresponding containers to run. Assume that application service instance a” is hosted in container 1, service mesh proxy instance a' is hosted in container 2, application service instance b” is hosted in container 3, and service mesh proxy instance b' is hosted in container 4. Then, containers 1, 2, 3, and 4 can be combined into several Pods as needed. Normally, since multiple containers in the same Pod share the same IP, container 1 and container 2 will be arranged in the same Pod, such as container 1 and container 2 together forming Pod1, to ensure that traffic can be introduced into application service instance a" through service mesh proxy instance a'; accordingly, container 3 and container 4 can be arranged in the same Pod, such as container 3 and container 4 together forming Pod2, to ensure that traffic can be introduced into application service instance b" through service mesh proxy instance b'. Of course, this example is only illustrative, and how to deploy containers for each application service instance and service mesh proxy instance can be determined by those skilled in the art according to instance requirements, and this embodiment does not limit this.

[0119] It can be seen from the above technical solution that, through the technical solution of this embodiment, when a new workload is created for a microservice in the data layer, the attribute information of the new workload can be uploaded to the control layer, so that the preheating rule controller in the control layer can determine the preheating rule that matches the new workload from the preconfigured preheating rule set according to the attribute information. The matched preheating rule will be returned to the service grid proxy instance in the new workload, so that the service grid proxy instance can gradually introduce the traffic into the application service instance of the new workload according to the correspondence between the preheating time and the load ratio specified in the preheating rule, thereby realizing the preheating of the new workload. In this way, the traffic can gradually enter the application service instance of the new workload, avoiding the problem of the difficulty in stably controlling the speed of introducing the traffic into the new workload in the related technology, and exceeding the load capacity.

[0120] Figure 5 is a schematic structural diagram of a device provided by an exemplary embodiment. Figure 5 At the hardware level, the device includes a processor 502, an internal bus 504, a network interface 506, a memory 508, and a non-volatile memory 510, and may also include hardware required for other functions. One or more embodiments of this specification may be implemented based on software, such as the processor 502 reading the corresponding computer program from the non-volatile memory 510 into the memory 508 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0121] Please refer to Figure 6 , the workload preheating device based on service grid can be applied to Figure 5 In the device shown in the figure, the technical solution of this specification is implemented. Among them, the workload preheating device based on the service grid may include:

[0122] The configuration unit 601 configures a preheating rule for the newly created workload in response to detecting a newly created workload created for a microservice; the newly created workload includes an application service instance corresponding to the microservice and a service grid proxy instance corresponding to the service grid; the preheating rule is used to define a corresponding relationship between a load ratio of the application service instance and a preheating duration, and the preheating duration is positively correlated with the load ratio;

[0123] The issuing unit 602 issues the preheating rule to the service grid proxy instance, so that the service grid proxy instance manages the traffic flowing into the application service instance according to the preheating rule.

[0124] Optionally, the configuration unit 601 is further configured to:

[0125] Obtaining attribute information of the newly created workload;

[0126] A target preheating rule matching the attribute information is determined in a preset preheating rule set for configuring the newly created workload.

[0127] Optionally, the preheating rule is used to enable the service grid proxy instance to:

[0128] At least a portion of the traffic carried by the application service instance in the original workload is shared to the application service instance in the newly created workload according to the preheating rule; or,

[0129] New traffic that is unrelated to the original workload is introduced into the application service instance in the newly created workload according to the preheating rule.

[0130] Optionally, the preheating rule is used to enable the service grid proxy instance to:

[0131] When the running time of the application service instance reaches any preheating time defined in the preheating rule, adjust the size of the traffic introduced to the application service instance so that the load ratio of the application service instance conforms to the load ratio corresponding to any preheating time defined in the preheating rule.

[0132] Please refer to Figure 7 , the workload preheating device based on service grid can be applied to Figure 5 In the device shown in the figure, the technical solution of this specification is implemented. Among them, the workload preheating device based on the service grid may include:

[0133] A receiving unit 701 receives a preheating rule configured for a newly created workload, wherein the newly created workload includes an application service instance corresponding to a microservice and a service grid proxy instance corresponding to the service grid; wherein the preheating rule is used to define a corresponding relationship between a load ratio of the application service instance and a preheating duration, and the preheating duration is positively correlated with the load ratio;

[0134] The management unit 702 manages the traffic flowing into the application service instance according to the preheating rule.

[0135] Optionally, the management unit 702 is further configured to:

[0136] At least a portion of the traffic carried by the application service instance in the original workload is shared to the application service instance in the newly created workload according to the preheating rule; or,

[0137] New traffic that is unrelated to the original workload is introduced into the application service instance in the newly created workload according to the preheating rule.

[0138] Optionally, the management unit 702 is further configured to:

[0139] When the running time of the application service instance reaches any preheating time defined in the preheating rule, adjust the size of the traffic introduced to the application service instance so that the load ratio of the application service instance conforms to the load ratio corresponding to any preheating time defined in the preheating rule.

[0140] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.

[0141] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0142] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0143] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0144] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0145] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0146] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0147] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0148] The above description is merely a preferred embodiment of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of protection of one or more embodiments of the present specification.

Claims

1. A workload preheating method based on service grid, It is characterized in that include: In response to detecting a new workload created for a microservice, a preheating rule is configured for the new workload; the new workload includes an application service instance corresponding to the microservice and a service grid proxy instance corresponding to the service grid; the preheating rule is used to define a corresponding relationship between a load ratio of the application service instance and a preheating duration, and the preheating duration is positively correlated with the load ratio; the preheating rule is used to enable the service grid proxy instance to adjust the size of the traffic introduced to the application service instance when the running time of the application service instance reaches any preheating duration defined in the preheating rule, so that the load ratio of the application service instance meets the load ratio corresponding to any preheating duration defined in the preheating rule; The preheating rule is sent to the service grid proxy instance so that the service grid proxy instance manages the traffic flowing into the application service instance according to the preheating rule.

2. The method according to claim 1, It is characterized in that The configuring a preheating rule for the newly created workload includes: Obtaining attribute information of the newly created workload; A target preheating rule matching the attribute information is determined in a preset preheating rule set for configuring the newly created workload.

3. The method according to claim 1, It is characterized in that The warmup rule is used to enable the service mesh proxy instance to: At least a portion of the traffic carried by the application service instance in the original workload is shared to the application service instance in the newly created workload according to the preheating rule; or, New traffic that is unrelated to the original workload is introduced into the application service instance in the newly created workload according to the preheating rule.

4. A workload preheating method based on service grid, It is characterized in that include: Receive a preheating rule configured for a newly created workload, wherein the newly created workload includes an application service instance corresponding to a microservice and a service grid proxy instance corresponding to the service grid; wherein the preheating rule is used to define a corresponding relationship between a load ratio of the application service instance and a preheating duration, and the preheating duration is positively correlated with the load ratio; Managing the traffic flowing into the application service instance according to the preheating rule includes: when the running time of the application service instance reaches any preheating time defined in the preheating rule, adjusting the size of the traffic introduced to the application service instance so that the load ratio of the application service instance conforms to the load ratio corresponding to any preheating time defined in the preheating rule.

5. The method according to claim 4, It is characterized in that The managing the flow of traffic into the application service instance according to the preheating rule includes: At least a portion of the traffic carried by the application service instance in the original workload is shared to the application service instance in the newly created workload according to the preheating rule; or, New traffic that is unrelated to the original workload is introduced into the application service instance in the newly created workload according to the preheating rule.

6. A workload preheating device based on service grid, It is characterized in that include: A configuration unit, in response to detecting a new workload created for a microservice, configures a preheating rule for the new workload; the new workload includes an application service instance corresponding to the microservice and a service grid proxy instance corresponding to the service grid; the preheating rule is used to define a corresponding relationship between a load ratio of the application service instance and a preheating duration, and the preheating duration is positively correlated with the load ratio; the preheating rule is used to enable the service grid proxy instance to adjust the size of the traffic introduced to the application service instance when the running time of the application service instance reaches any preheating duration defined in the preheating rule, so that the load ratio of the application service instance meets the load ratio corresponding to any preheating duration defined in the preheating rule; The issuing unit issues the preheating rule to the service grid proxy instance, so that the service grid proxy instance manages the traffic flowing into the application service instance according to the preheating rule.

7. A workload preheating device based on service grid, It is characterized in that include: A receiving unit receives a preheating rule configured for a newly created workload, wherein the newly created workload includes an application service instance corresponding to a microservice and a service grid proxy instance corresponding to the service grid; wherein the preheating rule is used to define a corresponding relationship between a load ratio of the application service instance and a preheating duration, and the preheating duration is positively correlated with the load ratio; A management unit manages the traffic flowing into the application service instance according to the preheating rule, including: when the running time of the application service instance reaches any preheating time defined in the preheating rule, adjusting the size of the traffic introduced to the application service instance so that the load ratio of the application service instance conforms to the load ratio corresponding to any preheating time defined in the preheating rule.

8. An electronic device, It is characterized in that include: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 5 by running the executable instructions.

9. A computer-readable storage medium having computer instructions stored thereon, It is characterized in that When the instruction is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Request allocation method and device thereof, electronic equipment and readable storage medium

    CN112449005A