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

By using the CPU clock value value of the forwarding instance, the CPU utilization rate is determined, and the accurate expansion capacity instructions are generated to solve the problem of inaccurate loads in the existing technologies, and the efficient management of data processing clusters is realized.

CN119356885AActive Publication Date: 2025-01-24ALIBABA CLOUD COMPUTING CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The prior art is difficult to accurately generate scaling instructions, resulting in inaccurate loading of instances and affecting the performance of data processing clusters.

Method used

The CPU utilization rate of the CPU clock running in the working node is determined, and the CPU utilization rate is generated according to the utilization rate.

Benefits of technology

It improves the accuracy of forwarding instance expansion and contraction, ensures that the load of the data processing cluster is within a reasonable range, and improves the service experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356885A_ABST
    Figure CN119356885A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an instance scheduling method, a data processing system, equipment, a medium and a product, a data processing cluster is composed of working nodes, forwarding instances responsible for data forwarding run in the working nodes, and the forwarding instances run in a user mode. For the data processing cluster, the method comprises the following steps: according to a CPU clock count value of a forwarding instance in a working node, determining a real CPU utilization rate of the forwarding instance running in a user mode, and further determining whether to generate a capacity expansion and contraction instruction based on the CPU utilization rate. And if the capacity expansion and contraction instruction is generated, executing the instruction to perform capacity expansion and contraction on the forwarding instance in the data processing cluster. According to the method, for the forwarding instance running in the user mode, the CPU utilization rate reflecting the real load condition of the forwarding instance can be directly determined by means of the CPU clock count value, and therefore the accuracy of capacity expansion and shrinkage of the forwarding instance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network communications, and in particular to an instance scheduling method, a data processing system, a device, a medium and a product. Background Art

[0002] In practice, with the help of virtualization technology, a certain number of instances can be deployed in physical devices, and different instances deployed in different physical devices can communicate with each other over the network. As the amount of data in the network changes, the load of the instance can also change accordingly. At this time, the instances in the physical device can also be elastically scaled, that is, expanded or reduced. The load of the instance can be reflected by at least one of the instance's central processing unit (CPU) utilization, memory utilization, and network card utilization.

[0003] Based on the above description, how to generate accurate scaling instructions becomes a problem that needs to be solved urgently. Summary of the invention

[0004] In view of this, embodiments of the present invention provide an instance scheduling method, a data processing system, a device, a medium and a product for generating accurate scaling instructions.

[0005] In a first aspect, an embodiment of the present invention provides an instance scheduling method, including: Determining a CPU utilization rate of a forwarding instance in a working node according to a CPU clock count value of the forwarding instance, wherein the forwarding instance runs in a user state; Determine whether to generate a capacity expansion or contraction instruction according to the CPU utilization; If the scaling instruction is generated, the forwarding instance is scaled up or down for the data processing cluster including the working node according to the scaling instruction.

[0006] In a second aspect, an embodiment of the present invention provides a data processing system, including: a data processing cluster and a scheduling platform, wherein a working node in the data processing cluster includes a forwarding instance running in a user state; The forwarding instance is used to determine the CPU utilization of the forwarding instance according to the CPU clock count value of the forwarding instance; The scheduling platform is used to obtain the CPU utilization of the forwarding instance; determine whether to generate a scaling instruction based on the CPU utilization; if the scaling instruction is generated, scale the forwarding instance including the data processing cluster according to the scaling instruction.

[0007] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory, wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the example scheduling method in the first aspect. The electronic device may also include a communication interface for communicating with other devices or communication systems.

[0008] In a fourth aspect, an embodiment of the present invention provides a non-temporary machine-readable storage medium having executable code stored thereon. When the executable code is executed by a processor of an electronic device, the processor can at least implement the instance scheduling method described in the first aspect.

[0009] In a fifth aspect, an embodiment of the present invention provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a processor, the processor is enabled to implement the example scheduling method described in the first aspect above.

[0010] The data processing cluster may be composed of working nodes, in which a forwarding instance responsible for data forwarding may be running, and the forwarding instance runs in user mode. The method and system provided by the embodiments of the present invention may be used to achieve scaling of the forwarding instance running in user mode in the data processing cluster. In the method provided by the embodiments of the present invention, the scheduling platform may determine the CPU utilization of the forwarding instance running in user mode based on the CPU clock count value of the forwarding instance in the working node, and determine whether it is necessary to generate a scaling instruction based on the CPU utilization. If a scaling instruction is generated, the scaling instruction may be executed to scale the forwarding instance in the data processing cluster.

[0011] The traditional CPU utilization collection method can rely on the kernel's call to the instance, but for the forwarding instance running in the user state, this forwarding instance processes data in the user state, and the data processing does not go through the kernel. Therefore, the traditional collection method cannot know the actual CPU utilization inside the forwarding instance.

[0012] In the above method, for the forwarding instance running in user mode, the scheduling platform can use the CPU clock count value of the forwarding instance to determine the CPU utilization of the forwarding instance. Although the forwarding instance running in user mode does not pass through the kernel during data processing, the entire process of data processing can be accompanied by changes in the CPU clock count value. Therefore, the CPU utilization determined by the CPU clock count value can accurately reflect the actual load situation inside the forwarding instance, and can also improve the accuracy of the expansion and contraction of the forwarding instance. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0014] Figure 1 A flowchart of an example scheduling method provided by an embodiment of the present invention; Figure 2 A flowchart of a method for determining CPU utilization provided by an embodiment of the present invention; Figure 3 A flowchart of another example scheduling method provided by an embodiment of the present invention; Figure 4 A schematic diagram of the structure of a data processing system provided by an embodiment of the present invention; Figure 5 A schematic diagram of the structure of another data processing system provided by an embodiment of the present invention; Figure 6 A structural diagram of another data processing system provided by an embodiment of the present invention; Figure 7 A schematic diagram of obtaining CPU utilization of a monitoring cluster provided in an embodiment of the present invention; Figure 8 A schematic diagram of the structure of an example scheduling device provided by an embodiment of the present invention; Fig. 9 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0015] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0016] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings, and "multiple" generally includes at least two, but does not exclude the inclusion of at least one.

[0017] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0018] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to identifying", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is identified" may be interpreted as "when determining" or "in response to determining" or "when identifying (stated condition or event)" or "in response to identifying (stated condition or event)", depending on the context.

[0019] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0020] 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 product or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such a product or system. 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 product or system including the elements.

[0021] Based on the introduction in the background technology, before describing in detail the contents provided by each embodiment of the present invention, the background of using the following embodiments of the present invention may be described in more detail.

[0022] The instance mentioned in the background technology may specifically be a forwarding instance used for data processing and forwarding, and network communication may be achieved with the help of different forwarding instances.

[0023] Among them, the data processed and forwarded by the forwarding instance can be a message generated by the user in the process of using the service provided by the service provider. This message generated during the use of the service can be called a data message, and the data message can be in the form of a data stream. The service provider can provide services in the form of applications or cloud services. Data messages generated by using different services can belong to different data streams, and the content contained in the data message is different depending on the service content. For example, when the service is a cloud game, the data message may include game data; when the service is a cloud computing service, the data message may include calculation results. And multiple forwarding instances in the communication network can also constitute a data processing cluster.

[0024] In addition, during the use of the service, the number of data packets may also change dynamically. At this time, the method or system provided in the following embodiments of the present invention may be used to generate accurate scaling instructions, and the service experience may be ensured by scaling the forwarding instances in the data processing cluster.

[0025] Some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the case where there is no conflict between the embodiments, the following embodiments and the features in the embodiments can be combined with each other. In addition, the step sequence in the following method embodiments is only an example and not a strict limitation.

[0026] Figure 1 The flowchart of an example scheduling method provided by an embodiment of the present invention is shown in FIG. The method provided by an embodiment of the present invention can be executed by a scheduling platform. Figure 1 As shown, the method may include the following steps: S101, determining the CPU utilization of a forwarding instance according to a CPU clock count value of the forwarding instance in a working node, where the forwarding instance runs in a user mode.

[0027] For the forwarding instances mentioned in the embodiments of the present invention, which are deployed in the tool nodes of the data processing cluster and run in 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 based on the CPU clock count value.

[0028] The CPU clock count value may be the number of CPU clock cycles recorded by a counter inside the CPU. The CPU clock count value may be continuously accumulated at different stages of data processing by the forwarding instance, so one CPU clock count value corresponds to one timestamp. And the complete data processing process of the forwarding instance may specifically include a resource allocation stage, a data processing stage, and a resource recovery stage.

[0029] As for the CPU utilization of the forwarding instance, an optional determination method is that the scheduling platform can obtain the CPU clock count value at the beginning of the data processing phase, and obtain the CPU clock count value again at the end of the data processing phase. The difference between the two CPU clock count values ​​is the time consumed in the data processing phase. It is easy to understand that the longer the forwarding instance spends processing data, the greater the data processing pressure of the forwarding instance, and the higher the CPU utilization of the forwarding instance. Therefore, this time consumption can be used as an indicator to describe the CPU utilization of the forwarding instance.

[0030] The different stages mentioned above can be explained below.

[0031] The resource allocation phase and resource recovery phase can be considered as the pre-processing and post-processing processes of data processing, respectively. The resource allocation phase can be executed before the forwarding instance receives the data. In this phase, the memory space can be allocated, the descriptor can be obtained, and the memory identification bit can be checked for the data received by the forwarding instance. In this phase, other resources required for receiving, processing, and forwarding data, such as network resources, computing resources, etc., can also be allocated to the forwarding instance.

[0032] In the data processing stage, the allocated resources can be used to obtain data from the network card, complete data analysis and processing, and finally send the processing results to the network card, so that the network card forwards the processing results. In this stage, the data read by the forwarding instance from the network card can be a large number of data packets in the form of data streams.

[0033] The resource recovery phase can be executed after the forwarding instance completes the forwarding of all data processing results. In this phase, memory can be released, descriptors can be released, and memory flags can be reset. In this phase, various other resources allocated to the forwarding instance can also be recovered.

[0034] Among them, for the forwarding instance running in user mode mentioned in each embodiment of the present invention, optionally, it can be used as any device with data forwarding capability in the network communication process such as a gateway, a router, a switch, etc. Optionally, the forwarding instance can also be a non-physical device with elastic scaling function obtained by virtualization technology, such as a cloud server (Elastic Compute Service, referred to as ECS) or a container (pod) created using a container orchestration tool. Optionally, the container orchestration container may include Kubernetes (referred to as K8S), Docker Swarm, etc. And when the forwarding instance is a container, the data processing cluster where the forwarding instance is located can be specifically a container cluster, and the forwarding container can be specifically deployed in a working node (node) in the cluster. When the forwarding instance is an ECS, the data processing cluster where the forwarding instance is located can be specifically an ECS cluster.

[0035] S102: Determine whether to generate a capacity expansion or contraction instruction according to the CPU utilization.

[0036] S103: If a scaling instruction is generated, scaling the forwarding instance of the data processing cluster including the working node is performed according to the scaling instruction.

[0037] Furthermore, the scheduling platform may determine whether to generate a scaling-down instruction according to CPU utilization.

[0038] Optionally, when the CPU utilization, i.e., the time consumed in the data processing phase, is not less than the first preset duration, the scheduling platform can generate and execute a capacity expansion instruction to expand the capacity of the forwarding instance of the data processing cluster. The capacity expansion can reduce the CPU utilization of the forwarding instance in the data processing cluster before the capacity expansion, and ensure that the CPU utilization of the forwarding instance in the data processing cluster after the capacity expansion is at a reasonable level.

[0039] Optionally, when the CPU utilization is not greater than the second preset duration, the scheduling platform can generate and execute a scaling-down instruction to scale down the forwarding instance of the data processing cluster. Scaling down can keep the CPU utilization of the forwarding instance in the data processing cluster at a reasonable level. At the same time, 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. Among them, the first preset duration is greater than the second preset duration.

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

[0041] The traditional CPU utilization collection method can rely on the kernel's call to the instance, but for the forwarding instance running in the user state, this forwarding instance processes data in the user state, and the data processing does not go through the kernel. Therefore, the traditional collection method cannot know the actual CPU utilization inside the forwarding instance.

[0042] In the above method, for the forwarding instance running in user mode, the scheduling platform can use the CPU clock count value of the forwarding instance to determine the CPU utilization of the forwarding instance. Although the forwarding instance running in user mode does not pass through the kernel during data processing, the entire process of data processing can be accompanied by changes in the CPU clock count value. Therefore, the CPU utilization determined by the CPU clock count value can accurately reflect the actual load situation inside the forwarding instance, and can also improve the accuracy of the expansion and contraction of the forwarding instance.

[0043] Figure 1 The embodiment shown introduces a method for determining CPU utilization based on CPU clock count values. In addition, another optional method for determining CPU utilization based on CPU clock count values ​​can also be found in the following Figure 2 The embodiment shown.

[0044] Figure 2 Flow chart of a method for determining CPU utilization provided by an embodiment of the present invention, which is also an optional specific implementation of step S101. Figure 2 As shown, the method may include the following steps: S201, determining the duration of the forwarding instance occupying the allocated resources according to the CPU clock count value of the forwarding instance.

[0045] S202: Determine, according to the CPU clock count value of the forwarding instance, the processing time required for the forwarding instance to process data using the allocated resources.

[0046] S203: Determine the CPU utilization of the forwarding instance according to the occupation time and the processing time.

[0047] according to Figure 1 It can be seen from the description in the illustrated embodiment that the complete data processing process of the forwarding instance may include a resource allocation phase, a data processing phase, and a resource recovery phase. Before the resources allocated to the forwarding instance are recovered, the forwarding instance is the exclusive owner of the resources. Therefore, the duration from the resource allocation phase to the end of the resource recovery phase can be considered as the duration of the complete data processing process of the forwarding instance, or the duration of the resource occupation by the forwarding instance. At the same time, the duration required for the forwarding instance to process the data using the resources it occupies, that is, the duration of the data processing phase, can be considered as the processing time of the data. It is easy to understand that the occupation time is greater than the processing time.

[0048] Optionally, the scheduling platform may determine the ratio between the processing time and the occupied time as an indicator describing the CPU utilization of the forwarding instance. A higher ratio indicates a longer processing time, more data processed by the forwarding instance, and a higher CPU utilization of the forwarding instance.

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

[0050] For the processing duration, an optional determination method is that the scheduling platform can obtain the third CPU clock count value of the forwarding instance at the beginning of the data processing phase, that is, when the forwarding instance starts to process data. The scheduling platform can also obtain the fourth CPU clock count value of the forwarding instance after the data processing phase ends, that is, after the data processing result is forwarded. 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. Among them, the third CPU clock count value is less than the fourth CPU clock count value. And because the data processing phase occurs before the resource recovery phase, the second CPU clock count value is greater than the fourth CPU clock count value.

[0051] 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 data processing process of the forwarding instance.

[0052] Optionally, in addition to using the CPU utilization to determine whether to generate a scaling instruction, the scheduling platform may also use a combination of the CPU utilization and the network card utilization of the forwarding instance to determine whether to generate a scaling instruction. Figure 3 FIG. 1 is a flowchart of another example scheduling method provided by an embodiment of the present invention. Figure 3 As shown, the method may include the following steps: S301, determining the CPU utilization of a forwarding instance according to a CPU clock count value of the forwarding instance in a working node, where the forwarding instance runs in a user mode.

[0053] The specific implementation process of step S301 can be found in Figure 1 The relevant description in the illustrated embodiment will not be repeated here.

[0054] S302: Obtain the network card utilization rate of the forwarding instance.

[0055] S303: Determine whether to generate a capacity expansion or contraction instruction according to the CPU utilization and the network card utilization.

[0056] The scheduling platform can directly use the system kernel to obtain the network card utilization of the forwarding instance, and comprehensively consider the network card utilization and CPU utilization to determine whether to generate expansion and contraction instructions.

[0057] In one case, if the target utilization is not less than the first preset threshold corresponding to the target utilization, the scheduling platform can determine the number of capacity to be expanded. 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 less than the first preset threshold corresponding to the network card utilization and / or when the CPU utilization is not less than the first preset threshold corresponding to the CPU utilization, the scheduling platform can determine the number of capacity to be expanded.

[0058] For the number to be expanded, in an optional manner, the scheduling platform can obtain the difference between the target utilization and the first preset threshold, and the numerical interval of the difference can correspond to the first target number, then the scheduling platform can determine the first target number as the number to be expanded, and generate an expansion instruction containing the number to be expanded. In this case, the target utilization can be at least one of the network card utilization and the CPU utilization, and the network card utilization and the CPU utilization have their own corresponding first preset thresholds.

[0059] Alternatively, the scheduling platform may determine the number of capacity to be expanded based on the difference between the target utilization and the first preset threshold and the number of forwarding instances in the current data processing cluster, and generate an expansion instruction including the number of capacity to be expanded. Optionally, the number of capacity to be expanded may be determined using the following formula: Where N represents the number of forwarding instances in the data processing cluster when obtaining utilization. i represents the i-th forwarding instance. C represents the number of CPUs in the data processing cluster, and a forwarding instance can include at least one CPU and at least one network card. R represents CPU utilization, and cidx represents the sequence value of the CPU, that is, the cxid-th CPU. represents the first preset threshold corresponding to the CPU utilization. E represents the number of network cards in the data processing cluster. B represents the network card utilization. Indicates the first preset threshold corresponding to the network card utilization.

[0060] Indicates that the CPU utilization of all CPUs in the i-th forwarding instance is averaged to obtain the average CPU utilization of the i-th forwarding instance.

[0061] Indicates that the average CPU utilization of all forwarding instances is averaged to obtain the average CPU utilization of the entire data processing cluster.

[0062] It means that the network card utilization rates of all network cards in the i-th forwarding instance are averaged to obtain the average network card utilization rate of the i-th forwarding instance.

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

[0064] 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 capacity to be reduced. 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 capacity to be reduced.

[0065] For the number to be expanded, in an optional manner, the scheduling platform can obtain the difference between the target utilization and the second preset threshold, and the numerical range of the difference can correspond to the second target number. The scheduling platform can then determine the second target number as the number to be reduced, and generate a reduction instruction containing the number to be reduced.

[0066] Alternatively, the scheduling platform may also determine the number of forwarding instances to be scaled down based on the difference between the target utilization and the second preset threshold and the number of forwarding instances in the current data processing cluster using the following formula: in, Indicates the second preset threshold corresponding to the CPU utilization. Indicates the second preset threshold corresponding to the network card utilization. The minimum number of forwarding instances that the preset data processing cluster can contain. The meanings of other parameters in the above formula are the same as the relevant parameters in the above formula.

[0067] In the above case, the target utilization is at least one of the network card utilization and the CPU utilization, the network card utilization and the CPU utilization have respective corresponding second preset thresholds, and the first preset threshold corresponding to the same utilization is greater than the second preset threshold corresponding to the same utilization.

[0068] It should be noted that the target utilization rates in the above two cases may be utilization rates of the same type or utilization rates of different types.

[0069] S304: If a scaling instruction is generated, scaling the forwarding instance of the data processing cluster including the working node is performed according to the scaling instruction.

[0070] The specific implementation process of step S304 can be found in Figure 1 The relevant description in the illustrated embodiment will not be repeated here.

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

[0072] based on Figure 2 In the embodiment shown, when either the network card utilization rate or the CPU utilization rate is not greater than the second preset threshold, the scheduling platform can generate a capacity reduction instruction. However, after the capacity reduction, the other utilization rate may increase, and the scheduling platform needs to further generate a capacity expansion instruction, which will lead to frequent expansion and contraction of the data processing cluster.

[0073] 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 reduced. For details on how to determine the number of forwarding instances to be reduced, see Figure 2 The description in the illustrated embodiment will not be repeated here. In this case, the target utilization is any one of the CPU utilization and the network card utilization.

[0074] After obtaining the number to be reduced, the scheduling platform can also calculate the number of remaining forwarding instances contained in the data processing cluster after the reduction, and further determine the other utilization of these remaining forwarding instances when the remaining forwarding instances are used to process data. Among them, the number of remaining forwarding instances is the difference between the total number of forwarding instances in the data processing cluster and the number to be reduced. Other utilizations are the utilizations of CPU utilization and network card utilization other than the target utilization. If the other utilizations of the remaining forwarding instances are not greater than the second preset threshold corresponding to the other utilizations, the scheduling platform can generate a reduction instruction containing the above-mentioned number to be reduced. If the other utilizations of the remaining forwarding instances are greater than the second preset threshold corresponding to the other utilizations, the scheduling platform does not generate expansion and contraction instructions, but keeps the number of forwarding instances in the data processing cluster unchanged.

[0075] For example, assume that there are 10 working nodes in the data processing cluster, and any working node contains 5 forwarding instances. When the CPU utilization of the forwarding instances in the cluster that exceed the preset number is not greater than the second preset threshold corresponding to the CPU utilization, the scheduling platform can determine that the number to be reduced is 5. Afterwards, the scheduling platform can further determine the network card utilization of the remaining 45 forwarding instances after reducing the 5 forwarding instances in the data processing cluster. 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 reduction instruction and execute the instruction to reduce 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 among the 45 forwarding instances, the scheduling platform does not generate a reduction instruction.

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

[0077] Optionally, the scheduling platform may periodically monitor the CPU utilization and / or network card utilization of the forwarding instance, and generate corresponding expansion and contraction instructions based on the monitoring results to implement forwarding instance scheduling. When the current scheduling cycle is reached, the scheduling platform may generate expansion and contraction instructions in accordance with the methods provided in the above and below embodiments of the present invention. And after executing the expansion and contraction instructions, the scheduling platform may also record the number of forwarding instances in the data processing cluster after expansion and contraction, which number corresponds to the current scheduling cycle. Then, when the next scheduling cycle is reached, the scheduling platform may also determine the number to be expanded or the number to be reduced based on the number of forwarding instances in the current data processing cluster and at least one utilization rate of the monitored forwarding instances.

[0078] Above Figure 1~Figure 3 The illustrated embodiment has described the instance scheduling process from the perspective of a method. On this basis, the instance scheduling process can also be described from the perspective of a system.

[0079] Figure 4 An embodiment of the present invention provides a data processing system. Figure 4 As shown, the system may specifically include: a data processing cluster and a scheduling platform.

[0080] Among them, the working nodes in the data processing cluster include forwarding instances running in user mode.

[0081] The specific working process of the system can be described as: The forwarding instance in the data processing cluster is used to process data and forward the data processing results, which may include data packets represented as data streams. At the same time, during the data processing and forwarding of the 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 by reading the CPU clock count value. The CPU utilization determined by the forwarding instance can be further fed back to the scheduling platform. Then, the scheduling platform can determine whether to generate a scaling instruction based on the CPU utilization. If the scheduling platform determines to generate a scaling instruction, it can further scale the forwarding instance of the data processing cluster according to the scaling instruction.

[0082] The specific calculation method of CPU utilization can be found in Figure 1 or Figure 2 The relevant description in the illustrated embodiment will not be repeated here.

[0083] In this embodiment, the forwarding instance in the working node can determine the CPU utilization of the forwarding instance running in the user state based on its own CPU clock count value. Afterwards, the scheduling platform can determine whether to generate a scaling instruction based on the CPU utilization. If a scaling instruction is generated, the scaling instruction can be executed to scale the forwarding instance in the data processing cluster.

[0084] The traditional CPU utilization collection method can rely on the kernel's call to the instance, but for the forwarding instance running in the user state, this forwarding instance processes data in the user state, and the data processing does not go through the kernel. Therefore, the traditional collection method cannot know the actual CPU utilization inside the forwarding instance.

[0085] In the above method, for the forwarding instance running in user mode, the forwarding instance can use its own CPU clock count value to determine the CPU utilization of the forwarding instance. Although the forwarding instance running in user mode does not pass through the kernel during data processing, the entire process of data processing can be accompanied by changes in the CPU clock count value. Therefore, the CPU utilization determined by the CPU clock count value can accurately reflect the actual load situation inside the forwarding instance, and can also improve the accuracy of the forwarding instance expansion and contraction.

[0086] Figure 5 A schematic diagram of the structure of another data processing system provided by an embodiment of the present invention. Figure 5 As shown, in Figure 4 Based on 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 on the data plane of the data processing system, and the central control subsystem is located on the control plane of the data processing system.

[0087] The specific working process of the system can be further described in detail as follows: The forwarding instance in the data processing cluster is used to process data and forward the data processing results, which may include data packets represented as data streams. At the same time, during the data processing and forwarding of the 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 by 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 that the monitoring cluster sends the CPU utilization to the central control subsystem in the scheduling platform. The central control subsystem can determine whether to generate a scaling instruction based on the CPU utilization sent by the monitoring cluster. If the scaling instruction is generated, the central control subsystem will scale the forwarding instance of the data processing cluster according to the scaling instruction.

[0088] The specific calculation method of CPU utilization can be found in Figure 1 or Figure 2 The relevant description in the illustrated embodiment will not be repeated here.

[0089] In this embodiment, the forwarding instance in the scheduling work node can determine the CPU utilization of the forwarding instance running in the user state based on its own CPU clock count value. Afterwards, the central control subsystem in the scheduling platform can determine whether to generate a scaling instruction based on this CPU utilization. If a scaling instruction is generated, the scaling instruction can be executed to scale the forwarding instance in the data processing cluster.

[0090] The traditional CPU utilization collection method can rely on the kernel's call to the instance, but for the forwarding instance running in the user state, this forwarding instance processes data in the user state, and the data processing does not go through the kernel. Therefore, the traditional collection method cannot know the actual CPU utilization inside the forwarding instance.

[0091] In the above method, for the forwarding instance running in user mode, the forwarding instance can use its own CPU clock count value to determine the CPU utilization of the forwarding instance. Although the forwarding instance running in user mode does not pass through the kernel during data processing, the entire process of data processing can be accompanied by changes in the CPU clock count value. Therefore, the CPU utilization determined by the CPU clock count value can accurately reflect the actual load situation inside the forwarding instance, and can also improve the accuracy of the forwarding instance expansion and contraction.

[0092] Figure 6 A schematic diagram of the structure of another data processing system provided by an embodiment of the present invention. Figure 6 As shown, in Figure 5 Based on the system shown, the forwarding instance in the system may specifically include a forwarding component and a statistical component.

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

[0094] The statistics component can collect the CPU clock count value of the forwarding instance and determine the CPU utilization of the forwarding instance based on the collected CPU clock count value. For the specific calculation method of CPU utilization, please refer to Figure 1 or Figure 2 The relevant description in the illustrated embodiment will not be repeated here.

[0095] In this embodiment, for a forwarding instance running in user mode, a statistical component in the forwarding instance can directly determine the CPU utilization of the forwarding instance, that is, to perform CPU utilization statistics on the data plane of the entire data processing system.

[0096] Optionally, in this embodiment, the monitoring cluster can be deployed in a distributed manner, and the target monitoring node in the monitoring cluster is responsible for obtaining 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 use the command line interface to obtain the CPU utilization determined by the statistical component. The process of the statistical component determining the CPU utilization and feeding back the CPU utilization to the monitoring node can also be combined with Figure 7 understand.

[0097] In this embodiment, since there is a monitoring cluster composed of distributed monitoring nodes in the data processing system, when some of the monitoring nodes fail, it will not affect other monitoring nodes in obtaining the CPU utilization of other forwarding instances, thereby improving the availability of the data processing system.

[0098] Optionally, the monitoring node may also obtain and send the network card utilization of the forwarding instance to the central control subsystem, so that the central control subsystem generates expansion and contraction instructions based on a variety of utilizations.

[0099] Optionally, the data processing system may further include a utilization processing component, which is used to format at least one utilization data acquired by the monitoring node to meet the input requirements of the central management and control subsystem.

[0100] Optionally, the central management and control subsystem may include a scheduling component and a controller.

[0101] The scheduling component may receive the utilization collected by the monitoring cluster and generate expansion and contraction instructions based on the received utilization. The expansion instruction may include the number of instances to be expanded, and the contraction instruction may include the number of instances to be contracted. The specific method for determining the instances to be expanded and the number of instances to be contracted can refer to the description in the above-mentioned related embodiments, which will not be repeated here.

[0102] The controller may execute the scaling instructions generated by the scheduling component to scale the forwarding instances in the data processing system.

[0103] Optionally, in the current scheduling cycle, after the components in the data processing system work together in the manner described in the above embodiments, the expansion or reduction of the forwarding instances in the data processing cluster can be completed. And according to the specific method of determining the number of instances to be expanded and reduced, it can be known that the scheduling component can determine the number of instances to be expanded or reduced according to 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 executing the expansion and reduction instructions generated in the previous scheduling cycle, the number of forwarding instances in the current data processing cluster corresponds to the previous scheduling cycle. After the scheduling component generates an expansion instruction or a reduction instruction, it can also record the number of forwarding instances corresponding to the current scheduling cycle.

[0104] When the next scheduling cycle arrives, the scheduling component can generate new expansion and contraction instructions based on the utilization collected by the monitoring node and the number of forwarding instances corresponding to the current scheduling cycle.

[0105] Optionally, the scheduling components and / or controllers in the central control subsystem can also be deployed in a distributed manner. When any scheduling component and / or controller fails, it will not affect the generation and execution of scaling instructions, thereby improving the availability of the data processing system.

[0106] In addition, the contents not described in detail in this embodiment and the technical effects that can be achieved can all be found in the relevant descriptions in the embodiment shown in 1, and will not be repeated here.

[0107] However, it should be noted that, according to the description of each method embodiment of the present invention, the scheduling platform can determine the CPU utilization of the forwarding instance according to the CPU clock count value. According to the description of each system embodiment of the present invention, the statistical component in the forwarding instance can determine the CPU utilization of the forwarding instance according to the CPU clock count value.

[0108] Optionally, the utilization rate may be determined by either the scheduling platform or the forwarding instance, and therefore, the methods and systems provided by the various embodiments of the present invention are not conflicting.

[0109] The following will describe in detail an example scheduling device of one or more embodiments of the present invention. Those skilled in the art will appreciate that the device can be configured using commercially available hardware components through the steps taught in this solution.

[0110] Figure 8 The following is a schematic diagram of the structure of an example scheduling device provided by an embodiment of the present invention. Figure 8 As shown, the device may include: The utilization determination module 11 is used to determine the CPU utilization of the forwarding instance according to the CPU clock count value of the forwarding instance in the working node, and the forwarding instance runs in the user mode.

[0111] The instruction generation module 12 is used to determine whether to generate a capacity expansion or contraction instruction according to the CPU utilization.

[0112] The instruction execution module 13 is used to, if the expansion / contraction instruction is generated, perform expansion / contraction of the forwarding instance on the data processing cluster including the working node according to the expansion / contraction instruction.

[0113] Optionally, the utilization determination module 11 is used to determine the duration of occupancy of the allocated resources by the forwarding instance according to the CPU clock count value of the forwarding instance; Determining, according to the CPU clock count value of the forwarding instance, a processing time required for the forwarding instance to process data using the allocated resources; A CPU utilization rate of the forwarding instance is determined according to the occupation time and the processing time.

[0114] Optionally, the utilization determination module 11 is used to obtain a first CPU clock count value of the forwarding instance when allocating resources to the forwarding instance; Acquire a second clock count value of the CPU of the forwarding instance after the resources allocated to the forwarding instance are recycled; The difference between the first CPU clock count value and the second CPU clock count value is determined as the occupation duration.

[0115] Optionally, the utilization determination module 11 is used to obtain a third CPU clock count value of the forwarding instance when the forwarding instance performs data processing. After obtaining the forwarding data processing result of the forwarding instance, the fourth CPU clock count value of the forwarding instance; The difference between the third CPU clock count value and the fourth CPU clock count value is determined as the processing duration, and the second clock count value is greater than the fourth clock count value.

[0116] Optionally, the device further includes: a utilization acquisition module 14, configured to acquire the network card utilization of the forwarding instance.

[0117] The instruction generation module 12 is used to determine whether to generate a capacity expansion or contraction instruction according to the CPU utilization and the network card utilization.

[0118] Optionally, the instruction generation module 12 is used to determine the number of forwarding instances to be expanded if the CPU utilization and / or the network card utilization is not less than a preset threshold; Generate a capacity expansion instruction including the quantity to be expanded.

[0119] Optionally, the instruction generation module 12 is used to determine the number of forwarding instances to be reduced if the CPU utilization and / or the network card utilization is not greater than a preset threshold; Determine other utilizations of the remaining forwarding instances when the data processing cluster uses the remaining forwarding instances to process data, wherein the number of the remaining forwarding instances is the difference between the total number of forwarding instances in the data processing cluster and the number to be scaled down, and the other utilizations are the utilizations of the CPU utilization and the network card utilizations except the target utilization; If the other utilization of the remaining forwarding instances is not greater than the preset threshold, a reduction instruction including the number to be reduced is generated.

[0120] Optionally, the instruction generation module 12 is used to determine the number of capacity to be expanded or the number of capacity to be reduced based on the difference between the target utilization and the preset threshold and the number of forwarding instances in the data processing cluster, and 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.

[0121] Optionally, the number of capacity to be expanded and the number of capacity to be reduced correspond to a current scheduling period.

[0122] The device also includes a recording module 15, which is used to record the number of forwarding instances contained in different working nodes in the data processing cluster, so as to determine the number of capacity 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.

[0123] Figure 8 The device shown can perform Figure 1~Figure 3 For the method of the embodiment shown in the figure, the part not described in detail in this embodiment can be referred to Figure 1~Figure 3 The implementation process and technical effects of this technical solution refer to Figure 1~Figure 3 The description in the illustrated embodiment will not be repeated here.

[0124] In addition, in a possible design, the example scheduling methods provided in the above embodiments can be applied in electronic devices. Fig. 9 As shown, the electronic device may include: a processor 21 and a memory 22. The memory 22 is used to store the electronic device to perform the above Figure 1~Figure 3 The example scheduling method program provided in the illustrated embodiment, the processor 21 is configured to execute the program stored in the memory 22 .

[0125] The program includes one or more computer instructions, wherein the one or more computer instructions can achieve the above-mentioned Figure 1~Figure 3 The steps in the example scheduling method provided in the illustrated embodiment.

[0126] Optionally, the processor 21 is further configured to execute the aforementioned Figure 1~Figure 3 All or part of the steps in the illustrated embodiments.

[0127] The structure of the electronic device may further include a communication interface 23 for the electronic device to communicate with other devices or communication systems.

[0128] In addition, an embodiment of the present invention provides a non-transitory machine-readable storage medium for storing computer software instructions used by the above electronic device, which includes instructions for executing the above Figure 1~Figure 3 The procedures involved in the example scheduling method shown.

[0129] In addition, an embodiment of the present invention provides a computer program product. The computer program product includes a computer program or an instruction. When the computer program or the instruction is executed by a processor, the processor is enabled to implement the above Figure 1~Figure 3 The steps or functions of the example scheduling method are shown.

[0130] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An instance scheduling method, characterized in that: include: Determining a CPU utilization rate of a forwarding instance in a working node according to a CPU clock count value of the forwarding instance, wherein the forwarding instance runs in a user state; Determine whether to generate a capacity expansion or contraction instruction according to the CPU utilization; If the scaling instruction is generated, the forwarding instance 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 determining, according to the CPU clock count value of the forwarding instance in the working node, the CPU utilization of the forwarding instance includes: Determining, according to the CPU clock count value of the forwarding instance, the duration of the occupation of the allocated resources by the forwarding instance; Determining, according to the CPU clock count value of the forwarding instance, a processing time required for the forwarding instance to process data using the allocated resources; A CPU utilization rate of the forwarding instance is determined according to the occupation time and the processing time.

3. The method according to claim 2, characterized in that The determining, according to the CPU clock count value of the forwarding instance, the duration of occupation of the allocated resources by the forwarding instance includes: Acquire a first CPU clock count value of the forwarding instance when allocating resources to the forwarding instance; Acquire a second clock count value of the CPU of the forwarding instance after the resources allocated to the forwarding instance are recycled; The difference between the first CPU clock count value and the second CPU clock count value is determined as the occupation duration.

4. The method according to claim 3, characterized in that The determining, according to the CPU clock count value of the forwarding instance, a processing time required for the forwarding instance to process data using the allocated resources includes: Acquire a third CPU clock count value of the forwarding instance when the forwarding instance performs data processing; After obtaining the forwarding data processing result of the forwarding instance, the fourth CPU clock count value of the forwarding instance; The difference between the third CPU clock count value and the fourth CPU clock count value is determined as the processing duration.

5. The method according to claim 1, characterized in that The method further comprises: Obtaining the network card utilization rate of the forwarding instance; The determining whether to generate a capacity expansion / contraction instruction according to the CPU utilization includes: Determine whether to generate a capacity expansion or contraction instruction according to the CPU utilization and the network card utilization.

6. The method according to claim 5, 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 forwarding instances to be expanded; Generate a capacity expansion instruction including the quantity to be expanded.

7. The method according to claim 5, 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 forwarding instances to be reduced; Determine other utilizations of the remaining forwarding instances when the data processing cluster uses the remaining forwarding instances to process data, wherein the number of the remaining forwarding instances is the difference between the total number of forwarding instances in the data processing cluster and the number to be scaled down, and the other utilizations are the utilizations of the CPU utilization and the network card utilizations except the target utilization; If the other utilization of the remaining forwarding instances is not greater than the preset threshold, a reduction instruction including the number to be reduced is generated.

8. The method according to claim 6 or 7, characterized in that: The method further comprises: The number of capacity to be expanded or reduced is determined based on the difference between the target utilization and the preset threshold and the number of forwarding instances 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.

9. The method according to claim 8, characterized in that The number to be expanded and the number to be reduced correspond to the current scheduling period; after the data processing cluster including the working node is expanded or reduced in forwarding instances according to the expansion or reduction instruction, the method further includes: The number of forwarding instances contained in each of the different working nodes in the data processing cluster is recorded to determine the number of capacity to be expanded or reduced corresponding to the next scheduling cycle according to the recorded number of instances and the CPU utilization and network card utilization of the recorded instances.

10. A data processing system, characterized in that: include: A data processing cluster and a scheduling platform, wherein the working nodes in the data processing cluster include forwarding instances running in user mode; The forwarding instance is used to determine the CPU utilization of the forwarding instance according to the CPU clock count value of the forwarding instance; The scheduling platform is used to obtain the CPU utilization of the forwarding instance; determine whether to generate a scaling instruction based on the CPU utilization; if the scaling instruction is generated, scale the forwarding instance including the data processing cluster according to the scaling instruction.

11. The system according to claim 10, characterized in that The dispatching platform includes a monitoring cluster and a central control subsystem; The monitoring cluster is used to obtain the CPU utilization of the forwarding instance; and send the CPU utilization of the forwarding instance to the central control subsystem; The central control subsystem is used to determine whether to generate a capacity expansion or contraction instruction according to the CPU utilization; If the scaling instruction is generated, scaling the forwarding instance including the data processing cluster is performed according to the scaling instruction.

12. The system according to claim 10, characterized in that The forwarding instance includes a forwarding component and a statistical component; The forwarding component is used to forward the data processing result; The statistical component is used to determine the CPU utilization of the forwarding instance according to the CPU clock count value of the forwarding instance.

13. The system according to claim 12, characterized in that The statistical component is used to determine the duration of the forwarding instance occupying the allocated resources according to the CPU clock count value of the forwarding instance; Determining, according to the CPU clock count value of the forwarding instance, a processing time required for the forwarding instance to process data using the allocated resources; A CPU utilization rate of the forwarding instance is determined according to the occupation time and the processing time.

14. The system according to claim 11, characterized in that 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 forwarding instance by using a command line interface.

15. The system according to claim 11, characterized in that The central control subsystem includes a scheduling component and a controller; The monitoring cluster is used to obtain the network card utilization rate of the forwarding instance; The scheduling component is used to determine whether to generate a capacity expansion and contraction instruction corresponding to the current scheduling period according to the CPU utilization and the network card utilization; The controller is configured to, if generating the scaling instruction, scale the forwarding instance of the data processing cluster according to the scaling instruction.

16. An electronic device, characterized in that: include: A memory and a processor; wherein the memory stores executable codes, and when the executable codes are executed by the processor, the processor executes the instance scheduling method as claimed in any one of claims 1 to 9.

17. A non-transitory machine-readable storage medium, characterized in that: The non-transitory machine-readable storage medium stores executable codes, and when the executable codes are executed by a processor of an electronic device, the processor is caused to perform the example scheduling method according to any one of claims 1 to 9.

18. A computer program product, characterized in that The computer program product comprises a computer program or instructions, so that the computer program or instructions can implement the steps in the example scheduling method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Server idle computing power scheduling method and device and electronic equipment

    CN114579296A

  • CPU utilization rate statistical method and device based on polling mode

    CN117407237A

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

    CN119011404A

  • Method of calculating CPU utilization

    US20140298074A1

  • Virtual resource allocation method and apparatus

    WO2015039582A1