Instance scheduling method, data processing system, device, medium and product

By using the CPU clock count value of the forwarding instance in user mode to determine the CPU utilization and generate accurate scaling instructions, the problem of inaccurate load judgment in the existing technology is solved, and the resource utilization and performance of the data processing cluster are optimized.

CN119356885BActive Publication Date: 2025-10-14ALIBABA CLOUD COMPUTING CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411918655.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-10-14
Estimated Expiration
2044-12-24

AI Technical Summary

Technical Problem

Existing technologies are unable to accurately generate scaling instructions, resulting in inaccurate instance load judgments and affecting the performance and resource utilization of data processing clusters.

Method used

The CPU utilization is determined by counting the CPU clocks of the forwarding instances running in user mode, generating accurate scaling instructions.

Benefits of technology

Improves the accuracy of scaling forwarding instances and optimizes resource utilization and performance of data processing clusters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356885B_ABST
    Figure CN119356885B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide an instance scheduling method, a data processing system, a device, a medium and a product, wherein a data processing cluster is composed of worker nodes, a forwarding instance responsible for data forwarding is run in the worker nodes, and the forwarding instance runs in a user mode. For the data processing cluster, the method comprises: determining the real CPU utilization of the forwarding instance running in the user mode according to a CPU clock count value of the forwarding instance in the worker node, and further determining whether to generate an expansion or contraction instruction based on the CPU utilization. If the expansion or contraction instruction is generated, the forwarding instance in the data processing cluster is expanded or contracted by executing the instruction. In the above method, for the forwarding instance running in the user mode, the CPU utilization reflecting the real load condition of the forwarding instance can be directly determined by means of the CPU clock count value, thereby improving the accuracy of the expansion or contraction of the forwarding instance.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of network communication, and in particular to an instance scheduling method, a data processing system, an apparatus, a medium and a product. BACKGROUND

[0002] In practice, a certain number of instances can be deployed in a physical device by means of virtualization technology, and network communication can be performed between different instances deployed in different physical devices. Moreover, along with the change of data volume in the network, the load of the instances can also change accordingly, at which time, the instances in the physical device can also be scaled up or down, i.e. capacity expansion or contraction. The load of the instance can be reflected by at least one of the central processing unit (CPU) utilization, memory usage, network card usage, etc. of the instance.

[0003] Based on the above description, how to generate accurate capacity expansion or contraction instructions becomes a problem to be solved urgently. SUMMARY

[0004] Therefore, embodiments of the present application provide an instance scheduling method, a data processing system, an apparatus, a medium and a product to generate accurate capacity expansion or contraction instructions.

[0005] In a first aspect, embodiments of the present application provide an instance scheduling method, comprising:

[0006] determining the CPU utilization of the forwarding instance according to the CPU clock count value of the forwarding instance running in the user mode;

[0007] determining whether to generate a capacity expansion or contraction instruction according to the CPU utilization;

[0008] if the capacity expansion or contraction instruction is generated, performing capacity expansion or contraction of the forwarding instance for the data processing cluster containing the worker node according to the capacity expansion or contraction instruction.

[0009] In a second aspect, embodiments of the present application provide a data processing system, comprising: a data processing cluster and a scheduling platform, wherein the worker node in the data processing cluster comprises a forwarding instance running in a user mode;

[0010] the forwarding instance is configured to determine the CPU utilization of the forwarding instance according to the CPU clock count value of the forwarding instance;

[0011] the scheduling platform is configured to obtain the CPU utilization of the forwarding instance, determine whether to generate a capacity expansion or contraction instruction according to the CPU utilization, and if the capacity expansion or contraction instruction is generated, perform capacity expansion or contraction of the forwarding instance for the data processing cluster according to the capacity expansion or contraction instruction.

[0012] In a third aspect, an electronic device is provided, which includes a processor and a memory, the memory being configured to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the instance scheduling method in the first aspect. The electronic device can further include a communication interface configured to communicate with other devices or communication systems.

[0013] In a fourth aspect, a non-transitory machine-readable storage medium is provided, which stores executable code, and when the executable code is executed by a processor of an electronic device, the processor can at least implement the instance scheduling method in the first aspect.

[0014] In a fifth aspect, a computer program product is provided, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the processor can implement the instance scheduling method in the first aspect.

[0015] The data processing cluster can be composed of worker nodes, and a forwarding instance responsible for data forwarding can run in the worker nodes, and the forwarding instance runs in a user mode. The method and system provided by the embodiments of the present application can be used to implement scaling of the forwarding instance running in the user mode in the data processing cluster. In the method provided by the embodiments of the present application, the scheduling platform can determine the CPU utilization of the forwarding instance running in the user mode according to the CPU clock count value of the forwarding instance in the worker node, and determine whether to generate a scaling instruction based on the CPU utilization. If the scaling instruction is generated, the scaling instruction can be executed to scale the forwarding instance in the data processing cluster.

[0016] The traditional CPU utilization collection method can depend on the kernel calling of the instance, but for the forwarding instance running in the user mode, the forwarding instance performs data processing in the user mode, and the data processing does not pass through the kernel. Therefore, the traditional collection method cannot know the real CPU utilization inside the forwarding instance.

[0017] In the above method, for the forwarding instance running in the user mode, the scheduling platform can determine the CPU utilization of the forwarding instance by using the CPU clock count value of the forwarding instance. Although the forwarding instance running in the user mode does not pass through the kernel in the data processing process, the entire flow of the data processing can be accompanied by the change of the CPU clock count value. Therefore, the CPU utilization determined by using the CPU clock count value can accurately reflect the real load inside the forwarding instance, and the accuracy of the scaling of the forwarding instance can be improved. BRIEF DESCRIPTION OF DRAWINGS

[0018] 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 described below are some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.

[0019] Figure 1 A flow chart of an example scheduling method provided for the embodiments of the present application;

[0020] Figure 2 A flow chart of a CPU utilization rate determination method provided for the embodiments of the present application;

[0021] Figure 3 A flow chart of another example scheduling method provided for the embodiments of the present application;

[0022] Figure 4 A structural schematic diagram of a data processing system provided for the embodiments of the present application;

[0023] Figure 5 A structural schematic diagram of another data processing system provided for the embodiments of the present application;

[0024] Figure 6 A structural schematic diagram of still another data processing system provided for the embodiments of the present application;

[0025] Figure 7 A schematic diagram of a monitoring cluster acquiring a CPU utilization rate provided for the embodiments of the present application;

[0026] Figure 8 A structural schematic diagram of an example scheduling device provided for the embodiments of the present application;

[0027] Figure 9 A structural schematic diagram of an electronic device provided for the embodiments of the present application. DETAILED DESCRIPTION

[0028] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the following will combine the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are some 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 labor fall within the protection scope of the present application.

[0029] The terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the description of the application and the appended claims, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be understood that the terms "and / or," "at least one of," and "one or more of" as used herein refer to and encompass any one of the items in the list, any combination of two or more of the items in the list, and / or all of the items in the list.

[0030] It should be understood that the term "and / or" as used herein merely describes associated objects, and can represent three conditions: A and / or B, A or B, and A and B. In addition, the character " / " herein generally represents an "or" relationship between the front and rear associated objects.

[0031] Depending on the context, the word "if" as used herein can be interpreted to mean "when" or "upon" or "in response to determining" or "in response to identifying." Similarly, the phrase "if it is determined" or "if [a stated condition or event] is identified" can be interpreted to mean "upon determining" or "in response to determining" or "upon identifying [the stated condition or event]" or "in response to identifying [the stated condition or event]."

[0032] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation portal for user to choose authorization or refusal.

[0033] It should also be noted that the terms "comprising", "containing" or any other variant thereof are intended to cover non-exclusive inclusion, so that the goods or systems including a series of elements not only include those elements, but also include other elements not explicitly listed or inherent to such goods or systems. Without more limitation, the element defined by the sentence "including a" does not exclude the presence of other identical elements in the goods or systems including the element.

[0034] Based on the introduction in the background art, before the content provided by each embodiment of the present application is described in detail, the background of using the following embodiments of the present application can be introduced in more detail.

[0035] The examples mentioned in the background art can be forwarding instances for data processing and forwarding, and network communication can be achieved by means of different forwarding instances.

[0036] The data processed and forwarded by the forwarding instance can be a message generated by a user in the process of using a service provided by a service provider. Such a message generated in the process of using the service can be referred to as a data message, and the data message can be in the form of a data flow. The service provider can provide the service in the form of an application program or a cloud service. The data messages generated by using different services can belong to different data flows, and the contents contained in the data messages are different according to the service content. For example, when the service is cloud gaming, the data message can include game data; when the service is a cloud computing service, the data message can include a computing result. In addition, the plurality of forwarding instances in the communication network can also constitute a data processing cluster.

[0037] In addition, the number of data messages can also dynamically change in the process of using the service. At this time, the method or system provided by each embodiment of the present application can be used to generate accurate scaling instructions, and the use experience of the service can be ensured by scaling the forwarding instances in the data processing cluster.

[0038] Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features in the embodiments can be combined with each other without conflict. In addition, the sequence of steps in each method embodiment is only an example and is not strictly limited.

[0039] Figure 1 A flowchart of an example scheduling method provided by an embodiment of the present application. The method provided by the embodiment of the present application can be executed by a scheduling platform. As shown in the figure, the method can include the following steps: Figure 1

[0040] S101, determining the CPU utilization of the forwarding instance according to the CPU clock count value of the forwarding instance in the worker node, the forwarding instance running in the user mode.

[0041] For the forwarding instance mentioned in each embodiment of the present application, which is deployed in the tool node of the data processing cluster and runs in the user mode, the scheduling platform can obtain the CPU clock count value of the forwarding instance, and determine the CPU utilization of the forwarding instance according to the CPU clock count value.

[0042] The CPU clock count value can be the number of clock cycles of the CPU recorded by the internal counter of the CPU. The CPU clock count value can be continuously accumulated in different stages of processing data by the forwarding instance, so that one CPU clock count value corresponds to one timestamp. In addition, the complete processing process of the forwarding instance on the data can include a resource allocation stage, a data processing stage, and a resource recycling stage.

[0043] ​For the CPU utilization of the forwarding instance, an optional determination manner is that the scheduling platform can obtain a CPU clock count value at the beginning of the data processing stage, and obtain a CPU clock count value at the end of the data processing stage, and the difference between the two CPU clock count values is the time consumption of the data processing stage. It can be easily understood that the longer the time consumed by the forwarding instance for processing data, the greater the data processing pressure of the forwarding instance, and the higher the CPU utilization of the forwarding instance. Therefore, the time consumption can be used as an index for describing the CPU utilization of the forwarding instance.

[0044] The different stages mentioned above can be described as follows.

[0045] The resource allocation stage and the resource recycling stage can be considered as the preprocessing and subsequent processing of data processing, respectively. The resource allocation stage can be performed before the forwarding instance receives data. In this stage, the forwarding instance can be allocated with memory space, descriptors and memory identification bits. In addition, the forwarding instance can also be allocated with other resources required for receiving, processing and forwarding data, such as network resources, computing resources, etc.

[0046] In the data processing stage, the data can be obtained from the network card by using the allocated resources, and the data can be parsed and processed, and finally the processing result can be sent to the network card for forwarding by the network card. In this stage, the data read from the network card by the forwarding instance can be a large number of data packets in the form of data stream.

[0047] The resource recycling stage can be performed after the forwarding instance completes the forwarding of all data processing results. In this stage, the memory can be released, the descriptors can be released, and the memory identification bits can be reset. In addition, the forwarding instance can also recycle other various resources allocated to it.

[0048] In the embodiments of the present application, the forwarding instance running in the user mode can be used as any device with data forwarding capability in network communication processes, such as a gateway, a router, a switch, etc. Alternatively, the forwarding instance can also be a non-physical device with elastic scaling function obtained by means of virtualization technology, such as a cloud server (Elastic Compute Service, ECS) or a container (pod) created by using a container orchestration tool. The container orchestration tool can include Kubernetes (K8S), Docker Swarm, etc. When the forwarding instance is a container, the data processing cluster where the forwarding instance is located can be a container cluster, and the forwarding container can be deployed in a node in the cluster. When the forwarding instance is an ECS, the data processing cluster where the forwarding instance is located can be an ECS cluster.

[0049] S102, determining whether to generate the scale instruction according to the CPU utilization.

[0050] S103, if the scale instruction is generated, scaling the forwarding instance of the data processing cluster containing the worker node according to the scale instruction.

[0051] Further, the scheduling platform can determine whether to generate the scale-down instruction according to the CPU utilization.

[0052] Optionally, when the CPU utilization, i.e., the time consumption of the data processing stage, is not less than the first preset time length, the scheduling platform can generate and execute the scale-up instruction to scale up the forwarding instance of the data processing cluster. By scaling up, the CPU utilization of the forwarding instance in the data processing cluster before scaling up can be reduced, and the CPU utilization of the forwarding instance in the data processing cluster after scaling up can be ensured to be at a reasonable level.

[0053] Optionally, when the CPU utilization is not greater than the second preset time length, the scheduling platform can generate and execute the scale-down instruction to scale down the forwarding instance of the data processing cluster. By scaling down, the CPU utilization of the forwarding instance in the data processing cluster can be maintained at a reasonable level. Meanwhile, the resources used by the scaled-down forwarding instance can be used, and the released resources can be used for other purposes to improve the resource utilization of the physical device on which the forwarding instance is deployed. The first preset time length is greater than the second preset time length.

[0054] In this embodiment, the scheduling platform can determine the CPU utilization of the forwarding instance running in the user mode according to the CPU clock count value of the forwarding instance in the worker node, and determine whether to generate the scale instruction based on the CPU utilization. If the scale instruction is generated, the scale instruction can be executed to scale the forwarding instance in the data processing cluster.

[0055] The traditional CPU utilization collection method can rely on the kernel calling the instance, but for the forwarding instance running in the user mode, the data processing of the forwarding instance is performed in the user mode, and the data processing does not pass through the kernel. Therefore, the traditional collection method cannot know the real CPU utilization inside the forwarding instance.

[0056] In the above method, for the forwarding instance running in the user mode, the scheduling platform can determine the CPU utilization of the forwarding instance by using the CPU clock count value of the forwarding instance. Although the forwarding instance running in the user mode does not pass through the kernel in the data processing process, the entire flow of the data processing can be accompanied by the change of the CPU clock count value. Therefore, the CPU utilization determined by using the CPU clock count value can accurately reflect the real load inside the forwarding instance, and the accuracy of the scaling of the forwarding instance can be improved.

[0057] Figure 1 The embodiment shown introduces a way of determining CPU utilization according to CPU clock count value. In addition to this, another optional way of determining CPU utilization according to CPU clock count value can refer to the following Figure 2 embodiment.

[0058] Figure 2 A flow chart of a CPU utilization determination method provided for the embodiment is shown in the figure. The method is an optional specific implementation of step S101. As Figure 2 shown, the method can include the following steps:

[0059] S201, determining the occupation duration of the allocated resource by the forwarding instance according to the CPU clock count value of the forwarding instance.

[0060] S202, determining the processing duration required by the forwarding instance for data processing using the allocated resource according to the CPU clock count value of the forwarding instance.

[0061] S203, determining the CPU utilization of the forwarding instance according to the occupation duration and the processing duration.

[0062] According to the description in the Figure 1 embodiment, the complete processing process of data by the forwarding instance can include resource allocation phase, data processing phase and resource recycling phase. Before recycling the resource allocated to the forwarding instance, the forwarding instance is exclusive to the resource, so the duration from the beginning of the resource allocation phase to the end of the resource recycling phase can be considered as the duration of the complete processing process of data by the forwarding instance, and can also be considered as the occupation duration of the resource by the forwarding instance. At the same time, the duration required by the forwarding instance for data processing using the resource it occupies, i.e. the duration of the data processing phase, can be considered as the processing duration of data. It is easy to understand that the occupation duration is greater than the processing duration.

[0063] Optionally, the scheduling platform can determine the ratio between the processing duration and the occupation duration as an index describing the CPU utilization of the forwarding instance. The higher the ratio, the longer the processing duration, the more data processed by the forwarding instance, and the higher the CPU utilization of the forwarding instance.

[0064] For the occupation duration, an optional determination method is that the scheduling platform can obtain a first CPU clock count value of the forwarding instance at the beginning of the resource allocation phase. The scheduling platform can also obtain a second CPU clock count value of the forwarding instance after the end of the resource recycling phase. Finally, the scheduling platform can determine the difference between the first CPU clock count value and the second CPU clock count value as the occupation duration. The first CPU clock count value is less than the second CPU clock count value.

[0065] For the processing duration, an optional determination manner, the scheduling platform can obtain a third CPU clock count value of the forwarding instance when the data processing stage starts, that is, when the forwarding instance starts to process data. The scheduling platform can also obtain a fourth CPU clock count value of the forwarding instance after the data processing stage ends, that is, after the data processing result is forwarded out. Finally, the scheduling platform can determine the difference between the third CPU clock count value and the fourth CPU clock count value as the processing duration. The third CPU clock count value is less than the fourth CPU clock count value. Moreover, since the data processing stage occurs before the resource recycling stage, the second CPU clock count value is greater than the fourth CPU clock count value.

[0066] In this embodiment, the scheduling platform can determine the CPU utilization of the forwarding instance by calculating the ratio between the duration of the data processing stage and the duration of the complete processing of the data by the forwarding instance.

[0067] Optionally, in addition to determining whether to generate the scale-out / in instruction by using the CPU utilization, the scheduling platform can also comprehensively use the CPU utilization and the NIC utilization of the forwarding instance to determine whether to generate the scale-out / in instruction. Figure 3 Another flowchart of an example scheduling method provided by the embodiment of the application is shown in FIG. 6. As shown in FIG. 6, the method can include the following steps: Figure 3

[0068] S301, determining the CPU utilization of the forwarding instance according to the CPU clock count value of the forwarding instance in the worker node, the forwarding instance running in the user mode.

[0069] The specific implementation process of step S301 can refer to the related description in the embodiment shown in FIG. 3, which will not be repeated here. Figure 1

[0070] S302, obtaining the NIC utilization of the forwarding instance.

[0071] S303, determining whether to generate the scale-out / in instruction according to the CPU utilization and the NIC utilization.

[0072] The scheduling platform can directly obtain the NIC utilization of the forwarding instance by means of the system kernel, and comprehensively consider the NIC utilization and the CPU utilization to determine whether to generate the scale-out / in instruction.

[0073] ​​In one case, if the target utilization rate is not less than a first preset threshold corresponding to the target utilization rate, the scheduling platform can determine the number of to-be-expanded. The target utilization rate can be at least one of a network card utilization rate and a CPU utilization rate. That is, when the network card utilization rate is not less than a first preset threshold corresponding to the network card utilization rate and / or when the CPU utilization rate is not less than a first preset threshold corresponding to the CPU utilization rate, the scheduling platform can determine the number of to-be-expanded.

[0074] For the number of to-be-expanded, in one optional manner, the scheduling platform can obtain a difference between the target utilization rate and the first preset threshold, and a numerical interval in which the difference is located can correspond to a first target number, and the scheduling platform can determine the first target number as the number of to-be-expanded, and generate an expansion instruction containing the number of to-be-expanded. In this case, the target utilization rate can be at least one of a network card utilization rate and a CPU utilization rate, and the network card utilization rate and the CPU utilization rate have respective first preset thresholds.

[0075] In another optional manner, the scheduling platform can determine the number of to-be-expanded according to a difference between the target utilization rate and the first preset threshold and a number of forwarding instances in the current data processing cluster, and generate an expansion instruction containing the number of to-be-expanded. Optionally, the number of to-be-expanded can be determined by the following formula:

[0076]

[0077] Wherein, N represents the number of forwarding instances in the data processing cluster at the time of obtaining the utilization rate. i represents the i-th forwarding instance. C represents the number of CPUs in the data processing cluster, and one forwarding instance can contain at least one CPU or at least one network card. R represents the CPU utilization rate, and cidx represents the sequence value of the CPU, i.e., the cxid-th CPU. represents the first preset threshold corresponding to the CPU utilization rate. E represents the number of network cards in the data processing cluster. B represents the network card utilization rate. represents the first preset threshold corresponding to the network card utilization rate.

[0078] represents the average CPU utilization rate of the i-th forwarding instance, which is obtained by averaging the respective CPU utilization rates of all CPUs in the i-th forwarding instance.

[0079] represents the average CPU utilization rate of the entire data processing cluster, which is obtained by averaging the average CPU utilization rates of all forwarding instances.

[0080] represents the average network card utilization rate of the i-th forwarding instance, which is obtained by averaging the respective network card utilization rates of all network cards in the i-th forwarding instance.

[0081] The average network card utilization of all forwarding instances is averaged to obtain the average network card utilization of the entire data processing cluster.

[0082] In another case, if the target utilization is not greater than the second preset threshold corresponding to the target utilization, the scheduling platform can determine the number of instances to be scaled down. Similar to the above case, the target utilization can be at least one of the network card utilization and the CPU utilization. That is, when the network card utilization is not greater than the second preset threshold corresponding to the network card utilization and / or when the CPU utilization is not greater than the second preset threshold corresponding to the CPU utilization, the scheduling platform can determine the number of instances to be scaled down.

[0083] For the number of instances to be scaled down, in an optional manner, the scheduling platform can obtain the difference between the target utilization and the second preset threshold, and the numerical interval of the difference can correspond to the second target number. Then, the scheduling platform can determine the second target number as the number of instances to be scaled down, and generate a scaling-down instruction containing the number of instances to be scaled down.

[0084] In another optional manner, the scheduling platform can also determine the number of instances to be scaled down according to the difference between the target utilization and the second preset threshold and the number of forwarding instances in the current data processing cluster. The number of instances to be scaled down can be determined by the following formula:

[0085]

[0086] wherein, represents the second preset threshold corresponding to the CPU utilization. represents the second preset threshold corresponding to the network card utilization. is the preset minimum number of forwarding instances that the data processing cluster can contain, The meanings of other parameters in the above formula are the same as those of the related parameters in the above formula.

[0087] In the above case, the target utilization is at least one of the network card utilization and the CPU utilization, and the network card utilization and the CPU utilization each correspond to a second preset threshold. Moreover, the first preset threshold corresponding to the same kind of utilization is greater than the second preset threshold corresponding to the same kind of utilization.

[0088] It should be noted that the target utilization in the above two cases can be the same kind of utilization or different kinds of utilization.

[0089] S304, if the scaling-up / scale-down instruction is generated, the data processing cluster containing the worker node is scaled up / down in forwarding instances according to the scaling-up / scale-down instruction.

[0090] The specific implementation process of step S304 can be referred toFigure 1 The related description in the illustrated embodiments will not be repeated here.

[0091] In this embodiment, on the basis of CPU utilization, the scheduling platform can also comprehensively consider the network card utilization of the forwarding instance to determine the expansion and contraction instructions for the data processing cluster.

[0092] Based on Figure 2 When any one of the network card utilization and the CPU utilization is not greater than the second preset threshold, the scheduling platform can generate the contraction instruction in the content of the illustrated embodiments. However, after the contraction, the other utilization may be increased, and the scheduling platform needs to further generate the expansion instruction, which will cause the data processing cluster to be frequently expanded and contracted.

[0093] In order to reduce the frequency of expansion and contraction of the data processing cluster, if the target utilization of the CPU utilization and the network card utilization is not greater than the second preset threshold corresponding to the target utilization, the scheduling platform can determine the number of forwarding instances to be contracted. The specific determination method of the number of forwarding instances to be contracted can be referred to Figure 2 The description in the illustrated embodiments will not be repeated here. In this case, the target utilization is any one of the CPU utilization and the network card utilization.

[0094] After obtaining the number of forwarding instances to be contracted, the scheduling platform can also calculate the number of remaining forwarding instances included in the data processing cluster after contraction, and further determine the other utilization of the remaining forwarding instances when the remaining forwarding instances are used to process data. The number of remaining forwarding instances is the difference between the total number of forwarding instances in the data processing cluster and the number of forwarding instances to be contracted. The other utilization is the utilization other than the target utilization of the CPU utilization and the network card utilization. If the other utilization of the remaining forwarding instances is not greater than the second preset threshold corresponding to the other utilization, the scheduling platform can generate the contraction instruction containing the number of forwarding instances to be contracted. If the other utilization of the remaining forwarding instances is greater than the second preset threshold corresponding to the other utilization, the scheduling platform does not generate the expansion and contraction instruction, and keeps the number of forwarding instances in the data processing cluster unchanged.

[0095] For example, assuming that there are 10 worker nodes in the data processing cluster, and each worker node contains 5 forwarding instances. When the CPU utilization of more than the preset number of forwarding instances in the cluster is not greater than the second preset threshold corresponding to the CPU utilization, the scheduling platform can determine that the number to be scaled down is 5. Then, the scheduling platform can further determine the network card utilization of the remaining 45 forwarding instances if the data processing cluster is scaled down by 5 forwarding instances. If the network card utilization of the 45 forwarding instances is not greater than the second preset threshold corresponding to the network card utilization, the scheduling platform can generate a scaling instruction and execute the instruction to scale the forwarding instances in the data processing cluster to 45. If there is a network card utilization greater than the second preset threshold corresponding to the network card utilization in the 45 forwarding instances, the scheduling platform does not generate a scaling instruction.

[0096] In this embodiment, when any one of the network card utilization and the CPU utilization is not greater than the second preset threshold corresponding thereto, the scheduling platform can first determine the number to be scaled down, but at this time, no scaling instruction is generated, and the data processing cluster is not immediately scaled down. The scheduling platform can further estimate whether scaling down according to the number to be scaled down will cause other utilization of the forwarding instance to increase. If it will not cause other utilization to increase, a scaling instruction containing the number to be scaled down can be generated to scale the data processing cluster.

[0097] Alternatively, the scheduling platform can periodically monitor the CPU utilization and / or the network card utilization of the forwarding instance, and generate a corresponding scaling instruction according to the monitoring result to realize scheduling of the forwarding instance. When the current scheduling period is reached, the scheduling platform can generate a scaling instruction according to the manner provided by the above and the following embodiments of the application. After executing the scaling instruction, the scheduling platform can also record the number of forwarding instances in the data processing cluster after scaling, which corresponds to the current scheduling period. When the next scheduling period is reached, the scheduling platform can also determine the number to be scaled up or the number to be scaled down according to the number of forwarding instances in the current data processing cluster and the at least one utilization of the forwarding instance monitored.

[0098] The above Figures 1-3 The above

[0099] Figure 4 The embodiment of the application provides a data processing system. As shown in the figure, the system can specifically include a data processing cluster and a scheduling platform. Figure 4

[0100] Among them, the worker node in the data processing cluster includes a forwarding instance running in a user mode.

[0101] ​The specific working process of the system can be described as follows:

[0102] The forwarding instance in the data processing cluster is configured to process data and forward data processing results, and the data can include data packets in the form of data streams. Meanwhile, during the data processing and forwarding of the data processing results, the forwarding instance can read the CPU clock count value of the forwarding instance, and determine the CPU utilization of the forwarding instance based on the read CPU clock count value. The CPU utilization determined by the forwarding instance can be fed back to the scheduling platform. Then, the scheduling platform can determine whether to generate the scale instruction based on the CPU utilization. If the scheduling platform determines to generate the scale instruction, the data processing cluster can be scaled based on the scale instruction.

[0103] The specific calculation method of the CPU utilization can be referred to the related description in the embodiments shown in Figure 1 or Figure 2 , which will not be repeated here.

[0104] In this embodiment, the forwarding instance in the worker node can determine the CPU utilization of the forwarding instance running in the user mode based on the CPU clock count value of the forwarding instance. Then, the scheduling platform can determine whether to generate the scale instruction based on the CPU utilization. If the scale instruction is generated, the scale instruction can be executed to scale the forwarding instance in the data processing cluster.

[0105] The traditional CPU utilization collection method can rely on the kernel calling the instance, but for the forwarding instance running in the user mode, the data processing of the forwarding instance is performed in the user mode and does not pass through the kernel, so the traditional collection method cannot know the real CPU utilization inside the forwarding instance.

[0106] In the above method, for the forwarding instance running in the user mode, the forwarding instance can determine the CPU utilization of the forwarding instance based on the CPU clock count value of the forwarding instance. Although the forwarding instance running in the user mode does not pass through the kernel during data processing, the entire data processing process can be accompanied by the change of the CPU clock count value, so the CPU utilization determined based on the CPU clock count value can accurately reflect the real load inside the forwarding instance, and the accuracy of the scaling of the forwarding instance can be improved.

[0107] Figure 5 Another structural diagram of a data processing system is provided in the embodiments of the present application. As shown in Figure 5 , in Figure 4On the basis of the system shown, the scheduling platform in the system can specifically include a monitoring cluster and a central control subsystem. The data processing cluster and the monitoring cluster are located at the data plane of the data processing system, and the central control subsystem is located at the control plane of the data processing system.

[0108] The specific working process of the system can be further described in detail as follows:

[0109] The forwarding instance in the data processing cluster is used to process data and forward data processing results. The data can include data packets in the form of data streams. Meanwhile, in the process of data processing and forwarding of data processing results, the forwarding instance can also read the CPU clock count value of the forwarding instance and determine the CPU utilization of the forwarding instance through the read CPU clock count value. The CPU utilization determined by the forwarding instance can be further fed back to the monitoring cluster in the scheduling platform, so as to send the CPU utilization to the central control subsystem in the scheduling platform by the monitoring cluster. The central control subsystem can determine whether to generate the expansion and contraction instruction according to the CPU utilization sent by the monitoring cluster. If the expansion and contraction instruction is generated, the central control subsystem can expand or contract the forwarding instance of the data processing cluster according to the expansion and contraction instruction.

[0110] The specific calculation method of the CPU utilization can be referred to the related description in the embodiments shown in Figure 1 or Figure 2 herein.

[0111] In this embodiment, the forwarding instance in the scheduling node can determine the CPU utilization of the forwarding instance running in the user mode according to the CPU clock count value of the forwarding instance. Then, the central control subsystem in the scheduling platform can determine whether to generate the expansion and contraction instruction based on the CPU utilization. If the expansion and contraction instruction is generated, the expansion and contraction instruction can be executed to expand or contract the forwarding instance in the data processing cluster.

[0112] The traditional CPU utilization collection method can depend on the kernel calling of the instance. However, for the forwarding instance running in the user mode, the forwarding instance processes data in the user mode, and the data processing does not pass through the kernel. Therefore, the traditional collection method cannot know the real CPU utilization inside the forwarding instance.

[0113] In the above method, for the forwarding instance running in the user mode, the forwarding instance can determine the CPU utilization of the forwarding instance by using the CPU clock count value of the forwarding instance. Although the forwarding instance running in the user mode does not pass through the kernel in the data processing process, the whole flow of the data processing can be accompanied by the change of the CPU clock count value, and therefore, the CPU utilization determined by using the CPU clock count value can accurately reflect the real load condition inside the forwarding instance, and the accuracy of the expansion and contraction of the forwarding instance can be improved.

[0114] Figure 6 Another structure diagram of a data processing system is provided in the embodiment of the application. Figure 6 As shown in the structure diagram of the system, Figure 5 the forwarding instance in the system can specifically include a forwarding component and a statistical component.

[0115] The data forwarding capability of the forwarding instance can be provided by the forwarding component. As described in the embodiment shown in Figure 1 , the forwarding instance running in the user mode can be used as any device with data forwarding capability in the network communication process, such as a gateway, a router, a switch, etc.

[0116] The statistical component can determine the CPU utilization of the forwarding instance according to the CPU clock count value collected by the forwarding instance and according to the CPU clock count value collected. The specific calculation method of the CPU utilization can be referred to the related description in the embodiment shown in Figure 1 or Figure 2 , and will not be described here again.

[0117] In the embodiment, for the forwarding instance running in the user mode, the statistical component in the forwarding instance can directly determine the CPU utilization of the forwarding instance, that is, the CPU utilization is statistically determined in the data plane of the whole data processing system.

[0118] Optionally, the monitoring cluster in the embodiment can be distributedly deployed, and the target monitoring node in the monitoring cluster is responsible for acquiring the CPU utilization of the target working node in the data processing cluster, that is, the CPU utilization of the forwarding instance in the target working node can be collected by the target monitoring node. Optionally, the monitoring node can specifically acquire the CPU utilization determined by the statistical component by using the command line interface. The process in which the statistical component determines the CPU utilization and feeds back the CPU utilization to the monitoring node can also be combined with Figure 7 for understanding.

[0119] In the embodiment, since the monitoring cluster composed of the distributed monitoring nodes exists in the data processing system, when part of the monitoring nodes fail, other monitoring nodes can still obtain the CPU utilization of other forwarding instances, thereby improving the availability of the data processing system.

[0120] Optionally, the monitoring node can also obtain and send the NIC utilization of the forwarding instance to the central control subsystem, so that the central control subsystem generates the scale-in / out instruction based on the multiple utilizations.

[0121] Optionally, the data processing system can also include a utilization processing component. The component is configured to format the at least one utilization data obtained by the monitoring node to meet the input requirements of the central control subsystem.

[0122] Optionally, the central control subsystem can include a scheduling component and a controller.

[0123] The scheduling component can receive the utilization collected by the monitoring cluster and generate the scale-in / out instruction based on the received utilization. The scale-in instruction can include the number of instances to be scaled in, and the scale-out instruction can include the number of instances to be scaled out. The specific determination method of the number of instances to be scaled in or out can be referred to the description in the above related embodiments, which will not be repeated here.

[0124] The controller can execute the scale-in / out instruction generated by the scheduling component to scale in / out the forwarding instances in the data processing system.

[0125] Optionally, in the current scheduling period, after each component in the data processing system works cooperatively in the manner of the above embodiments, the scale-in or scale-out of the forwarding instances in the data processing cluster can be completed. According to the specific determination method of the number of instances to be scaled in or out, the scheduling component can determine the number of instances to be scaled in or out based on the number of forwarding instances in the current data processing cluster. Since the number of forwarding instances in the current data processing cluster is obtained after the scale-in / out instruction generated in the last scheduling period is executed, the number of forwarding instances in the current data processing cluster corresponds to the last scheduling period. Therefore, after the scheduling component generates the scale-in or scale-out instruction, the number of forwarding instances corresponding to the current scheduling period can also be recorded.

[0126] When the next scheduling period arrives, the scheduling component can generate a new scale-in / out instruction based on the utilization collected by the monitoring node and the number of forwarding instances corresponding to the current scheduling period.

[0127] Optionally, the scheduling component and / or the controller in the central management subsystem can also be distributed, so that when any scheduling component and / or the controller fails, the generation and execution of the scale instruction are not affected, and thus the availability of the data processing system can be improved.

[0128] In addition, details not described in the embodiments and the technical effects that can be achieved can be referred to the related descriptions in the embodiments shown in FIG. 1, and will not be described herein.

[0129] However, it should be noted that, according to the descriptions in the method embodiments of the present application, the scheduling platform can determine the CPU utilization of the forwarding instance according to the CPU clock count value. According to the descriptions in the system embodiments of the present application, the statistical component in the forwarding instance can determine the CPU utilization of the forwarding instance according to the CPU clock count value.

[0130] Optionally, the utilization can be determined by any of the scheduling platform and the forwarding instance, and thus the methods and systems provided in the embodiments of the present application are not conflicting.

[0131] Examples of the scheduling device of one or more embodiments of the present application will be described in detail below. Those skilled in the art can understand that the device can be configured by using commercially available hardware components through the steps taught by the present solution.

[0132] Figure 8 An example scheduling device provided by the embodiments of the present application is shown in the structure diagram. As shown in the figure, Figure 8 the device can include:

[0133] The utilization determination module 11 is configured to determine the CPU utilization of the forwarding instance according to the CPU clock count value of the forwarding instance in the work node, and the forwarding instance runs in the user mode.

[0134] The instruction generation module 12 is configured to determine whether to generate a scale instruction according to the CPU utilization.

[0135] The instruction execution module 13 is configured to perform scale of the forwarding instance on the data processing cluster containing the work node according to the scale instruction if the scale instruction is generated.

[0136] Optionally, the utilization determination module 11 is configured to determine the occupation duration of the allocated resource by the forwarding instance according to the CPU clock count value of the forwarding instance.

[0137] determine the processing duration required by the forwarding instance for data processing using the allocated resource according to the CPU clock count value of the forwarding instance.

[0138] According to the occupation time length and the processing time length, a CPU utilization of the forwarding instance is determined.

[0139] Optionally, the utilization determining module 11 is configured to acquire a first CPU clock count value of the forwarding instance when resources are allocated to the forwarding instance.

[0140] After the resources allocated to the forwarding instance are recycled, a second CPU clock count value of the forwarding instance is acquired.

[0141] A difference between the first CPU clock count value and the second CPU clock count value is determined as the occupation time length.

[0142] Optionally, the utilization determining module 11 is configured to acquire a third CPU clock count value of the forwarding instance when the forwarding instance processes data.

[0143] After the forwarding instance forwards a data processing result, a fourth CPU clock count value of the forwarding instance is acquired.

[0144] A difference between the third CPU clock count value and the fourth CPU clock count value is determined as the processing time length, and the second clock count value is greater than the fourth clock count value.

[0145] Optionally, the apparatus further includes a utilization acquiring module 14 configured to acquire a network card utilization of the forwarding instance.

[0146] The instruction generating module 12 is configured to determine whether to generate an expansion and contraction instruction according to the CPU utilization and the network card utilization.

[0147] Optionally, the instruction generating module 12 is configured to determine a to-be-expanded quantity of forwarding instances if the CPU utilization and / or the network card utilization is not less than a preset threshold.

[0148] An expansion instruction containing the to-be-expanded quantity is generated.

[0149] Optionally, the instruction generating module 12 is configured to determine a to-be-contracted quantity of forwarding instances if the CPU utilization and / or the network card utilization is not greater than a preset threshold.

[0150] The other utilization of the remaining forwarding instances when the data processing cluster processes data by using the remaining forwarding instances is determined, wherein the number of the remaining forwarding instances is a difference between a total number of forwarding instances in the data processing cluster and the to-be-contracted quantity, and the other utilization is a utilization other than the target utilization in the CPU utilization and the network card utilization.

[0151] If the other utilization of the remaining forwarding instances is not greater than the preset threshold, a scaling instruction containing the to-be-scaled quantity is generated.

[0152] Optionally, the instruction generation module 12 is configured to determine the to-be-scaled quantity or the to-be-scaled quantity according to a difference between the target utilization and the preset threshold and a number of forwarding instances in the data processing cluster, the target utilization including at least one utilization that is not greater than the preset threshold from the CPU utilization and the NIC utilization.

[0153] Optionally, the to-be-scaled quantity and the to-be-scaled quantity correspond to a current scheduling period.

[0154] The apparatus further includes a recording module 15 configured to record a number of forwarding instances contained in each of different working nodes in the data processing cluster, so as to determine the to-be-scaled quantity or the to-be-scaled quantity corresponding to a next scheduling period according to the recorded number of instances and the recorded CPU utilization and NIC utilization of the instances.

[0155] Figure 8 The apparatus can perform Figures 1-3 The method of the embodiment, the part not described in detail in the embodiment can refer to the related description of the embodiment. Figures 1-3 The execution process and technical effects of the technical solution are described in the embodiment, which will not be described here. Figures 1-3

[0156] In addition, in one possible design, the instance scheduling method provided in the above embodiments can be applied in an electronic device. As Figure 9 indicated, the electronic device can include a processor 21 and a memory 22. The memory 22 is configured to store a program supporting the electronic device to perform the instance scheduling method provided in the above Figures 1-3 embodiments, and the processor 21 is configured to execute the program stored in the memory 22.

[0157] The program includes one or more computer instructions, and the one or more computer instructions can implement the steps in the instance scheduling method provided in the above Figures 1-3 embodiments when executed by the processor 21.

[0158] Optionally, the processor 21 is further configured to execute all or part of the steps in the above Figures 1-3 embodiments.

[0159] The structure of the electronic device can further include a communication interface 23, which is configured to enable the electronic device to communicate with other devices or communication systems.

[0160] ​In addition, the embodiment of the present application provides a non-transitory machine readable storage medium for storing computer software instructions for the electronic device, which comprises computer software instructions for executing the above-mentioned Figures 1-3 the procedures involved in the example scheduling method shown.

[0161] In addition, the embodiment of the present application provides a computer program product. The computer program product includes computer programs or instructions. When the computer programs or instructions are executed by the processor, the processor can implement the steps or functions of the above-mentioned Figures 1-3 the procedures involved in the example scheduling method shown.

[0162] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A gateway pod scheduling method, characterized in that: The gateway pod runs in user mode. The gateway pod implements a complete processing process of forwarding data received by the network card through the network card, including a resource allocation stage, a data processing stage, and a resource recovery stage. The processing performed in the data processing stage includes reading data packets, parsing data packets, processing data packets, and forwarding the processed data packets. The resource allocation stage is executed before the gateway pod reads the data packets, and the resource recovery stage is executed after the gateway pod forwards the processed data packets. The method includes: Determine the duration of the complete processing of the gateway pod and the processing duration of the data processing phase based on the CPU clock count value of the gateway pod in the working node, where the CPU clock count value is recorded by a counter inside the CPU. The gateway pod is any gateway pod in the working node, where the CPU clock count value corresponds to a timestamp. The duration is determined based on a first CPU clock count value at the start of the resource allocation phase and a second CPU clock count value after the end of the resource recovery phase. The processing duration is determined based on a third CPU clock count value at the start of the data processing phase and a fourth CPU clock count value after the results of the data processing phase are obtained. Determine the CPU utilization of the gateway pod based on the occupancy time and the processing time; Determining whether to generate a scaling instruction based on the CPU utilization; If the scaling instruction is generated, the gateway pod is scaled up or down for the data processing cluster including the working node according to the scaling instruction.

2. The method according to claim 1, characterized in that The method further comprises: Get the network card utilization of the gateway pod; The determining whether to generate a scaling instruction according to the CPU utilization includes: Determine whether to generate a capacity expansion / contraction instruction based on the CPU utilization and the network card utilization.

3. The method according to claim 2, characterized in that The determining whether to generate a capacity expansion / contraction instruction according to the CPU utilization and the network card utilization includes: If the CPU utilization and / or the network card utilization is not less than a preset threshold, determining the number of gateway pods to be expanded; Generate an expansion instruction including the quantity to be expanded.

4. The method according to claim 2, characterized in that The determining whether to generate a capacity expansion / contraction instruction according to the CPU utilization and the network card utilization includes: If the CPU utilization and / or the network card utilization is not greater than a preset threshold, determining the number of gateway pods to be scaled down; Determine other utilizations of the remaining gateway pods when the data processing cluster uses the remaining gateway pods to process data, where the number of the remaining gateway pods is the difference between the total number of gateway pods in the data processing cluster and the number of gateway pods to be scaled down, and the other utilizations are the utilizations of the CPU utilization and the network card utilization excluding the target utilizations; If the other utilization of the remaining gateway pods is not greater than the preset threshold, a scaling-down instruction including the number of pods to be scaled down is generated.

5. The method according to claim 3 or 4, characterized in that The method further comprises: The number of capacity to be expanded or to be reduced is determined based on the difference between the target utilization and the preset threshold and the number of gateway pods in the data processing cluster, wherein the target utilization includes at least one utilization of the CPU utilization and the network card utilization that is not greater than the preset threshold.

6. The method according to claim 5, characterized in that The number to be expanded and the number to be reduced correspond to a current scheduling period; after scaling the gateway pods of the data processing cluster including the working node according to the scaling instructions, the method further includes: Record the number of gateway pods contained in each of the different working nodes in the data processing cluster to determine the number of instances to be expanded or reduced corresponding to the next scheduling cycle based on the recorded number of instances and the CPU utilization and network card utilization of the recorded instances.

7. A data processing system, characterized in that: include: A data processing cluster and scheduling platform, wherein the working nodes in the data processing cluster include a gateway pod running in user mode. The gateway pod implements a complete process of forwarding data received by a network card through the network card, including a resource allocation phase, a data processing phase, and a resource recovery phase. The processing performed in the data processing phase includes reading data packets, parsing data packets, processing data packets, and forwarding the processed data packets. The resource allocation phase is executed before the gateway pod reads the data packets, and the resource recovery phase is executed after the gateway pod forwards the processed data packets. The gateway pod is used to determine the occupied duration of the complete processing process of the gateway pod and the processing duration of the data processing phase based on the CPU clock count value of the gateway pod, the CPU clock count value is recorded by a counter inside the CPU, and the gateway pod is any gateway pod in the working node; based on the occupied duration and the processing duration, the CPU utilization of the gateway pod is determined, wherein the CPU clock count value corresponds to a timestamp, the occupied duration is determined based on a first CPU clock count value at the beginning of the resource allocation phase and a second CPU clock count value after the end of the resource recovery phase, and the processing duration is determined based on a third CPU clock count value at the beginning of the data processing phase and a fourth CPU clock count value after the results of the data processing phase; The scheduling platform is used to obtain the CPU utilization of the gateway pod; determine whether to generate a scaling instruction based on the CPU utilization; if the scaling instruction is generated, scale the gateway pod including the data processing cluster according to the scaling instruction.

8. The system according to claim 7, characterized in that The scheduling platform includes a monitoring cluster and a central control subsystem; The monitoring cluster is used to obtain the CPU utilization of the gateway pod; and send the CPU utilization of the gateway pod to the central control subsystem; The central control subsystem is configured to determine whether to generate a scaling instruction based on the CPU utilization; If the scaling instruction is generated, scaling the gateway pod of the data processing cluster is performed according to the scaling instruction.

9. The system according to claim 7, wherein: The gateway pod includes a forwarding component and a statistics component; The forwarding component is used to forward the data processing result; The statistical component is used to determine the CPU utilization of the gateway pod according to the CPU clock count value of the gateway pod.

10. The system according to claim 9, characterized in that The statistical component is used to determine the duration of the complete processing process of the gateway pod and the processing duration of the data processing phase according to the CPU clock count value of the gateway pod.

11. The system according to claim 8, wherein: The target monitoring node in the monitoring cluster corresponds to the target working node in the data processing cluster; The target monitoring node is used to obtain the CPU utilization of the target gateway pod using a command line interface.

12. The system according to claim 8, wherein: The central control subsystem includes a scheduling component and a controller; The monitoring cluster is used to obtain the network card utilization of the gateway pod; The scheduling component is used to determine whether to generate a scaling instruction corresponding to the current scheduling period according to the CPU utilization and the network card utilization; The controller is configured to, if the scaling instruction is generated, scale the gateway pod of the data processing cluster according to the scaling instruction.

13. An electronic device, characterized in that: include: A memory and a processor; wherein the memory stores an executable code, and when the executable code is executed by the processor, the processor executes the gateway pod scheduling method according to any one of claims 1 to 6.

14. A non-transitory machine-readable storage medium, characterized in that The non-transitory machine-readable storage medium stores executable code, and when the executable code is executed by a processor of an electronic device, the processor is caused to execute the gateway pod scheduling method according to any one of claims 1 to 6.

15. A computer program product, characterized in that The computer program product includes a computer program or instructions, so that the computer program or instructions can implement the steps in the gateway pod scheduling method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Virtual gateway instance group capacity expansion and shrinkage method and device and related equipment

    CN119011404A