Speed limiting method and device, virtual switch, storage medium and computer program product

By dynamically allocating network computing power and speed limit mechanisms in virtual switches, the problem of insufficient network computing power and resource utilization in the existing technology is solved, and better network performance isolation and resource utilization are achieved.

CN119865462APending Publication Date: 2025-04-22CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202412000428.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

The existing speed limiting mechanism cannot balance the prevention of virtual machines competing for network computing power and making full use of virtual switch performance, resulting in poor network performance isolation and insufficient resource utilization.

Method used

By determining the network computing power consumption value of each virtual machine in the virtual switch, when the network computing power usage rate exceeds the set threshold, the idle network computing power is dynamically allocated and the speed limit of the virtual machines exceeding the limit is limited to ensure fair distribution and effective utilization of resources.

Benefits of technology

It realizes that while ensuring network performance isolation and resource utilization, it prevents network computing power from competing among virtual machines, and improves the overall performance and user experience of virtual switches.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119865462A_ABST
    Figure CN119865462A_ABST
Patent Text Reader

Abstract

The invention discloses a speed limiting method and device, a virtual switch, a storage medium and a computer program product, and the method comprises the steps: the virtual switch determines a first value of each virtual machine managed by the virtual switch; under the condition that the network computing power utilization rate of the virtual switch is greater than a set threshold, determining all first virtual machines in the virtual machines managed by the virtual switch; wherein the first numerical value of the first virtual machine is greater than the corresponding second numerical value; executing setting operation on at least part of the first virtual machines, wherein the setting operation comprises distributing at least part of idle network computing power of the virtual switch to the first virtual machines and / or limiting the speed of network computing power which is used by the first virtual machines and exceeds a third numerical value; the first numerical value indicates that the virtual machine consumes the network computing power of the virtual switch, the second numerical value indicates the reference network computing power quota of the virtual machine, and the third numerical value is greater than or equal to the second numerical value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of big data technology, and in particular to a rate limiting method, device, virtual switch, storage medium and computer program product. Background Art

[0002] The sending and / or receiving of messages by virtual machines must pass through the virtual switch. One virtual switch corresponds to one computing node. Usually, multiple virtual machines are connected to one computing node. These virtual machines may compete for network computing power at the computing node. In order to ensure that the sending and receiving of messages by different virtual machines on the computing node do not affect each other, a speed limiting mechanism is required. The existing speed limiting mechanism cannot strike a good balance between preventing competition for network computing power and fully utilizing the performance of the virtual switch. Summary of the invention

[0003] To solve the related technical problems, the embodiments of the present application provide a speed limiting method, device, virtual switch, storage medium and computer program product.

[0004] The technical solution of the embodiment of the present application is implemented as follows:

[0005] The present application provides a rate limiting method, which is applied to a virtual switch. The method includes:

[0006] Determining a first value for each virtual machine managed by the virtual switch, the first value indicating that the virtual machine consumes network computing power of the virtual switch;

[0007] When the network computing power usage rate of the virtual switch is greater than a set threshold, all first virtual machines are determined in the virtual machines managed by the virtual switch; wherein the first value of the first virtual machine is greater than the corresponding second value, and the second value indicates the baseline network computing power quota of the virtual machine;

[0008] A setting operation is performed on at least part of the first virtual machine, wherein the setting operation includes allocating at least part of the idle network computing power of the virtual switch to the first virtual machine and / or limiting the network computing power used by the first virtual machine that exceeds a third value; the third value is greater than or equal to the second value.

[0009] In the above solution, the step of performing the setting operation on at least part of the first virtual machine includes:

[0010] At least part of the idle network computing power of the virtual switch is allocated to at least part of the first virtual machines based at least on the set priorities of all the first virtual machines.

[0011] In the above solution, the step of performing the setting operation on at least part of the first virtual machine includes:

[0012] Prioritize the allocation of idle network computing power of the virtual switch to the first virtual machine with a high priority; or,

[0013] Evenly distribute the idle network computing power of the virtual switch to all first virtual machines; or,

[0014] At least part of the idle network computing power of the virtual switch is evenly distributed to a plurality of first virtual machines with the same set priority.

[0015] In the above solution, the third value includes the second value and the fourth value; and performing the setting operation on at least part of the first virtual machine includes:

[0016] Limiting the network computing power used by the first virtual machine that exceeds the second value; or,

[0017] The network computing power used by the first virtual machine that exceeds a fourth value is limited; the fourth value represents the sum of the second value and the network computing power allocated to the first virtual machine.

[0018] In the above scheme, the method further includes:

[0019] Determine the network computing power usage of the virtual switch in one or more statistical periods;

[0020] When the network computing power usage rate in any statistical period is greater than the corresponding set threshold, it is determined that the network computing power usage rate of the virtual switch is greater than the set threshold.

[0021] In the above scheme, different statistical periods correspond to different set thresholds; the statistical period is negatively correlated with the corresponding set threshold.

[0022] In the above solution, determining the network computing power usage rate of the virtual switch in one or more statistical periods includes:

[0023] Determine the network computing power overhead of the virtual switch in each statistical period based on the first value of each virtual machine managed by the virtual switch and / or the message sending overhead and the message receiving overhead of the virtual switch;

[0024] Based on the network computing power overhead in each statistical period and the corresponding statistical period, the network computing power utilization rate of the virtual switch in each statistical period is determined.

[0025] In the above solution, determining the first value of each virtual machine managed by the virtual switch includes:

[0026] Determine a fifth value of the second virtual machine based on all first messages sent by the second virtual machine, where the second virtual machine is any virtual machine managed by the virtual switch, and the fifth value indicates that the second virtual machine consumes network computing power of the virtual switch when sending messages;

[0027] Determine a sixth value of the second virtual machine based on all second messages received by the second virtual machine, wherein the sixth value indicates that the network computing power of the virtual switch is consumed by receiving the message by the second virtual machine;

[0028] The sum of the fifth value and the sixth value of the second virtual machine is determined as the first value of the second virtual machine.

[0029] In the above scheme, the method further includes:

[0030] Based on the set relationship and the destination address carried by the second message, determine the second virtual machine corresponding to the second message; wherein the set relationship includes at least a mapping relationship between the destination address and the first virtual machine, or a mapping relationship between the destination address and the virtual machine.

[0031] In the above scheme, the method further includes:

[0032] Determine a second value of each virtual machine based on the total network computing power of the virtual switch and the seventh value of each virtual machine managed by the virtual switch; wherein,

[0033] The seventh value is determined based on the network performance parameters of the virtual machine and the network performance parameters of the virtual switch.

[0034] The present application also provides a speed limiting device, the device comprising:

[0035] A first determination module, configured to determine a first value of each virtual machine managed by the virtual switch, wherein the first value indicates that the virtual machine consumes network computing power of the virtual switch;

[0036] A second determination module is used to determine all first virtual machines in the virtual machines managed by the virtual switch when the network computing power usage rate of the virtual switch is greater than a set threshold; wherein the first value of the first virtual machine is greater than the corresponding second value, and the second value indicates the baseline network computing power quota of the virtual machine;

[0037] An execution module is used to perform a setting operation on at least part of the first virtual machine, wherein the setting operation includes allocating at least part of the idle network computing power of the virtual switch to the first virtual machine and / or limiting the network computing power used by the first virtual machine that exceeds a third value; the third value is greater than or equal to the second value.

[0038] The embodiment of the present application also provides a virtual switch, including: a processor and a communication interface; wherein:

[0039] The processor is used to determine a first value of each virtual machine managed by the virtual switch, determine all first virtual machines in the virtual machines managed by the virtual switch when the network computing power usage rate of the virtual switch is greater than a set threshold, and perform a setting operation on at least some of the first virtual machines; wherein the first value of the first virtual machine is greater than the corresponding second value; the setting operation includes allocating at least part of the idle network computing power of the virtual switch to the first virtual machine and / or limiting the network computing power used by the first virtual machine that exceeds a third value; the first value indicates that the virtual machine consumes the network computing power of the virtual switch, the second value indicates the baseline network computing power quota of the virtual machine, and the third value is greater than or equal to the second value.

[0040] The embodiment of the present application also provides a virtual switch, including a processor and a memory for storing a computer program that can be run on the processor.

[0041] Wherein, when the processor is used to run the computer program, it executes the steps of any of the methods described above.

[0042] An embodiment of the present application further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0043] An embodiment of the present application further provides a computer program product, including a computer program, which implements the steps of any of the above methods when executed by a processor.

[0044] In the speed limiting method, device, virtual switch, storage medium and computer program product provided in the embodiments of the present application, the virtual switch determines the first value of each virtual machine managed by the virtual switch, and when the network computing power usage rate of the virtual switch is greater than the set threshold, all first virtual machines are determined among the virtual machines managed by the virtual switch, and the first value of the first virtual machine is greater than the corresponding second value, and a setting operation is performed on at least some of the first virtual machines, and the setting operation includes allocating at least part of the idle network computing power of the virtual switch to the first virtual machine and / or limiting the speed of the network computing power used by the first virtual machine in excess of the third value. In the above scheme, the virtual switch allocates at least part of the idle network computing power of the virtual switch to the first virtual machine whose first value is greater than the corresponding second value, and / or limits the speed of the network computing power used by the first virtual machine in excess of the third value, which can fully utilize the performance of the virtual switch and prevent competition for network computing power. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 This is a flow chart of a speed limiting method according to an embodiment of the present application;

[0046] Figure 2 This is a schematic diagram of an application scenario of an embodiment of the present application;

[0047] Figure 3 This is a schematic diagram of the cycle of the embodiment of the present application;

[0048] Figure 4 This is a schematic diagram of network computing power overhead in an embodiment of the present application;

[0049] Figure 5 This is a schematic diagram of the CPU usage of the virtual switch in different statistical periods according to the embodiment of the present application;

[0050] Figure 6 This is a schematic diagram of the network computing power configuration of the embodiment of the present application;

[0051] Figure 7 This is a schematic diagram of the embodiment of the present application in a steady state;

[0052] Figure 8 This is a schematic diagram of an embodiment of the present application in an unstable state;

[0053] Fig. 9 This is a schematic diagram of allocating idle network computing power according to an embodiment of the present application;

[0054] Fig.10 This is another schematic diagram of allocating idle network computing power according to an embodiment of the present application;

[0055] Fig.11 This is a schematic diagram of the network computing power distribution process of the embodiment of the present application;

[0056] Fig.12 This is a schematic diagram of the structure of the speed limiting device in the embodiment of the present application;

[0057] Fig.13 This is a schematic diagram of the virtual switch structure of an embodiment of the present application. DETAILED DESCRIPTION

[0058] The virtual switch (vSwitch) is used to manage and forward the network of virtual machines (VMs). Taking the VMs in the public cloud as an example, the network packets sent by the VMs must be forwarded by the vSwitch of the compute node (CN), and the network packets received by the VMs must also pass through the vSwitch. There may be dozens or even hundreds of VMs on a compute node, so it is important for the vSwitch to ensure that the VM networks are isolated from each other. Generally speaking, network isolation includes two levels: first, functional isolation; currently, tenant network connectivity isolation is generally achieved through overlay protocols such as Virtual Extensible Local Area Network (VXLAN) and Generic Routing Encapsulation (GRE); second, performance isolation; to achieve performance isolation, in addition to the high performance of the vSwitch, a relatively complete rate limit mechanism is also required to ensure that the traffic forwarding of different VMs does not affect each other. The VMs on a computing node share a vSwitch, but the network computing power (Network CPU, Networking Central Processing Unit cycle) of the vSwitch is limited. How to solve the isolation at the performance level is a difficult problem.

[0059] Currently, the high performance of vSwitch can be achieved through the Data Plane Development Kit (DPDK), and network delay and congestion problems can be solved through Quality of Service (QoS). DPDK is an open source data plane development tool set. It reduces the interruption overhead of kernel packet transmission and reception by directly taking over the message transmission and reception of the network card in user mode, and improves the forwarding performance by monopolizing the central processing unit (CPU) through forwarding logic. At present, most high-performance vSwitches are implemented based on DPDK. QoS refers to the ability of a network to use various basic technologies to provide better service capabilities for specified network communications. It is a security mechanism of the network and a technology used to solve problems such as network delay and congestion. QoS technologies include flow classification, traffic supervision, traffic shaping, interface speed limit, congestion management, congestion avoidance, etc. At present, common network QoS on public clouds include bandwidth (bits per second) speed limit and packet per second (PPS) speed limit.

[0060] However, the vSwitch performance of a computing node has an upper limit, which is generally just enough to meet the network performance of all the VMs that can be sold. However, the network traffic model and vSwitch forwarding logic are very complex. For the same bandwidth or PPS, a distributed denial of service attack (DDoS) or fragmented packets require more vSwitch CPU overhead than ordinary packets.

[0061] The existing technology only discusses the speed limit method of fixed quota CPU cycle in theory, just like bandwidth speed limit and PPS speed limit. However, network message processing is very complicated, and different types of traffic have different CPU forwarding overheads on the vSwitch. On the one hand, the existing technology cannot accurately count the CPU cycle of the vSwitch, and on the other hand, it cannot accurately allocate the CPU cycle quota of the vSwitch to the VM according to the bandwidth specification or PPS specification of the VM.

[0062] Specifically, the problems are as follows:

[0063] It cannot be applied in practice. Since the CPU cycle cannot be accurately quantified for users, the use scenarios of CPU-Cycle QoS (C2QoS) speed limit in the existing technology are limited and cannot be applied in the actual public cloud production environment.

[0064] Inaccurate statistics: The CPU cycles used for message forwarding need to be accurate to the VM, so it is necessary to first identify which VM the message is sent to or which VM sends it. For example, messages in the VM's inbound direction need to be searched through multiple tables to clearly identify the VM to which the message belongs. This leads to a large delay in identifying messages, which in turn causes errors in the speed limit, causing the restricted VM to occupy additional CPU cycle quotas.

[0065] The speed limit quota cannot be accurately evaluated. If the VM quota is set too low, the network performance of the VM may not meet the declared specifications, and may even affect the services of the existing VMs. If the VM quota is set too high, the C2Qos speed limit will not be able to limit the VMs that exceed the limit. For example, a VM attacked by a DDoS may have low bandwidth and PPS, but since new connections will occupy a large amount of the vSwitch's CPU, the vSwitch performance may be fully utilized, thereby affecting the network traffic of other VMs on the computing node.

[0066] There is no support for microburst rate limiting. For VMs with microbursts, if only the conventional second-level QoS is used, the rate cannot be limited and the physical network card cache is exhausted, thus affecting the network forwarding of all VMs on the same computing node.

[0067] Low-priority VMs may have greater network latency; forwarding in order of priority through queues will cause the network latency of low-priority VMs to increase. For any tenant of the public cloud, adding additional network latency is unacceptable.

[0068] Based on this, in various embodiments of the present application, the virtual switch determines the first value of each virtual machine managed by the virtual switch, and when the network computing power usage rate of the virtual switch is greater than the set threshold, all first virtual machines are determined in the virtual machines managed by the virtual switch, and the first value of the first virtual machine is greater than the corresponding second value, and a setting operation is performed on at least some of the first virtual machines, and the setting operation includes allocating at least part of the idle network computing power of the virtual switch to the first virtual machine and / or limiting the speed of the network computing power used by the first virtual machine that exceeds the third value. In the above scheme, the virtual switch allocates at least part of the idle network computing power of the virtual switch to the first virtual machine whose first value is greater than the corresponding second value, and / or limits the speed of the network computing power used by the first virtual machine that exceeds the third value, which can fully utilize the performance of the virtual switch and prevent competition for network computing power.

[0069] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments.

[0070] The embodiment of the present application provides a speed limiting method, which is applied to a virtual switch, and the virtual switch can be located in a container scenario and a virtual machine scenario under a public cloud and / or a private cloud and / or a hybrid cloud computing platform. Figure 1 As shown, including:

[0071] Step 101: Determine a first value of each virtual machine managed by the virtual switch.

[0072] The first value indicates that the virtual machine consumes the network computing power of the virtual switch.

[0073] Here, the sending and receiving of messages by the virtual machine requires the consumption of the network computing power of the virtual switch. The first value indicates the sum of the network computing power of the virtual switch consumed by the virtual machine in sending and receiving messages. When the virtual switch determines the first value of each virtual machine managed by the virtual switch, the virtual switch needs to determine the sender of the message and the receiver of the message, and then count the first value of each virtual machine.

[0074] For example, when a virtual machine acts as the sender of a message, the virtual machine sends an identifier of the virtual machine to the virtual switch while sending a message to the virtual switch. It is worth noting that the identifier of the virtual machine can be carried in the message; or, the message sent by the virtual machine to the virtual switch carries information that can indicate the virtual machine, so that the virtual switch determines the sender of the message; when the virtual machine acts as the receiver of the message, the message carries the identifier of the virtual machine, or, the message carries information that can indicate the virtual machine, so that the virtual switch determines the receiver of the message.

[0075] In order to enable the virtual switch to determine the recipient of the message, in one embodiment, the rate limiting method further includes:

[0076] Based on the set relationship and the destination address carried by the second message, determine the second virtual machine corresponding to the second message; wherein the set relationship includes at least a mapping relationship between the destination address and the first virtual machine, or a mapping relationship between the destination address and the virtual machine.

[0077] Here, the setting relationship can be characterized or expressed by a dynamic mapping table, or by other forms that can characterize the mapping relationship, and is not specifically limited. It should be noted that the setting relationship can be established when the load of the virtual switch exceeds the set value and stored in the virtual switch. The second message is a message forwarded to the virtual machine through the virtual switch, or a message to be received by the virtual machine. The destination address is, for example, dst-ip. The first virtual machine is a virtual machine managed by the virtual switch whose first value is greater than the corresponding baseline network computing power quota. The baseline network computing power quota of the virtual machine is determined based on the network specification ratio of the virtual machine and the total network computing power of the virtual switch. For example, the PPS of the virtual machine is 1 million (w), the PPS of the virtual switch is 600w, and the total network computing power of the virtual switch is 12 GHz, then the baseline network computing power quota of the virtual machine is 100 / 600×12=2 GHz. The second virtual machine is any virtual machine managed by the virtual switch.

[0078] When the network computing power usage rate of the virtual switch is greater than the set threshold and the first virtual machine is determined in the virtual machines managed by the virtual switch, the set relationship at least includes a mapping relationship between the destination address and the first virtual machine, or a mapping relationship between the destination address and the virtual machine;

[0079] When the network computing power usage of the virtual switch is less than or equal to the set threshold, and / or the first virtual machine is not determined in the virtual machines managed by the virtual switch, the set relationship includes at least a mapping relationship between the destination address and the virtual machine.

[0080] In this embodiment, based on the set relationship and the destination address carried by the second message, the second virtual machine corresponding to the second message is determined, which can consume less network computing power to determine the second virtual machine that receives the second message, and at the same time more accurately determine the second virtual machine that receives the second message, thereby helping to improve the accuracy of the virtual switch in determining the first value of each virtual machine managed by the virtual switch.

[0081] In one embodiment, determining a first value of each virtual machine managed by the virtual switch includes:

[0082] Determine a fifth value of the second virtual machine based on all first messages sent by the second virtual machine, where the second virtual machine is any virtual machine managed by the virtual switch, and the fifth value indicates that the second virtual machine consumes network computing power of the virtual switch when sending messages;

[0083] Determine a sixth value of the second virtual machine based on all second messages received by the second virtual machine, wherein the sixth value indicates that the network computing power of the virtual switch is consumed by receiving the message by the second virtual machine;

[0084] The sum of the fifth value and the sixth value of the second virtual machine is determined as the first value of the second virtual machine.

[0085] Here, the first message is a message sent by the virtual machine.

[0086] The fifth value of the second virtual machine is determined based on all first messages sent by the second virtual machine. For example, when the data amount of each first message is the same, the fifth value of the second virtual machine is determined based on the number of first messages and the data amount of a first message; or when the data amounts of different first messages are different, the fifth value of the second virtual machine is determined based on the data amount of each first message.

[0087] The sixth value of the second virtual machine is determined based on all second messages received by the second virtual machine. For example, when the data amount of each second message is the same, the sixth value of the second virtual machine is determined based on the number of second messages and the data amount of a second message; or when the data amounts of different second messages are different, the sixth value of the second virtual machine is determined based on the data amount of each second message.

[0088] It should be understood that the manner of determining the fifth value and the sixth value is not limited, and they may also be determined based on the timestamps of sending and receiving the corresponding messages.

[0089] In this embodiment, the method of determining the first value of each virtual machine managed by the virtual switch is clearly defined, which improves the efficiency of determining the first value and ensures that the accuracy of the first value is high.

[0090] Step 102: When the network computing power usage rate of the virtual switch is greater than a set threshold, all first virtual machines are determined in the virtual machines managed by the virtual switch; wherein the first value of the first virtual machine is greater than the corresponding second value.

[0091] The second value indicates the baseline network computing power quota of the virtual machine.

[0092] Here, the threshold can be set according to actual needs. The network computing power utilization rate of the virtual switch can be determined in different statistical periods. The threshold corresponding to the network computing power utilization rate of the virtual switch in different statistical periods can be different. The second value can be set according to actual needs, or can be obtained by calculation, and is not specifically limited.

[0093] In order to accurately determine whether the network computing power usage of the virtual switch is greater than the set threshold, in one embodiment, the speed limiting method further includes:

[0094] Determine the network computing power usage of the virtual switch in one or more statistical periods;

[0095] When the network computing power usage rate in any statistical period is greater than the corresponding set threshold, it is determined that the network computing power usage rate of the virtual switch is greater than the set threshold.

[0096] Here, the network computing power usage rate of the virtual switch in one or more statistical periods can be determined based on the network computing power overhead of the virtual switch in the corresponding statistical period and the corresponding statistical period.

[0097] When the network computing power usage rate in all statistical periods is less than or equal to the corresponding set threshold, it is determined that the network computing power usage rate of the virtual switch is less than or equal to the set threshold.

[0098] In this embodiment, by determining the network computing power utilization rate of the virtual switch within one or more statistical periods, when the network computing power utilization rate within any statistical period is greater than the corresponding set threshold, it is determined that the network computing power utilization rate of the virtual switch is greater than the set threshold. This can cover conventional burst and micro-burst scenarios and improve the accuracy of determining that the network computing power utilization rate of the virtual switch is greater than the set threshold.

[0099] In one embodiment, different statistical periods correspond to different set thresholds; and the statistical period is negatively correlated with the corresponding set threshold.

[0100] For example, the statistical period includes three granularities of 10 milliseconds (ms), 100 ms and 1000 ms; the set threshold corresponding to 10 ms is 98%, the set threshold corresponding to 100 ms is 95%, and the set threshold corresponding to 1000 ms is 90%.

[0101] In this embodiment, since CPU usage is exclusive, as long as the CPU is used, the smaller the granularity, the higher the usage rate detected. The statistical period is negatively correlated with the corresponding set threshold, which can help improve the accuracy of determining that the network computing power usage of the virtual switch is greater than the set threshold.

[0102] In one embodiment, determining the network computing power usage of the virtual switch in one or more statistical periods includes:

[0103] Determine the network computing power overhead of the virtual switch in each statistical period based on the first value of each virtual machine managed by the virtual switch and / or the message sending overhead and the message receiving overhead of the virtual switch;

[0104] Based on the network computing power overhead in each statistical period and the corresponding statistical period, the network computing power utilization rate of the virtual switch in each statistical period is determined.

[0105] Here, the network computing power cost of the virtual switch in each statistical period can be determined based on the first value of each virtual machine managed by the virtual switch; the network computing power cost of the virtual switch in each statistical period can also be determined based on the message sending cost and message receiving cost of the virtual switch; the network computing power cost of the virtual switch in each statistical period can also be determined based on the first value of each virtual machine managed by the virtual switch, the message sending cost and the message receiving cost of the virtual switch. It should be understood that the network computing power cost can be the CPU computing power cost.

[0106] Based on the first value of each virtual machine managed by the virtual switch, the network computing power overhead of the virtual switch in each statistical period is determined. The network computing power overhead of the virtual switch in each statistical period can be determined as the sum of the first values ​​of all virtual machines managed by the virtual switch in each statistical period.

[0107] Based on the message sending overhead and message receiving overhead of the virtual switch, the network computing power overhead of the virtual switch in each statistical period is determined. The network computing power overhead of the virtual switch in each statistical period can be determined as the sum of the message sending overhead and the message receiving overhead of the virtual switch in each statistical period.

[0108] Based on the first value of each virtual machine managed by the virtual switch, the message sending overhead and the message receiving overhead of the virtual switch, the network computing power overhead of the virtual switch in each statistical period is determined. The eighth value and the ninth value can be weightedly summed to obtain the network computing power overhead of the virtual switch in each statistical period; the eighth value represents the sum of the first values ​​of all virtual machines managed by the virtual switch in each statistical period, and the ninth value represents the sum of the message sending overhead and the message receiving overhead of the virtual switch in each statistical period.

[0109] Here, based on the network computing power overhead in each statistical period and the corresponding statistical period, the network computing power utilization rate of the virtual switch in each statistical period is determined. The network computing power overhead in each statistical period can be divided by the corresponding statistical period to obtain the network computing power utilization rate of the virtual switch in each statistical period; or the sum of the tenth value and the first set deviation value, or the difference between the tenth value and the first set deviation value, is determined as the network computing power utilization rate of the virtual switch in each statistical period. The first set deviation value can be set according to actual needs, and the tenth value represents the value obtained by dividing the network computing power overhead in each statistical period by the corresponding statistical period.

[0110] It should be understood that vSwitch generally uses DPDK as the forwarding framework, and each forwarding thread occupies a logical CPU. The vSwitch mainly processes packets by receiving and forwarding them, i.e., receiving and sending them. Therefore, the network computing power utilization rate of the forwarding thread within a certain statistical period, such as the CPU utilization rate statistical algorithm, can be:

[0111] CPU usage = (message sending overhead + message receiving overhead) / statistical period.

[0112] In this embodiment, the method of clearly determining the network computing power utilization rate of the virtual switch in one or more statistical periods can improve the efficiency of determining the network computing power utilization rate.

[0113] To determine the second value of the virtual machine, in one embodiment, the rate limiting method further includes:

[0114] Determine a second value of each virtual machine based on the total network computing power of the virtual switch and the seventh value of each virtual machine managed by the virtual switch; wherein,

[0115] The seventh value is determined based on the network performance parameters of the virtual machine and the network performance parameters of the virtual switch.

[0116] Here, the network performance parameters represent the network specifications. For example, the network performance parameters include one or more of the following: PPS, bandwidth. It should be understood that the total network computing power of the virtual switch, the network performance parameters of the virtual machine, and the network performance parameters of the virtual switch may be set at the factory.

[0117] The seventh value is determined based on the network performance parameters of the virtual machine and the network performance parameters of the virtual switch. The seventh value can be obtained by dividing the network performance parameters of the virtual machine by the network performance parameters of the virtual switch. Alternatively, the seventh value can be determined as the sum of the eleventh value and the second set deviation value, or the difference between the eleventh value and the second set deviation value. The second set deviation value can be set according to actual needs. The eleventh value represents the value obtained by dividing the network performance parameters of the virtual machine by the network performance parameters of the virtual switch.

[0118] It is worth noting that the network performance parameter of the virtual machine used to determine the seventh value is the same as the network performance parameter of the virtual switch.

[0119] Based on the total network computing power of the virtual switch and the seventh value of each virtual machine managed by the virtual switch, the second value of each virtual machine is determined. The second value of each virtual machine can be determined by multiplying the total network computing power of the virtual switch and the seventh value of each virtual machine managed by the virtual switch. Alternatively, the second value of each virtual machine can be determined by the sum of the twelfth value and the third set deviation value, or the difference between the twelfth value and the third set deviation value. The third set deviation value can be set according to actual needs. The twelfth value represents the product of the total network computing power of the virtual switch and the seventh value of each virtual machine managed by the virtual switch.

[0120] In practical applications, the second value can be calculated by the following formula:

[0121] The second value = (PPS of the VM / PPS of the vSwitch) × the total network computing power of the vSwitch. The total network computing power of the vSwitch may be the total CPU computing power of the vSwitch, which may be determined by factory configuration.

[0122] In this embodiment, the second value of each virtual machine is determined based on the total network computing power of the virtual switch and the seventh value of each virtual machine managed by the virtual switch, that is, the second value is obtained by calculation, which can improve the accuracy of the second value.

[0123] Step 103: Perform a setting operation on at least part of the first virtual machine, wherein the setting operation includes allocating at least part of the idle network computing power of the virtual switch to the first virtual machine and / or limiting the network computing power used by the first virtual machine that exceeds a third value.

[0124] The third value is greater than or equal to the second value.

[0125] Here, in the case where the virtual switch has idle network computing power, at least part of the idle network computing power of the virtual switch is allocated to at least part of the first virtual machines, and the network computing power used by the first virtual machine that exceeds the third value is limited. At this time, for the first virtual machine allocated to the idle network computing power of the virtual switch, the third value is greater than the second value, and for the first virtual machine that is not allocated to the idle network computing power of the virtual switch, the third value is equal to the second value;

[0126] In the case where there is no idle network computing power in the virtual switch, the network computing power used by the first virtual machine that exceeds the third value is limited. At this time, the third value is equal to the second value.

[0127] In this embodiment, the virtual switch allocates at least part of the idle network computing power of the virtual switch to the first virtual machine whose first value is greater than the corresponding second value, and / or limits the speed of the network computing power used by the first virtual machine that exceeds the third value. Compared with the fixed speed limit quota used in the prior art, this embodiment can fully utilize the performance of the virtual switch and prevent competition for network computing power.

[0128] In the case where there is idle network computing power in the virtual switch, in one embodiment, performing the setting operation on at least part of the first virtual machine includes:

[0129] At least part of the idle network computing power of the virtual switch is allocated to at least part of the first virtual machines based at least on the set priorities of all the first virtual machines.

[0130] The setting priority of the first virtual machine can be set according to actual needs.

[0131] Here, the idle network computing power of the virtual switch is preferentially allocated to the first virtual machine with a high priority. When the idle network computing power of the virtual switch can meet the first value of the first virtual machine with a high priority, the idle network computing power of the virtual switch allocated to the first virtual machine with a high priority is the difference between the first value and the second value. When the idle network computing power of the virtual switch cannot meet the first value of the first virtual machine with a high priority, all the idle network computing power of the virtual switch is allocated to the first virtual machine with a high priority. It is worth noting that the idle network computing power of the virtual switch refers to the product of the total network computing power of the virtual switch and the set threshold, and the difference with the thirteenth value; the thirteenth value represents the sum of the second values ​​of all virtual machines managed by the virtual switch.

[0132] When there are first virtual machines with the same set priority, and when the virtual switch allocates idle network computing power based on the set priorities of all first virtual machines and there is still idle network computing power remaining, all the remaining idle network computing power of the virtual switch is evenly allocated to the first virtual machines with the same set priority.

[0133] When all first virtual machines have the same set priority, all idle network computing power of the virtual switch is allocated to all first virtual machines based on the number of first virtual machines, that is, all idle network computing power of the virtual switch is evenly distributed to all first virtual machines.

[0134] In this embodiment, it is clear that at least part of the idle network computing power of the virtual switch can be allocated to at least part of the first virtual machines based on the set priorities of all the first virtual machines, so as to ensure that the network computing power of the first virtual machines with high set priorities is sufficient as much as possible, thereby helping to improve the performance utilization of the virtual switch and avoid competition for network computing power.

[0135] In one embodiment, performing a setting operation on at least part of the first virtual machine includes:

[0136] Prioritize the allocation of idle network computing power of the virtual switch to the first virtual machine with a high priority; or,

[0137] Evenly distribute the idle network computing power of the virtual switch to all first virtual machines; or,

[0138] At least part of the idle network computing power of the virtual switch is evenly distributed to a plurality of first virtual machines with the same set priority.

[0139] Here, when the set priorities of the first virtual machines are different, the idle network computing power of the virtual switch is preferentially allocated to the first virtual machine with a higher set priority.

[0140] When the set priorities of all the first virtual machines are the same, or when the set priorities of the first virtual machines are not considered, the idle network computing power of the virtual switch is evenly distributed to all the first virtual machines.

[0141] In the case that the virtual switch allocates idle network computing power based on the set priorities of all first virtual machines and there is still idle network computing power remaining, at least part of the idle network computing power of the virtual switch is evenly allocated to multiple first virtual machines with the same set priority. Specifically, for multiple first virtual machines with the same set priority and the highest set priority, all the idle network computing power of the virtual switch is evenly allocated to the multiple first virtual machines with the same set priority; in the case that there are first virtual machines with a set priority higher than the same set priority, the remaining idle network computing power of the virtual switch is evenly allocated to the multiple first virtual machines with the same set priority.

[0142] In this embodiment, the method of allocating the idle network computing power of the virtual switch to the first virtual machine is refined, which can further prevent competition for network computing power.

[0143] In one embodiment, the third value includes the second value and the fourth value; and performing the setting operation on at least part of the first virtual machine includes:

[0144] Limiting the network computing power used by the first virtual machine that exceeds the second value; or,

[0145] The network computing power used by the first virtual machine that exceeds a fourth value is limited; the fourth value represents the sum of the second value and the network computing power allocated to the first virtual machine.

[0146] Here, when there is no idle network computing power in the virtual switch, or the first virtual machine is not allocated with the idle network computing power of the virtual switch, the network computing power used by the first virtual machine that exceeds the second value is limited.

[0147] When the first virtual machine is allocated idle network computing power to the virtual switch, the network computing power used by the first virtual machine that exceeds a fourth value is limited.

[0148] In this embodiment, on-demand speed limiting is implemented through a dynamic mechanism, and speed limiting is performed only on the portion of the excess network computing power of the first virtual machine that is not allocated on demand, thereby ensuring a good network experience for the virtual machine.

[0149] The present application is further described in detail below in conjunction with an application example. The speed limiting method provided by the present application is applied to a virtual switch, and the application scenario diagram is as follows: Figure 2 As shown. The virtual switch vSwitch may include a load detector (Load-detector), a statistics collector (Stats-collector) and a speed limit scheduler (Qos-scheduler). The virtual switch allocates a second value (benchmark network computing power quota also known as cpu cycles quota) of network computing power to virtual machines vm1 and vm2 respectively; the second value of vm1 and the second value of vm2 may be the same or different. The physical network card (physical NIC) inputs traffic (ingress traffic) to the virtual machine through the virtual switch, that is, the virtual machine receives the message; the virtual machine outputs traffic (egress traffic) to the physical network card through the virtual switch, that is, the virtual machine sends the message.

[0150] The load detector is a module that runs normally. When the vSwitch load is not high, the performance specifications of the VM can be guaranteed by conventional bandwidth speed limits and PPS speed limits. At this time, the speed limit method can be deactivated; when the vSwitch load is high, the speed limit method can be activated to ensure the network forwarding performance of the VM and avoid mutual competition. The load detector counts the CPU of each current forwarding thread at different time granularities, that is, determines the network computing power utilization rate of the virtual switch in one or more statistical periods. When the network computing power utilization rate in any statistical period is greater than the corresponding set threshold, it is determined that the network computing power utilization rate of the virtual switch is greater than the set threshold, and the speed limit scheduler is activated.

[0151] In order to achieve the purpose of activating the speed limit scheduler in time, different thresholds need to be set according to different statistical periods. The shorter the statistical period, the higher the threshold needs to be set. The following Table 1 is a reference threshold setting.

[0152] Table 1

[0153]

[0154]

[0155] The statistics collector is used to determine the first value of each virtual machine managed by the virtual switch. When each message is forwarded by the vSwitch, the CPU cycle is collected by tsc and recorded under the corresponding virtual machine, for example, in the form of a table. Figure 3 shown. Figure 3 Among them, pkt1 represents the inbound direction, i.e., the virtual machine receives packets, and pkt2 represents the outbound direction, i.e., the virtual machine sends packets. The CPU cycle is calculated by the timestamp. The inbound cycle (pkt1_cycles) is tsc2-tsc1, and the outbound cycle (pkt2_cycles) is tsc4-tsc3.

[0156] It is worth noting that in order to accurately count the CPU cycles, it is necessary to clearly identify the virtual machines that receive and send messages; for the outbound direction of the message, the virtual machine to which the message belongs can be directly determined through the vhost-user device; for the inbound direction of the message, the vSwitch receives it from the physical port, that is, the physical network card. In order to avoid the waste of resources and low efficiency caused by the existing technology that requires parsing and several table lookups to determine the virtual machine to which the message belongs, the dynamic dst-ip cache mapping table can be used to determine the virtual machine to which the message belongs. Specifically, the dst-ip cache is a mapping table of destination addresses such as dst-ip and virtual machines; by parsing the dst-ip of the message received by the VM, it can be determined which VM it belongs to, and then the mapping relationship between the dst-ip and the corresponding VM is stored in the mapping table. The dst-ip cache can be generated when the load detector detects that the vSwitch load is high and the rate limit scheduler is activated; when the virtual machine no longer generates packet loss, the mapping table will begin to age and be deleted. In this way, under normal circumstances, there will be no dst-ip cache, which will not affect the performance of the vSwitch; when the vSwitch is under high load, it can be generated for the VM that is limited in speed. That is, the mapping table of a computing node generally has only a few mapping relationships, which has little impact on the performance of the vSwitch.

[0157] The speed limit scheduler is used to configure a second value for each virtual machine managed by the virtual switch, determine a first virtual machine, allocate at least part of the idle network computing power of the virtual switch to the first virtual machine and / or limit the network computing power used by the first virtual machine that exceeds a third value.

[0158] The speed limiting method provided in this embodiment includes the following steps:

[0159] Step 1: The vSwitch collects the first value of each virtual machine in a regular manner through a statistics collector.

[0160] Specifically, for the second virtual machine, the second virtual machine is any virtual machine managed by the virtual switch. The timestamps of the sending time and the receiving time of the first message and the second message can be obtained through the rdtsc instruction to determine the fifth value and the sixth value, and the sum of the fifth value and the sixth value of the second virtual machine is determined as the first value of the second virtual machine.

[0161] Schematic diagram of the network computing power overhead of vm1 receiving and sending messages, such as Figure 4 shown. Figure 4The input traffic includes dst-ip cache (which can be generated when the vSwitch load is high, the rate limit scheduler is activated, and vm1 is rate limited by the network computing power QoS), table 1 lookup, ..., table N lookup; the output traffic includes table 1 lookup, ..., table N lookup. The sum of the input traffic and the output traffic is taken as the first value of vm1.

[0162] Step 2: The vSwitch uses a load detector to routinely detect whether the network computing power usage of the vSwitch data plane, that is, the CPU usage, is greater than the set threshold. If the network computing power usage is greater than the set threshold, rate limiting is performed in advance to prevent the CPU from being too high, resulting in delayed message processing and packet loss.

[0163] In order to realize burst detection of different granularities, three detection methods with three granularities, namely three statistical periods, of 10ms, 100ms and 1000ms are implemented to ensure that both regular burst and micro-burst scenarios can be covered. If the rate at any granularity is greater than the set threshold, the speed limit will be triggered.

[0164] Schematic diagram of CPU usage of virtual switches in different statistical periods, such as Figure 5 shown. Figure 5 The CPU utilization at different granularities is calculated (calculate cpu utilization at different granularities), including the cost for other calculating of the thread polling loop, the cost for pkts polling, and the cost for pkts forwarding. Generally, the coarser the sampling granularity, the easier it is to average the CPU utilization. For example, the CPU utilization corresponding to 10ms is 90%, the CPU utilization corresponding to 100ms is 80%, and the CPU utilization corresponding to 1000ms (1 second) is 75%. From the perspective of the 1s granularity, the CPU utilization is only 75%, which is still at a reasonable level; but from the perspective of the 10ms granularity, the CPU utilization has reached 90%, indicating that there is a microburst at this time, and speed limiting measures must be taken in time to avoid competition for network computing power.

[0165] Step 3: When the network computing power usage of the virtual switch is greater than the set threshold, it is necessary to immediately enter the speed limit state.

[0166] Specifically, based on the total network computing power of the virtual switch and the seventh value of each virtual machine managed by the virtual switch, the second value of each virtual machine is determined; all first virtual machines are determined among the virtual machines managed by the virtual switch, and the first value of the first virtual machine is greater than the corresponding second value; at least based on the set priority of all first virtual machines, at least part of the idle network computing power of the virtual switch is allocated to at least some of the first virtual machines; if the first virtual machine obtains sufficient network computing power, it may not be speed-limited, and if the network computing power obtained by the first virtual machine is insufficient, the network computing power used by the first virtual machine that exceeds the third value needs to be speed-limited. The speed-limiting method may be to increase the forwarding delay of the over-limited part of the message. It can be understood that the forwarding delay of all messages is not increased indiscriminately.

[0167] It is worth noting that the use of dynamic allocation to allocate at least part of the idle network computing power of the virtual switch to the first virtual machine can not only ensure the basic network computing power of each virtual machine, but also give full play to the overall network computing power of the vSwitch. Setting the priority only determines the additional network computing power that can be obtained from the vSwitch in addition to the second value, and does not affect the forwarding delay of the message.

[0168] It should be noted that while the baseline network computing power quota is allocated proportionally based on the network specifications, the idle network computing power is dynamically allocated a second time according to the set priority, which can ensure that the computing power of the VM with high set priority is sufficient; based on "proportional" and "set priority", the load detector supports multi-granularity speed limit protection to ensure that large bandwidth bursts and microbursts can be limited in time; within the baseline network computing power quota, all VM network messages can be forwarded fairly without increasing the forwarding delay of any VM.

[0169] Step 4: When the traffic of the VM with a burst of traffic decreases and is no longer limited and dropped, the corresponding dst-ip cache entry will be aged and deleted; when the network computing power usage of the virtual switch is less than or equal to the set threshold, the vSwitch returns to the unlimited speed state.

[0170] Taking the dynamic speed limit of vSwitch on a computing node with 64 CPU cores as an example, the specific configuration parameters are shown in Table 2.

[0171] Table 2

[0172]

[0173]

[0174] The overall network forwarding capability of the vSwitch, i.e., the network performance parameter, is 640wpps. The computing power used by the vSwitch for network forwarding, i.e., the total network computing power, is 8GHz, which can be abbreviated as 8G. The corresponding set threshold within the statistical period of 1s is 90%, the corresponding set threshold of 100ms is 95%, and the corresponding set threshold of 10ms is 98%. If the network computing power usage rate within any statistical period is greater than the corresponding set threshold, it is determined that the network computing power usage rate of the virtual switch is greater than the set threshold, that is, any of the following conditions is met to activate the speed limit:

[0175] When the CPU usage is >= 7.2G within 1s, i.e. the CPU idle time is <= 0.8G;

[0176] When the CPU usage is >= 7.6G within 100ms, i.e. the CPU idle time is <= 0.4G;

[0177] The CPU usage is >= 7.84G within 10ms, that is, the CPU idle time is <= 0.16G.

[0178] There are three virtual machines on the computing node, namely vm1, vm2 and vm3. The specific parameters of the three virtual machines are shown in Table 3 below.

[0179] Table 3

[0180]

[0181] The second value is obtained by dividing the network specifications, i.e. the proportion of network performance parameters, to ensure that there is no overselling. In addition to the three virtual machines, the computing node has 1.5G of idle network computing power. The network computing power configuration diagram is as follows: Figure 6 shown. Figure 6 The network computing power range with a threshold of 90% is shown in FIG.

[0182] The vSwitch accumulates the first value of each virtual machine in the form of CPU cycles and determines the network computing power utilization of the virtual switch, which includes the following three states:

[0183] State 1: The virtual switch has not activated rate limiting and is in a steady state, for example Figure 7 shown.

[0184] Figure 7 The first value of vm1 is 1G, which is greater than the second value. However, the first value of vm2 is 2G, and the first value of vm3 is 4G. At this time, the network computing power utilization rate of the virtual switch is 87.5%, which is less than 90%. Therefore, the speed limit is not activated.

[0185] State 2: The network computing power usage of the virtual switch is greater than the set threshold of 90% and is in an unstable state, such as Figure 8 shown.

[0186] Figure 8 The first value of vm1 is 1G, and the first value of vm2 is 2G, but vm3 has burst traffic, and the first value of vm3 is 4.5G. At this time, the network computing power utilization rate of the virtual switch is 93.75%, which is greater than 90%. The load detector will activate the speed limit scheduler. The speed limit scheduler determines the first virtual machines, namely vm1 and vm3, and vm1 and vm3 may be speed limited; the network computing power consumed by vm2 does not exceed the second value and will not be speed limited.

[0187] State 3: The virtual switch activates rate limiting.

[0188] Taking the threshold as 90% as an example, the idle network computing power of the virtual switch is 8×90%-0.5-2-4=0.7G.

[0189] When vm1 and vm3 are set to the same priority, idle network computing power is allocated to vm1 and vm3, such as Fig. 9 As shown. Since vm1 and vm3 have the same priority, the 0.7G idle network computing power of the virtual switch is evenly distributed to vm1 and vm3. At this time, the network computing power of vm1 is 0.5+0.7 / 2=0.85G, and the network computing power of vm3 is 4+0.7 / 2=4.35G. The first value of vm1 is 1G, and the first value of vm3 is 4.5G. Therefore, it is necessary to limit the speed of the 1-0.85=0.15G part of vm1, and the speed of the 4.5-4.35=0.15G part of vm3.

[0190] When vm1 and vm3 have different priorities, for example, vm1 has a higher priority than vm3, idle network computing power is allocated to vm1 and vm3, such as Fig.10 As shown in the figure. Since the priority of vm1 is higher than that of vm3, the idle network computing power of the virtual switch is allocated to vm1 first, and 1-0.5 = 0.5G of idle network computing power is allocated to vm1, and the remaining 0.2G of idle network computing power is allocated to vm3. At this time, vm1 does not need to be speed-limited, but the 4.5-4.2 = 0.3G portion of vm3 needs to be speed-limited.

[0191] To facilitate the observation of the network computing power distribution from state 1 to state 3, a schematic diagram of the network computing power distribution process is provided here, as shown in the figure: Fig.11 shown.

[0192] Through test comparison, on a computing node, two 16-core VMs are run at the same time, of which VM1 runs the redis service that is highly sensitive to network delay, and VM2 is attacked by DDoS traffic; if the speed limit method of the present application is not used, when VM2 is attacked, the CPU of the vSwitch data plane continues to be high, and VM1's redis has a large number of delays and reconnections, and the delay increases from the original 350 microseconds (us) to 1s, and the worst-case delay increases to 3s; if the speed limit method of the present application is used, when VM2 is attacked, vSwtich will trigger the speed limit, part of the DDoS traffic will be discarded by the speed limit, and the CPU of the vSwitch data plane will be maintained within the set threshold. At the same time, VM1's redis request is little affected, and the delay increases from the original 350us to only 400us, and the overall delay is stable; it can be seen that the speed limit method of the present application has a good isolation of VM network traffic and ensures the baseline network performance of the VM.

[0193] The speed limiting method provided by the present application, in order to maximize the use of the overall network performance of the vSwitch, does not limit the speed when the load is low, and ensures that each VM forwards as much as possible; and accurately counts the VM network computing power based on the CPU cycle. From the actual test situation, the existing speed limit error is up to 30%. The present application specifically implements fast identification cache, completes the identification of the VM to which the message belongs in the early stage of receiving the message, greatly improves the statistical accuracy of the network computing power, and makes the speed limit error less than 3%; the dynamic speed limit method (i.e., "collection-detection-scheduling speed limit") can largely solve the difficult problem of network computing power competition of the current public cloud computing nodes; through the multi-granularity CPU load detection mechanism, the vSwitch forwarding performance level is detected in real time to ensure that possible network performance competition is predicted as early as possible and enter the speed limit state; in order to ensure the fairness and effectiveness of the speed limit, the idle network computing power of the virtual switch is also dynamically allocated based on the set priority, that is, on the premise of ensuring the second value of the network computing power of each VM, the first value of each VM is allocated in real time. The value is the actual network computing power usage, and the available idle network computing power is allocated according to the set priority. Network isolation between virtual machines is achieved, which can achieve millisecond-level speed limit response and fully utilize the network computing power of vSwitch. Especially in cloud computing scenarios, it can solve the current problems of network performance overselling and poor network isolation that cloud vendors are plagued by in real time on the computing node, avoiding additional network disconnection and delays caused by migration. It can increase speed and efficiency, and is a low-cost, feasible and easy-to-promote precise speed limit method with high practicality. It can help reduce complaints about cloud computing network quality and reduce manual operation and maintenance costs. It can also avoid resolving user complaints through migration, and reduce additional computing node costs caused by migration. At the same time, the server's electricity and operation and maintenance costs are also saved accordingly. Considering the cost savings, it is linearly related to the scale of cloud computing and has greater long-term benefits.

[0194] In order to implement a speed limiting method provided in an embodiment of the present application, an embodiment of the present application also provides a speed limiting device, such as Fig.12 As shown, the device comprises:

[0195] A first determination module 1201 is used to determine a first value of each virtual machine managed by the virtual switch, wherein the first value indicates that the virtual machine consumes network computing power of the virtual switch;

[0196] The second determination module 1202 is used to determine all first virtual machines in the virtual machines managed by the virtual switch when the network computing power usage rate of the virtual switch is greater than the set threshold; wherein the first value of the first virtual machine is greater than the corresponding second value, and the second value indicates the baseline network computing power quota of the virtual machine;

[0197] The execution module 1203 is used to perform a setting operation on at least part of the first virtual machine, wherein the setting operation includes allocating at least part of the idle network computing power of the virtual switch to the first virtual machine and / or limiting the network computing power used by the first virtual machine that exceeds a third value; the third value is greater than or equal to the second value.

[0198] In one embodiment, the execution module 1203 is specifically configured to allocate at least part of the idle network computing power of the virtual switch to at least part of the first virtual machines based at least on the set priorities of all the first virtual machines.

[0199] In one embodiment, the execution module 1203 is specifically configured to preferentially allocate the idle network computing power of the virtual switch to the first virtual machine with a high priority; or,

[0200] Evenly distribute the idle network computing power of the virtual switch to all first virtual machines; or,

[0201] At least part of the idle network computing power of the virtual switch is evenly distributed to a plurality of first virtual machines with the same set priority.

[0202] In one embodiment, the third value includes the second value and the fourth value; the execution module 1203 is specifically used to limit the network computing power used by the first virtual machine that exceeds the second value; or,

[0203] The network computing power used by the first virtual machine that exceeds a fourth value is limited; the fourth value represents the sum of the second value and the network computing power allocated to the first virtual machine.

[0204] In one embodiment, the device further comprises:

[0205] A third determination module is used to determine the network computing power usage rate of the virtual switch in one or more statistical periods;

[0206] When the network computing power usage rate in any statistical period is greater than the corresponding set threshold, it is determined that the network computing power usage rate of the virtual switch is greater than the set threshold.

[0207] In one embodiment, different statistical periods correspond to different set thresholds; and the statistical period is negatively correlated with the corresponding set threshold.

[0208] In one embodiment, the third determination module is specifically used to determine the network computing power overhead of the virtual switch in each statistical period based on the first value of each virtual machine managed by the virtual switch and / or the message sending overhead and the message receiving overhead of the virtual switch;

[0209] Based on the network computing power overhead in each statistical period and the corresponding statistical period, the network computing power utilization rate of the virtual switch in each statistical period is determined.

[0210] In one embodiment, the first determination module 1201 is specifically configured to determine a fifth value of the second virtual machine based on all first messages sent by the second virtual machine, the second virtual machine being any virtual machine managed by the virtual switch, and the fifth value indicating that the second virtual machine consumes network computing power of the virtual switch when sending messages;

[0211] Determine a sixth value of the second virtual machine based on all second messages received by the second virtual machine, wherein the sixth value indicates that the network computing power of the virtual switch is consumed by receiving the message by the second virtual machine;

[0212] The sum of the fifth value and the sixth value of the second virtual machine is determined as the first value of the second virtual machine.

[0213] In one embodiment, the device further comprises:

[0214] The fourth determination module is used to determine the second virtual machine corresponding to the second message based on the set relationship and the destination address carried by the second message; wherein the set relationship includes at least a mapping relationship between the destination address and the first virtual machine, or a mapping relationship between the destination address and the virtual machine.

[0215] In one embodiment, the device further comprises:

[0216] A fifth determination module is used to determine the second value of each virtual machine based on the total network computing power of the virtual switch and the seventh value of each virtual machine managed by the virtual switch; wherein,

[0217] The seventh value is determined based on the network performance parameters of the virtual machine and the network performance parameters of the virtual switch.

[0218] In actual application, the first determination module 1201, the second determination module 1202, the execution module 1203, the third determination module, the fourth determination module and the fifth determination module may be implemented by a processor in the speed limiting device.

[0219] It should be noted that: the above embodiment provides a speed limiting device, and only uses the division of the above program modules as an example to illustrate when performing speed limiting. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the speed limiting device and the speed limiting method embodiment provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0220] Based on the hardware implementation of the above program module, and in order to implement a speed limiting method provided in the embodiment of the present application, the embodiment of the present application also provides a virtual switch, such as Fig.13 As shown, the virtual switch 1300 includes:

[0221] Communication interface 1301, capable of exchanging information with other network nodes;

[0222] The processor 1302 is connected to the communication interface 1301 to implement information exchange with other network nodes, and is used to execute the method provided by one or more technical solutions when running a computer program. The computer program is stored in the memory 1303.

[0223] Specifically, the processor 1302 is used to determine a first value of each virtual machine managed by the virtual switch, determine all first virtual machines among the virtual machines managed by the virtual switch when the network computing power usage rate of the virtual switch is greater than a set threshold, and perform a setting operation on at least some of the first virtual machines; wherein the first value of the first virtual machine is greater than the corresponding second value; the setting operation includes allocating at least part of the idle network computing power of the virtual switch to the first virtual machine and / or limiting the network computing power used by the first virtual machine in excess of a third value; the first value indicates that the virtual machine consumes the network computing power of the virtual switch, the second value indicates the baseline network computing power quota of the virtual machine, and the third value is greater than or equal to the second value.

[0224] In one embodiment, the processor 1302 is specifically configured to allocate at least part of the idle network computing power of the virtual switch to at least part of the first virtual machines based at least on the set priorities of all the first virtual machines.

[0225] In one embodiment, the processor 1302 is specifically configured to preferentially allocate the idle network computing power of the virtual switch to the first virtual machine with a high priority; or,

[0226] Evenly distribute the idle network computing power of the virtual switch to all first virtual machines; or,

[0227] At least part of the idle network computing power of the virtual switch is evenly distributed to a plurality of first virtual machines with the same set priority.

[0228] In one embodiment, the third value includes the second value and the fourth value; the processor 1302 is specifically configured to limit the speed of the network computing power used by the first virtual machine that exceeds the second value; or,

[0229] The network computing power used by the first virtual machine that exceeds a fourth value is limited; the fourth value represents the sum of the second value and the network computing power allocated to the first virtual machine.

[0230] In one embodiment, the processor 1302 is further configured to determine a network computing power usage rate of the virtual switch in one or more statistical periods;

[0231] When the network computing power usage rate in any statistical period is greater than the corresponding set threshold, it is determined that the network computing power usage rate of the virtual switch is greater than the set threshold.

[0232] In one embodiment, different statistical periods correspond to different set thresholds; and the statistical period is negatively correlated with the corresponding set threshold.

[0233] In one embodiment, the processor 1302 is specifically configured to determine the network computing power overhead of the virtual switch in each statistical period based on the first value of each virtual machine managed by the virtual switch and / or the message sending overhead and the message receiving overhead of the virtual switch;

[0234] Based on the network computing power overhead in each statistical period and the corresponding statistical period, the network computing power utilization rate of the virtual switch in each statistical period is determined.

[0235] In one embodiment, the processor 1302 is specifically configured to determine a fifth value of the second virtual machine based on all first messages sent by the second virtual machine, where the second virtual machine is any virtual machine managed by the virtual switch, and the fifth value indicates that the second virtual machine consumes network computing power of the virtual switch when sending messages;

[0236] Determine a sixth value of the second virtual machine based on all second messages received by the second virtual machine, wherein the sixth value indicates that the network computing power of the virtual switch is consumed by receiving the message by the second virtual machine;

[0237] The sum of the fifth value and the sixth value of the second virtual machine is determined as the first value of the second virtual machine.

[0238] In one embodiment, the processor 1302 is also used to determine the second virtual machine corresponding to the second message based on the set relationship and the destination address carried by the second message; wherein the set relationship includes at least a mapping relationship between the destination address and the first virtual machine, or a mapping relationship between the destination address and the virtual machine.

[0239] In one embodiment, the processor 1302 is further configured to determine a second value for each virtual machine based on the total network computing power of the virtual switch and a seventh value for each virtual machine managed by the virtual switch; wherein,

[0240] The seventh value is determined based on the network performance parameters of the virtual machine and the network performance parameters of the virtual switch.

[0241] It should be noted that the specific processing process of the processor 1302 can be understood by referring to the above method.

[0242] Of course, in actual application, the various components in the virtual switch 1300 are coupled together through the bus system 1304. It is understandable that the bus system 1304 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 1304 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Fig.13 Various buses are labeled as bus system 1304 .

[0243] The memory 1303 in the embodiment of the present application is used to store various types of data to support the operation of the virtual switch 1300. Examples of such data include: any computer program used to operate on the virtual switch 1300.

[0244] The method disclosed in the above embodiment of the present application can be applied to the processor 1302, or implemented by the processor 1302. The processor 1302 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of the hardware in the processor 1302 or an instruction in the form of software. The above-mentioned processor 1302 may be a general-purpose processor, a digital signal processor (DSP, DigitalSignal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 1302 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in the memory 1303, and the processor 1302 reads the information in the memory 1303 and completes the steps of the above method in combination with its hardware.

[0245] In an exemplary embodiment, the virtual switch 1300 can be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to execute the aforementioned method.

[0246] It can be understood that the memory 1303 of the embodiment of the present application can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a RAM, which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), direct memory bus random access memory (DRRAM). The memory 1303 described in the embodiments of the present application is intended to include but is not limited to these and any other suitable types of memory.

[0247] In an exemplary embodiment, the embodiment of the present application further provides a virtual switch, including a processor and a memory for storing a computer program that can be run on the processor, wherein the processor is used to execute the steps of any of the above methods when running the computer program.

[0248] The embodiment of the present application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, for example, including a memory 1303 storing a computer program, and the computer program can be executed by the processor 1302 of the virtual switch 1300 to complete the steps of the aforementioned method. The computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface storage, optical disk, or CD-ROM.

[0249] An embodiment of the present application further provides a computer program product, including a computer program, which implements the steps of any of the above methods when executed by a processor.

[0250] It should be noted that "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. The term "and / or" in this article is only a description of the association relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0251] In addition, the technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict.

[0252] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application.

Claims

1. A speed limiting method, characterized in that: Applied to a virtual switch, the method comprises: Determining a first value for each virtual machine managed by the virtual switch, the first value indicating that the virtual machine consumes network computing power of the virtual switch; When the network computing power usage rate of the virtual switch is greater than a set threshold, all first virtual machines are determined in the virtual machines managed by the virtual switch; wherein the first value of the first virtual machine is greater than the corresponding second value, and the second value indicates the baseline network computing power quota of the virtual machine; A setting operation is performed on at least part of the first virtual machine, wherein the setting operation includes allocating at least part of the idle network computing power of the virtual switch to the first virtual machine and / or limiting the network computing power used by the first virtual machine that exceeds a third value; the third value is greater than or equal to the second value.

2. The method according to claim 1, characterized in that The performing of the setting operation on at least part of the first virtual machine includes: At least part of the idle network computing power of the virtual switch is allocated to at least part of the first virtual machines based at least on the set priorities of all the first virtual machines.

3. The method according to claim 1, characterized in that The performing of the setting operation on at least part of the first virtual machine includes: Prioritize the allocation of idle network computing power of the virtual switch to the first virtual machine with a high priority; or, Evenly distribute the idle network computing power of the virtual switch to all first virtual machines; or, At least part of the idle network computing power of the virtual switch is evenly distributed to a plurality of first virtual machines with the same set priority.

4. The method according to claim 1, characterized in that: The third value includes the second value and the fourth value; and performing the setting operation on at least part of the first virtual machine includes: Limiting the network computing power used by the first virtual machine that exceeds the second value; or, The network computing power used by the first virtual machine that exceeds a fourth value is limited; the fourth value represents the sum of the second value and the network computing power allocated to the first virtual machine.

5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Determine the network computing power usage of the virtual switch in one or more statistical periods; When the network computing power usage rate in any statistical period is greater than the corresponding set threshold, it is determined that the network computing power usage rate of the virtual switch is greater than the set threshold.

6. The method according to claim 5, characterized in that Different statistical periods correspond to different set thresholds; the statistical period is negatively correlated with the corresponding set threshold.

7. The method according to claim 5, characterized in that Determining the network computing power usage rate of the virtual switch in one or more statistical periods includes: Determine the network computing power overhead of the virtual switch in each statistical period based on the first value of each virtual machine managed by the virtual switch and / or the message sending overhead and the message receiving overhead of the virtual switch; Based on the network computing power overhead in each statistical period and the corresponding statistical period, the network computing power utilization rate of the virtual switch in each statistical period is determined.

8. The method according to any one of claims 1 to 4, 6 to 7, characterized in that: The determining of a first value of each virtual machine managed by the virtual switch comprises: Determine a fifth value of the second virtual machine based on all first messages sent by the second virtual machine, where the second virtual machine is any virtual machine managed by the virtual switch, and the fifth value indicates that the second virtual machine consumes network computing power of the virtual switch when sending messages; Determine a sixth value of the second virtual machine based on all second messages received by the second virtual machine, wherein the sixth value indicates that the network computing power of the virtual switch is consumed by receiving the message by the second virtual machine; The sum of the fifth value and the sixth value of the second virtual machine is determined as the first value of the second virtual machine.

9. The method according to claim 8, characterized in that The method further comprises: Based on the set relationship and the destination address carried by the second message, determine the second virtual machine corresponding to the second message; wherein the set relationship includes at least a mapping relationship between the destination address and the first virtual machine, or a mapping relationship between the destination address and the virtual machine.

10. The method according to any one of claims 1 to 4, 6 to 7 and 9, characterized in that: The method further comprises: Determine a second value of each virtual machine based on the total network computing power of the virtual switch and the seventh value of each virtual machine managed by the virtual switch; wherein, The seventh value is determined based on the network performance parameters of the virtual machine and the network performance parameters of the virtual switch.

11. A speed limiting device, characterized in that: The device comprises: A first determination module, configured to determine a first value of each virtual machine managed by the virtual switch, wherein the first value indicates that the virtual machine consumes network computing power of the virtual switch; A second determination module is used to determine all first virtual machines in the virtual machines managed by the virtual switch when the network computing power usage rate of the virtual switch is greater than a set threshold; wherein the first value of the first virtual machine is greater than the corresponding second value, and the second value indicates the baseline network computing power quota of the virtual machine; An execution module is used to perform a setting operation on at least part of the first virtual machine, wherein the setting operation includes allocating at least part of the idle network computing power of the virtual switch to the first virtual machine and / or limiting the network computing power used by the first virtual machine that exceeds a third value; the third value is greater than or equal to the second value.

12. A virtual switch, characterized in that: include: Processor and communication interface; wherein, The processor is used to determine a first value of each virtual machine managed by the virtual switch, determine all first virtual machines in the virtual machines managed by the virtual switch when the network computing power usage rate of the virtual switch is greater than a set threshold, and perform a setting operation on at least some of the first virtual machines; wherein the first value of the first virtual machine is greater than the corresponding second value; the setting operation includes allocating at least part of the idle network computing power of the virtual switch to the first virtual machine and / or limiting the network computing power used by the first virtual machine that exceeds a third value; the first value indicates that the virtual machine consumes the network computing power of the virtual switch, the second value indicates the baseline network computing power quota of the virtual machine, and the third value is greater than or equal to the second value.

13. A virtual switch, characterized in that: comprising a processor and a memory for storing a computer program capable of being executed on the processor, Wherein, when the processor is used to run the computer program, it executes the steps of the method described in any one of claims 1 to 10.

14. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.

Citation Information

Cited By

  • Virtual power plant data security protection method and system and electronic equipment

    CN121637535A