Bandwidth adjusting method and computing device
By dynamically redistributing the maximum available bandwidth of the virtual machine, the problem that traditional technologies cannot meet the rapidly changing network requirements is solved, and adaptive adjustment of virtual machine bandwidth and optimization of network performance is achieved.
Patent Information
- Application Number
- CN202411615257.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-03-04
AI Technical Summary
Traditional bandwidth regulating technology has significant limitations in virtual machine environments and cannot meet rapidly changing network needs.
By obtaining the total bandwidth of the computing device and the actual bandwidth of each virtual machine, the maximum available bandwidth of the target virtual machine is dynamically redistributed to optimize network performance and improve bandwidth utilization.
Adaptive adjustment of virtual machine bandwidth is realized, network performance is optimized, bandwidth adjustment efficiency is improved, and bandwidth resources are ensured.
Smart Images

Figure CN119557090A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of communication technology, and in particular to a bandwidth adjustment method and a computing device. Background Art
[0002] As the core component of virtualization technology, virtual machines (VMs) can run on physical servers (such as hosts) and share the host's physical resources, such as computing resources, storage resources, and network resources. However, the widespread application of virtualization technology has made the management and allocation of network resources (such as network bandwidth) increasingly complex. As for network bandwidth regulation of virtual machines, traditional bandwidth regulation technologies have significant limitations in virtual machine environments and cannot meet rapidly changing network requirements. Summary of the invention
[0003] The embodiments of the present application provide a bandwidth adjustment method and a computing device, which can realize adaptive adjustment of the bandwidth of a virtual machine to optimize network performance and improve the efficiency of bandwidth adjustment.
[0004] In order to achieve the above purpose, the embodiment of the present application adopts the following technical solution:
[0005] In a first aspect, an embodiment of the present application provides a bandwidth adjustment method for a first computing device, wherein the first computing device includes multiple first virtual machines, the method comprising: obtaining the total bandwidth configured for the first computing device, and periodically obtaining the actual bandwidth used by each first virtual machine; if the sum of the actual bandwidth used by the multiple first virtual machines reaches the total bandwidth, determining a target virtual machine among the multiple first virtual machines, wherein there are one or more target virtual machines, and the target virtual machine is a virtual machine whose bandwidth is to be adjusted; based on the total bandwidth and / or the actual bandwidth used by each first virtual machine, reallocating the maximum available bandwidth of the target virtual machine.
[0006] Based on this implementation, if the sum of the actual bandwidth used by multiple first virtual machines in the first computing device reaches the total bandwidth of the first computing device, the first computing device can determine the target virtual machine whose bandwidth is to be adjusted, and dynamically adjust the maximum available bandwidth of the target virtual machine based on the total bandwidth and / or the actual bandwidth used by each first virtual machine, thereby optimizing network performance and improving bandwidth utilization. In addition, the first computing device can autonomously adjust the maximum available bandwidth of the target virtual machine without having to report the actual bandwidth used by each first virtual machine to the virtual machine management platform in real time and then let the virtual machine management platform determine how to adjust the bandwidth of the target virtual machine, thereby improving the efficiency of bandwidth adjustment for the virtual machine.
[0007] In a possible implementation, if the sum of the actual bandwidth used by the multiple first virtual machines reaches the total bandwidth, a target virtual machine is determined among the multiple first virtual machines, including: if the sum of the actual bandwidth used by the multiple first virtual machines reaches the total bandwidth, the required bandwidth of each first virtual machine is obtained; based on the required bandwidth and the actual bandwidth used by each first virtual machine, the target virtual machine is determined among the multiple first virtual machines.
[0008] Based on this implementation, when the sum of the actual bandwidth used by multiple first virtual machines reaches the total bandwidth, the first computing device can further obtain the required bandwidth of each first virtual machine, so that a target virtual machine can be determined among the multiple first virtual machines based on the required bandwidth and the actual bandwidth used by each first virtual machine, and the maximum available bandwidth of the target virtual machine can be allocated.
[0009] In another possible implementation, obtaining the required bandwidth of each first virtual machine includes: obtaining the byte transmission and reception volume at the network card driver interface corresponding to each first virtual machine according to a preset period through a preset command; wherein the network card driver interface corresponding to each first virtual machine is an interface between a virtual network card in the first computing device and a virtual network card in each first virtual machine; and determining the required bandwidth of each first virtual machine according to the byte transmission and reception volume and the preset period at the network card driver interface corresponding to each first virtual machine.
[0010] Based on this implementation, the first computing device can automatically obtain the required bandwidth of each first virtual machine through a preset command, so that a target virtual machine can be determined among multiple first virtual machines based on the required bandwidth of each first virtual machine, and the maximum available bandwidth of the target virtual machine can be adjusted.
[0011] In another possible implementation, obtaining the required bandwidth of each first virtual machine includes: obtaining the required bandwidth of each first virtual machine determined by task information corresponding to each target task among multiple target tasks that each first virtual machine needs to perform within a preset time period; wherein the task information includes an estimated bandwidth, task execution time and task execution order corresponding to each target task; the task execution time and task execution order corresponding to each target task are used to determine the parallel execution status of each target task within the preset time period, and the estimated bandwidth and parallel execution status corresponding to each target task are used to determine the required bandwidth of each first virtual machine.
[0012] Based on this implementation, each first virtual machine can obtain the estimated bandwidth of the target task to be executed within the preset duration based on the task list, and determine the required bandwidth within the preset duration based on the estimated bandwidth of the target task, the task execution duration, and the task execution order. Each first virtual machine determines to send the determined respective required bandwidth to the first computing device, so that the first computing device can determine the target virtual machine among the multiple first virtual machines based on the required bandwidth of each first virtual machine, and adjust the maximum available bandwidth of the target virtual machine.
[0013] In one implementation, if the sum of the actual bandwidths used by the multiple first virtual machines reaches the total bandwidth, determining a target virtual machine among the multiple first virtual machines includes: determining a priority of each first virtual machine, wherein the priority indicates a priority of each first virtual machine when bandwidth is allocated; and determining, based on the priority of each first virtual machine, a first virtual machine whose priority is lower than a target priority as a target virtual machine.
[0014] Based on this implementation, by determining the priority of each first virtual machine, bandwidth is allocated according to the priority, so that the first virtual machine with a high priority can obtain the desired bandwidth, thereby making bandwidth allocation more reasonable.
[0015] In another possible implementation, based on the required bandwidth and the actually used bandwidth of each first virtual machine, determining a target virtual machine among multiple first virtual machines includes: obtaining a historically used bandwidth of each first virtual machine, and determining a priority of each first virtual machine according to the historically used bandwidth of each first virtual machine; wherein, the higher the historically used bandwidth of the first virtual machine, the higher the priority of the first virtual machine; based on the required bandwidth and the actually used bandwidth of each first virtual machine, determining a second virtual machine whose required bandwidth is greater than the actually used bandwidth among the multiple first virtual machines; and according to the priority of each first virtual machine, determining a first virtual machine whose priority is lower than that of the second virtual machine among the multiple first virtual machines as a target virtual machine.
[0016] Based on this implementation, the priority of each first virtual machine can be determined based on the historical bandwidth usage of each first virtual machine, and a target virtual machine with a lower priority than the second virtual machine (that is, a virtual machine with a required bandwidth greater than the actual bandwidth used) can be determined among multiple first virtual machines, so that the maximum available bandwidth of the target virtual machine can be adjusted subsequently to enable the second virtual machine with a higher priority to use more bandwidth resources.
[0017] In another possible implementation, a target virtual machine is determined among multiple first virtual machines based on the required bandwidth and the actually used bandwidth of each first virtual machine, including: determining the importance of the task corresponding to each first virtual machine according to at least one of the task type, task duration and user type corresponding to the task currently executed by the first virtual machine; determining the priority of each first virtual machine according to the importance of the task corresponding to each first virtual machine; wherein, the higher the importance of the task of the first virtual machine, the higher the priority of the first virtual machine; based on the required bandwidth and the actually used bandwidth of each first virtual machine, determining a second virtual machine whose required bandwidth is greater than the actually used bandwidth among the multiple first virtual machines; and according to the priority of each first virtual machine, determining a first virtual machine whose priority is lower than that of the second virtual machine among the multiple first virtual machines as the target virtual machine.
[0018] Based on this implementation method, the priority of each first virtual machine can be determined based on the importance of its task, and a target virtual machine with a lower priority than a second virtual machine (i.e., a virtual machine whose required bandwidth is greater than the actual bandwidth used) can be determined among multiple first virtual machines, so that the maximum available bandwidth of the target virtual machine can be adjusted subsequently to enable a second virtual machine with a higher priority to use more bandwidth resources.
[0019] In another possible implementation, the maximum available bandwidth of the target virtual machine is reallocated based on the total bandwidth and / or the actual bandwidth used by each first virtual machine, including: determining the first bandwidth to be adjusted of the target virtual machine according to the difference between the required bandwidth and the actual bandwidth used by the second virtual machine; and determining the maximum available bandwidth of the target virtual machine according to the difference between the actual bandwidth used by the target virtual machine and the first bandwidth to be adjusted.
[0020] Based on this implementation, when the sum of the actual bandwidth used by multiple first virtual machines is greater than the total bandwidth of the first computing device and there are no new virtual machines in the host, the target virtual machine can be determined from the multiple virtual machines based on the priority of each first virtual machine, and the maximum available bandwidth of the target virtual machine can be adjusted according to the difference between the actual bandwidth used by the target virtual machine and the first bandwidth to be adjusted, thereby ensuring that the second virtual machine can use more bandwidth resources and meet the bandwidth usage requirements of the second virtual machine, so as to achieve reasonable allocation of bandwidth resources and reduce network congestion.
[0021] In another possible implementation, if the sum of the actual bandwidth used by the multiple first virtual machines reaches the total bandwidth, a target virtual machine is determined among the multiple first virtual machines, including: if the sum of the actual bandwidth used by the multiple first virtual machines reaches the total bandwidth, each first virtual machine among the multiple first virtual machines is determined as a target virtual machine; based on the total bandwidth and / or the actual bandwidth used by each first virtual machine, the maximum available bandwidth of the target virtual machine is reallocated, including: obtaining the required bandwidth of each target virtual machine; determining a first bandwidth adjustment ratio according to a ratio of the required bandwidths of each target virtual machine; and determining the maximum available bandwidth of each target virtual machine according to the product of the total bandwidth and the first bandwidth adjustment ratio.
[0022] Based on this implementation, when the sum of the actual bandwidth used by multiple first virtual machines reaches the total bandwidth and there are no newly added virtual machines in the first computing device, the first bandwidth adjustment ratio can be determined based on the bandwidth requirements of each first virtual machine, and the total bandwidth can be allocated to each first virtual machine according to the first bandwidth adjustment ratio. In this way, the total bandwidth can be allocated according to the bandwidth requirements of the first virtual machines, so that the first virtual machines with higher bandwidth requirements can be allocated more bandwidth resources, so as to achieve reasonable allocation of bandwidth resources and reduce network congestion.
[0023] In another possible implementation, if the sum of the actual bandwidth used by multiple first virtual machines reaches the total bandwidth, a target virtual machine is determined among the multiple first virtual machines, including: when the sum of the actual bandwidth used by the multiple first virtual machines reaches the total bandwidth, if a third virtual machine is added to the first computing device, each of the first virtual machines and the third virtual machine is determined as the target virtual machine.
[0024] Based on this implementation, when the sum of the actual bandwidth used by multiple first virtual machines reaches the total bandwidth, if a third virtual machine is added to the first computing device, all the first virtual machines and the third virtual machines can be determined as target virtual machines to adjust the maximum available bandwidth of all virtual machines in the first computer.
[0025] In another possible implementation, based on the total bandwidth and / or the actual bandwidth used by each first virtual machine, the maximum available bandwidth of the target virtual machine is reallocated, including: determining the total number of virtual machines of the target virtual machine, and determining the average bandwidth according to the total bandwidth and the total number of virtual machines; and determining the average bandwidth as the maximum available bandwidth of each target virtual machine.
[0026] Based on this implementation, the total bandwidth can be evenly distributed to each first virtual machine and each third virtual machine, so that the newly added third virtual machine can be allocated bandwidth to perform tasks normally.
[0027] In another possible implementation, the maximum available bandwidth of the target virtual machine is reallocated based on the total bandwidth and / or the actually used bandwidth of each first virtual machine, including: determining the second bandwidth adjustment ratio according to the ratio of the actually used bandwidths of each first virtual machine; determining the second bandwidth to be adjusted of each target virtual machine according to the product of the preset bandwidth adjustment total amount and the second bandwidth adjustment ratio; and determining the maximum available bandwidth of each target virtual machine according to the difference between the actually used bandwidth of each target virtual machine and the second bandwidth to be adjusted.
[0028] Based on this implementation, the second bandwidth adjustment ratio can be determined based on the actual bandwidth used by each first virtual machine, and the maximum available bandwidth of each first virtual machine and the third virtual machine can be determined based on the second bandwidth adjustment ratio, so that the newly added third virtual machine can be allocated bandwidth to perform tasks normally.
[0029] In another possible implementation, the total bandwidth configured for the first computing device is obtained, and the actual bandwidth used by each first virtual machine is periodically obtained, including: in response to the bandwidth adjustment mode of the first computing device being an adaptive bandwidth adjustment mode, the total bandwidth configured for the first computing device is obtained, and the actual bandwidth used by each first virtual machine is periodically obtained.
[0030] Based on this implementation, the bandwidth adjustment mode can be set to an adaptive adjustment mode; in the adaptive adjustment mode, the first computing device can adaptively adjust the bandwidth of the virtual machine, thereby improving the bandwidth adjustment efficiency.
[0031] In a second aspect, an embodiment of the present application provides a bandwidth adjustment method for a second computing device, the second computing device establishes a communication connection with multiple first computing devices and a network device, each of the multiple first computing devices includes multiple first virtual machines, the method comprising: obtaining the maximum supplied bandwidth provided by the network device for the multiple first computing devices, and obtaining the total actually used bandwidth of each first computing device; wherein the total actually used bandwidth of the first computing device is determined based on the sum of the actually used bandwidths of the multiple first virtual machines in the first computing device; if the sum of the total actually used bandwidths of the multiple first computing devices reaches the maximum supplied bandwidth, determining a target computing device among the multiple first computing devices; and reallocating the total bandwidth of the target computing device based on the total actually used bandwidth of each first computing device.
[0032] Based on this implementation, in the adaptive bandwidth adjustment mode, if the sum of the total actual used bandwidth of multiple first computing devices reaches the maximum supplied bandwidth, the second computing device can dynamically adjust the total bandwidth of the target computing device among the multiple first computing devices, thereby further optimizing the network performance and improving the bandwidth utilization.
[0033] In another possible implementation, if the total actual bandwidth used by multiple first computing devices reaches the maximum supplied bandwidth, a target computing device is determined among the multiple first computing devices, including: if the total actual bandwidth used by multiple first computing devices reaches the maximum supplied bandwidth, each first computing device is determined as a target computing device; based on the total actual bandwidth used by each first computing device, the total bandwidth of the target computing device is reallocated, including: obtaining the total required bandwidth of each first computing device; wherein the total required bandwidth of the first computing device is determined according to the sum of the required bandwidths of multiple first virtual machines in the first computing device; determining a third bandwidth adjustment ratio according to the ratio of the total required bandwidths of each target computing device; and determining the total bandwidth of each computing device according to the product of the maximum supplied bandwidth and the third bandwidth adjustment ratio.
[0034] Based on this implementation, the second computing device can adjust the total bandwidth of multiple first computing devices based on the total required bandwidth of each first computing device through the virtual machine management platform, thereby further reducing the network delay or packet loss rate of the first computing device to optimize network performance.
[0035] In a third aspect, an embodiment of the present application further provides a bandwidth adjustment device, which is configured on a first computing device, wherein the first computing device includes a plurality of first virtual machines, and the device includes: a first acquisition module, configured to obtain the total bandwidth configured for the first computing device, and periodically obtain the actual bandwidth used by each first virtual machine; a first determination module, configured to determine a target virtual machine among the plurality of first virtual machines if the sum of the actual bandwidth used by the plurality of first virtual machines reaches the total bandwidth; and a first bandwidth allocation module, configured to reallocate the maximum available bandwidth of the target virtual machine based on the total bandwidth and / or the actual bandwidth used by each first virtual machine.
[0036] In a possible implementation, the first determination module is specifically configured to: if the sum of the actual bandwidth used by multiple first virtual machines reaches the total bandwidth, obtain the required bandwidth of each first virtual machine; and determine the target virtual machine among the multiple first virtual machines based on the required bandwidth and the actual bandwidth used by each first virtual machine.
[0037] In another possible implementation, the first acquisition module is specifically configured to: obtain the byte transmission and reception volume at the network card driver interface corresponding to each first virtual machine according to a preset command and a preset period; wherein the network card driver interface corresponding to each first virtual machine is an interface between the virtual network card in the first computing device and the virtual network card in each first virtual machine; determine the required bandwidth of each first virtual machine based on the byte transmission and reception volume and the preset period at the network card driver interface corresponding to each first virtual machine.
[0038] In another possible implementation, the first acquisition module is specifically configured to: obtain the required bandwidth of each first virtual machine determined by task information corresponding to each target task among multiple target tasks that each first virtual machine needs to perform within a preset time period; wherein the task information includes an estimated bandwidth, task execution duration and task execution order corresponding to each target task; the task execution duration and task execution order corresponding to each target task are used to determine the parallel execution status of each target task within the preset time period, and the estimated bandwidth and parallel execution status corresponding to each target task are used to determine the required bandwidth of each first virtual machine.
[0039] In another possible implementation, the first determination module is specifically configured to: obtain the historical bandwidth usage of each first virtual machine, and determine the priority of each first virtual machine based on the historical bandwidth usage of each first virtual machine; wherein, the higher the historical bandwidth usage of the first virtual machine, the higher the priority of the first virtual machine; based on the required bandwidth and the actual bandwidth usage of each first virtual machine, determine a second virtual machine whose required bandwidth is greater than the actual bandwidth usage among multiple first virtual machines; and according to the priority of each first virtual machine, determine a first virtual machine whose priority is lower than that of the second virtual machine among the multiple first virtual machines as a target virtual machine.
[0040] In another possible implementation, the first determination module is specifically configured to: determine the importance of the task corresponding to each first virtual machine based on at least one of the task type, task duration and user type corresponding to the task currently executed by the first virtual machine; determine the priority of each first virtual machine based on the importance of the task corresponding to each first virtual machine; wherein, the higher the importance of the task of the first virtual machine, the higher the priority of the first virtual machine; based on the required bandwidth and the actual used bandwidth of each first virtual machine, determine a second virtual machine whose required bandwidth is greater than the actual used bandwidth among multiple first virtual machines; and according to the priority of each first virtual machine, determine a first virtual machine whose priority is lower than that of the second virtual machine among the multiple first virtual machines as a target virtual machine.
[0041] In another possible implementation, the first bandwidth allocation module is specifically configured to: determine the first bandwidth to be adjusted of the target virtual machine according to the difference between the required bandwidth of the second virtual machine and the actual bandwidth used; determine the maximum available bandwidth of the target virtual machine according to the difference between the actual bandwidth used by the target virtual machine and the first bandwidth to be adjusted.
[0042] In another possible implementation, the first determination module is specifically configured as follows: if the sum of the actual bandwidth used by multiple first virtual machines reaches the total bandwidth, each of the multiple first virtual machines is determined as a target virtual machine; the first bandwidth allocation module is specifically configured as follows: obtaining the required bandwidth of each target virtual machine; determining the first bandwidth adjustment ratio based on the ratio of the required bandwidth of each target virtual machine; and determining the maximum available bandwidth of each target virtual machine based on the product of the total bandwidth and the first bandwidth adjustment ratio.
[0043] In another possible implementation, the first determination module is specifically configured to: when the sum of the actual used bandwidths of multiple first virtual machines reaches the total bandwidth, if a third virtual machine is newly added to the first computing device, each of the first virtual machines and the third virtual machine is determined as a target virtual machine.
[0044] In another possible implementation, the first bandwidth allocation module is specifically configured to: determine the total number of target virtual machines, and determine the average bandwidth according to the total bandwidth and the total number of virtual machines; and determine the average bandwidth as the maximum available bandwidth of each target virtual machine.
[0045] In another possible implementation, the first bandwidth allocation module is specifically configured to: determine the second bandwidth adjustment ratio according to the ratio of the actual bandwidth used by each first virtual machine; determine the second bandwidth to be adjusted for each target virtual machine according to the product of the preset bandwidth adjustment total amount and the second bandwidth adjustment ratio; determine the maximum available bandwidth for each target virtual machine according to the difference between the actual bandwidth used by each target virtual machine and the second bandwidth to be adjusted.
[0046] In another possible implementation, the first acquisition module is specifically configured to: in response to the bandwidth adjustment mode of the first computing device being the adaptive bandwidth adjustment mode, obtain the total bandwidth configured for the first computing device, and periodically obtain the actual used bandwidth of each first virtual machine.
[0047] In a fourth aspect, an embodiment of the present application further provides a bandwidth adjustment device, which is configured on a second computing device, and the second computing device establishes a communication connection with multiple first computing devices and a network device, and each of the multiple first computing devices includes multiple first virtual machines. The device includes: a second acquisition module, configured to obtain the maximum supplied bandwidth provided by the network device for the multiple first computing devices, and obtain the total actual used bandwidth of each first computing device; wherein the total actual used bandwidth of the first computing device is determined based on the sum of the actual used bandwidths of the multiple first virtual machines in the first computing device; a second determination module, configured to determine a target computing device among the multiple first computing devices if the sum of the total actual used bandwidths of the multiple first computing devices reaches the maximum supplied bandwidth; a second bandwidth allocation module, configured to reallocate the total bandwidth of the target computing device based on the total actual used bandwidth of each first computing device.
[0048] In one possible implementation, the second determination module is specifically configured as follows: if the sum of the total actually used bandwidth of multiple first computing devices reaches the maximum supplied bandwidth, each first computing device is determined as a target computing device; the second bandwidth allocation module is specifically configured as follows: obtaining the total required bandwidth of each first computing device; wherein the total required bandwidth of the first computing device is determined based on the sum of the required bandwidths of multiple first virtual machines in the first computing device; determining the third bandwidth adjustment ratio based on the ratio of the total required bandwidths of each target computing device; and determining the total bandwidth of each computing device based on the product of the maximum supplied bandwidth and the third bandwidth adjustment ratio.
[0049] In the fifth aspect, an embodiment of the present application also provides a computing device, comprising: a processor and a memory; the processor and the memory are coupled; the memory is used to store program instructions; the processor is used to execute program instructions to execute a method such as any one of the above-mentioned first aspect, or a method such as any one of the above-mentioned second aspect.
[0050] In a sixth aspect, an embodiment of the present application provides a chip, which is used to execute any method in the first aspect above.
[0051] In the seventh aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When the computer execution instructions are executed by a computer, the method as described in any one of the first aspect or the method as described in any one of the second aspect is implemented.
[0052] In an eighth aspect, an embodiment of the present application provides a program product, including a computer program, which, when executed by a processor, implements a method as described in any one of the first aspects, or a method as described in any one of the second aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 A scene diagram of a bandwidth adjustment method provided in an embodiment of the present application;
[0054] Figure 2 A flow chart of a bandwidth adjustment method provided in an embodiment of the present application;
[0055] Figure 3 A flowchart for determining a target virtual machine provided in an embodiment of the present application;
[0056] Figure 4 A flowchart for determining the required bandwidth of each first virtual machine provided in an embodiment of the present application;
[0057] Figure 5 Another flowchart for determining a target virtual machine provided in an embodiment of the present application;
[0058] Figure 6 A flowchart of another method for determining a target virtual machine provided in an embodiment of the present application;
[0059] Figure 7 A flowchart for determining the maximum available bandwidth of each target virtual machine provided in an embodiment of the present application;
[0060] Figure 8 Another flow chart for determining the maximum available bandwidth of each target virtual machine provided in an embodiment of the present application;
[0061] Fig. 9 A flowchart of another method for determining the maximum available bandwidth of each target virtual machine provided in an embodiment of the present application;
[0062] Fig.10 A flowchart of another bandwidth adjustment method provided in an embodiment of the present application;
[0063] Fig.11 A flowchart of another bandwidth adjustment method provided in an embodiment of the present application;
[0064] Fig.12 A schematic diagram of a bandwidth adjustment device provided in an embodiment of the present application;
[0065] Fig.13 A schematic diagram of another bandwidth adjustment device provided in an embodiment of the present application;
[0066] Fig.14 A schematic diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0067] The technical solution in the embodiment of the present application will be described below in conjunction with the drawings in the embodiment of the present application. In order to facilitate the clear description of the technical solution in the embodiment of the present application, the first, second, etc. descriptions appearing in the embodiment of the present application are only used for illustration and distinction of the description objects, and there is no order, nor does it represent a special limitation on the number of devices in the embodiment of the present application, and cannot constitute any limitation on the embodiment of the present application.
[0068] The bandwidth adjustment method provided in the embodiment of the present application can be applied to a computing device (including a first computing device and a second computing device), and the computing device can be a server or a terminal device. In practical applications, a user can dynamically adjust the bandwidth of multiple first computing devices communicating with the second computing device and the bandwidth of multiple virtual machines in each of the multiple first computing devices through a virtual machine management platform configured in the second computing device, thereby optimizing network performance and improving the efficiency of bandwidth adjustment.
[0069] Figure 1 A scene diagram of a bandwidth adjustment method provided in an embodiment of the present application. Figure 1 As shown, the first computing device 110 may be referred to as a host. One or more virtual machines may run on the first computing device 110, such as virtual machine V1, virtual machine V2, ... virtual machine V n Multiple virtual machines running on the first computing device 110 can share the physical resources of the first computing device 110, such as CPU, memory, storage space, network bandwidth and other resources; that is, the physical resources of the first computing device 110 can be allocated to each virtual machine running on it. The first computing device 110 includes a traffic control module 11 (Traffic Control, TC), and the first computing device 110 can manage the bandwidth of the virtual machine through the traffic control module 11.
[0070] The first computing device 110 is provided with a physical network card and a virtual network card, and each virtual machine in the first computing device 110 is provided with a virtual network card. The first computing device 110 can send traffic data packets to the virtual network card therein through the physical network card therein, and send these traffic data packets to the virtual network card in each virtual machine through the virtual network card therein; each virtual machine can also send traffic data packets to the virtual network card in the first computing device 110 through the virtual network card therein, thereby realizing network communication between each virtual machine and the first computing device 110.
[0071] The second computing device 120 is deployed with a virtual machine management platform 12. The second computing device 120 can communicate with multiple first computing devices 110, and manage bandwidth resources of each first computing device 110 and multiple virtual machines in each first computing device 110 through the virtual machine management platform 12.
[0072] The second computing device 120 can communicate with the network device (such as a switch) deployed by the network operator, and obtain the maximum supply bandwidth provided by the network device for the multiple first computing devices 110. The user can set the bandwidth information of each first computing device 110 in the virtual machine management platform 12. The bandwidth information of the first computing device 110 may include the bandwidth adjustment mode of the first computing device 110, the maximum bandwidth of the first computing device 110 (hereinafter referred to as the total bandwidth, including the total upstream bandwidth and the total downstream bandwidth), the maximum available bandwidth of each virtual machine in the multiple virtual machines (including the maximum available upstream bandwidth and the maximum available downstream bandwidth), and other information.
[0073] For example, the user can set the total bandwidth of each first computing device 110 based on the maximum supplied bandwidth, that is, set the total bandwidth that can be provided by the physical network card in the first computing device 110; and the initial maximum available bandwidth of multiple virtual machines in each first computing device 110, that is, set the initial maximum available bandwidth that can be provided by the virtual machine network card in each virtual machine. For example, the initial maximum available bandwidth corresponding to each virtual machine can be set to a bandwidth value greater than or equal to the above-mentioned total bandwidth. Among them, the total bandwidth of the first computing device 110 is the maximum bandwidth that the first computing device 110 can allocate to all virtual machines, and the initial maximum available bandwidth of each virtual machine is the initial maximum bandwidth that can be used by each virtual machine. Exemplarily, the initial maximum available bandwidth of each virtual machine may also not be limited.
[0074] The user can also set the bandwidth adjustment mode of each first computing device 110 in the virtual machine management platform 12. The bandwidth adjustment mode includes an adaptive bandwidth adjustment mode. When the bandwidth adjustment mode corresponding to the first computing device 110 is the adaptive bandwidth adjustment mode, the first computing device 110 can autonomously adjust the maximum available bandwidth of multiple virtual machines.
[0075] After the user has set the bandwidth information of each first computing device 110, the virtual machine management platform 12 can send the bandwidth information of each first computing device 110 to the corresponding first computing device 110. After receiving the corresponding bandwidth information, each first computing device 110 can determine the bandwidth adjustment mode, the total bandwidth configured for the first computing device 110, and the initial maximum available bandwidth configured for each virtual machine (hereinafter referred to as the first virtual machine) based on the bandwidth information. Exemplarily, when the bandwidth adjustment mode of the first computing device 110 is the adaptive bandwidth adjustment mode, the first computing device 110 can set the total bandwidth of the first computing device 110 through a traffic control command (hereinafter referred to as a TC command), and set the initial maximum available bandwidth of each first virtual machine through the TC command.
[0076] After completing the bandwidth setting, the first computing device 110 can obtain the actual bandwidth used and the required bandwidth of each first virtual machine during the execution of tasks by each first virtual machine, and adjust the maximum available bandwidth of each first virtual machine based on the total bandwidth of the first computing device 110, the actual bandwidth used and the required bandwidth of each first virtual machine, etc. The actual bandwidth used by the first virtual machine is the amount of bytes actually sent and received by the first virtual machine, and the required bandwidth of the first virtual machine is the amount of bytes that the first virtual machine needs to send and receive.
[0077] Exemplarily, the traffic control module 11 can obtain the traffic data packets in the network protocol stack of the first computing device 110 to determine the byte transmission and reception volume, and determine the actual bandwidth used by each first virtual machine based on the byte transmission and reception volume in the network protocol stack. In addition, the traffic data packets at the network card driver interface can be obtained through a preset command to determine the byte transmission and reception volume, and determine the required bandwidth of each first virtual machine based on the byte transmission and reception volume at the network card driver interface. Among them, the network card driver interface is the interface between the virtual network card in the first computing device 110 and the virtual network card in each virtual machine. The traffic data packets at the network card driver interface have not been processed by the network protocol stack, and therefore are not the traffic data packets actually processed by the virtual machine.
[0078] The first computing device 110 may determine the sum of the actual bandwidths used by the plurality of first virtual machines (i.e., the total actual bandwidth used) according to the actual bandwidths used by the first virtual machines, and determine whether the sum of the actual bandwidths used by the plurality of first virtual machines reaches the total bandwidth of the first computing device 110. It should be noted that the total actual bandwidths used by the plurality of first virtual machines will not exceed the total bandwidth of the first computing device 110.
[0079] If the sum of the actual bandwidth used by the multiple first virtual machines reaches the total bandwidth of the first computing device 110, the bandwidth required by one or more first virtual machines may exceed the actual bandwidth used, that is, the total bandwidth of the first computing device 110 may not be able to meet the bandwidth usage requirements of all virtual machines. In the case where the bandwidth required by one or more first virtual machines exceeds the actual bandwidth used, some data packets that cannot be processed by the first computing device 110 or the first virtual machine in time will be delayed or discarded, that is, network delay or packet loss will occur.
[0080] Therefore, when the sum of the actual bandwidth used by multiple first virtual machines reaches the total bandwidth of the first computing device 110, the first computing device 110 can determine a target virtual machine among the multiple first virtual machines, where the target virtual machine is the virtual machine whose bandwidth is to be adjusted; wherein the target virtual machine may be one or more virtual machines; and based on the total bandwidth of the first computing device 110 and / or the actual bandwidth used by each first virtual machine, redetermine the maximum available bandwidth of the target virtual machine, and adjust the maximum available bandwidth of the target virtual machine through the traffic control module 110 to reduce network delay or packet loss rate, thereby optimizing network performance.
[0081] The second computing device 120 can dynamically adjust the total bandwidth of the multiple first computing devices 110 through the virtual machine management platform 12. Exemplarily, the second computing device 120 can obtain the total actual bandwidth used by each first computing device 110 through the virtual machine management platform 12; wherein the total actual bandwidth used by the first computing device 110 can be determined according to the sum of the actual bandwidth used by the multiple first virtual machines in the first computing device 110. If the total actual bandwidth used by the multiple first computing devices 110 reaches the maximum bandwidth provided by the network operator, the virtual machine management platform 12 can determine the target computing device among the multiple first computing devices 110, and reallocate the total bandwidth of the target computing device based on the total actual bandwidth used by each first computing device 110. Therefore, the total bandwidth of each first computing device 110 can be coordinated based on the bandwidth usage of the virtual machines in each first computing device 110 and the maximum bandwidth provided, so as to further reduce network delay or packet loss rate and optimize network performance.
[0082] Through the above scheme, the user can set the bandwidth adjustment mode of the first computing device to the adaptive bandwidth adjustment mode through the virtual machine management platform in the second computing device. In the adaptive bandwidth adjustment mode, the first computing device can dynamically adjust the maximum available bandwidth of the target virtual machine among multiple first virtual machines based on the total bandwidth and / or the actual bandwidth used by each first virtual machine, so as to optimize network performance and improve bandwidth utilization. In addition, the first computing device can autonomously adjust the maximum available bandwidth of the target virtual machine without reporting the actual bandwidth used by each first virtual machine to the virtual machine management platform in real time and then the virtual machine management platform determines how to adjust the bandwidth of the target virtual machine, thereby improving the efficiency of bandwidth adjustment for the virtual machine. In addition, the second computing device can adjust the total bandwidth of multiple first computing devices through the virtual machine management platform, so as to further reduce network delay or packet loss rate to optimize network performance.
[0083] Figure 2 A flow chart of a bandwidth adjustment method provided in an embodiment of the present application, which can be applied to Figure 1 The first computing device shown in the figure has multiple first virtual machines running in it. Figure 2 As shown, the method includes steps 210 to 230.
[0084] Step 210: Obtain the total bandwidth configured for the first computing device, and periodically obtain the actual bandwidth used by each first virtual machine.
[0085] In some embodiments, the first computing device can receive bandwidth information sent by the virtual machine management platform to the first computing device, and determine information such as the bandwidth adjustment mode configured for the first computing device, the total bandwidth configured for the first computing device, and the initial maximum available bandwidth configured for multiple virtual machines in the first computing device based on the bandwidth information.
[0086] Exemplarily, in response to the bandwidth adjustment mode in the bandwidth information being an adaptive bandwidth adjustment mode, the first computing device may set the total bandwidth of the first computing device through a TC command, and set the maximum available bandwidth of each first virtual machine in the first computing device, such as setting the initial maximum available bandwidth of each first virtual machine to a bandwidth value greater than or equal to the total bandwidth.
[0087] For example, if the first virtual machine V1, the first virtual machine V2 and the first virtual machine V3 are running on the first computing device, and the total bandwidth corresponding to the first computing device is 100Mbps, the initial maximum available bandwidth corresponding to the first virtual machine V1, the first virtual machine V2 and the first virtual machine V3 can be set to 100Mbps.
[0088] In some embodiments, after completing the initial bandwidth setting, the first computing device can obtain the total first byte received and sent of each first virtual machine in the network protocol stack within a preset period (i.e., the sum of the total number of received bytes RX_bytes and the total number of sent bytes TX_bytes) through the traffic control module 11, and determine the difference between the total first byte received and sent obtained in the current preset period and the total first byte received and sent obtained in the previous preset period, and the difference is the first byte change of each first virtual machine in the current preset period.
[0089] After determining the first byte change of each first virtual machine within the preset period, the actual bandwidth used by each first virtual machine within the preset period can be determined based on the first byte change corresponding to each first virtual machine and the preset period. The actual bandwidth used by each first virtual machine within the preset period = the first byte change corresponding to each first virtual machine × 8 / preset period.
[0090] Step 220: If the sum of the actual bandwidths used by the multiple first virtual machines reaches the total bandwidth, a target virtual machine is determined from the multiple first virtual machines.
[0091] In some embodiments, after the first computing device determines the actual bandwidth used by each first virtual machine in the current preset period, it can determine the sum of the actual bandwidth used by multiple first virtual machines in the preset period, and determine whether the sum of the actual bandwidth used by the multiple first virtual machines reaches the total bandwidth of the first computing device.
[0092] If the sum of the actual bandwidths used by the multiple first virtual machines does not reach the total bandwidth of the first computing device, the first computing device may not adjust the maximum available bandwidth of each first virtual machine. If the sum of the actual bandwidths used by the multiple first virtual machines reaches the total bandwidth of the first computing device, the first computing device may determine at least one target virtual machine whose bandwidth is to be adjusted among the multiple first virtual machines to adjust the maximum available bandwidth of each target virtual machine.
[0093] Step 230: reallocate the maximum available bandwidth of the target virtual machine based on the total bandwidth and / or the actual bandwidth used by each first virtual machine.
[0094] In some embodiments, the first computing device can reallocate the maximum available bandwidth of the target virtual machine based on the total bandwidth and / or the actual bandwidth used by each first virtual machine, and send the reallocated maximum available bandwidth of the target virtual machine to the traffic control module so that the maximum available bandwidth of the target virtual machine can be set through the traffic control module.
[0095] In some embodiments, after the first computing device reallocates the maximum available bandwidth of the target virtual machine, if after a period of time the total required bandwidth of all virtual machines on the first computing device is less than the total bandwidth, or a virtual machine with a required bandwidth greater than the actual used bandwidth completes the task being executed, etc., then the first computing device may readjust the maximum bandwidth corresponding to the target virtual machine to the initial maximum bandwidth (e.g., a bandwidth value greater than or equal to the total bandwidth), i.e., cancel the bandwidth limit on the target virtual machine, thereby enabling further adaptive adjustment of bandwidth based on changes in network demand.
[0096] Through the above scheme, in the adaptive bandwidth adjustment mode, if the sum of the actual bandwidth used by multiple first virtual machines in the first computing device reaches the total bandwidth of the first computing device, the first computing device can determine the target virtual machine whose bandwidth is to be adjusted, and dynamically adjust the maximum available bandwidth of the target virtual machine based on the total bandwidth and / or the actual bandwidth used by each first virtual machine, thereby optimizing network performance and improving bandwidth utilization. In addition, the first computing device can autonomously adjust the maximum available bandwidth of the target virtual machine without having to report the actual bandwidth used by each first virtual machine to the virtual machine management platform in real time and then let the virtual machine management platform determine how to adjust the bandwidth of the target virtual machine, thereby improving the efficiency of bandwidth adjustment for the virtual machine.
[0097] Figure 3 A flowchart for determining a target virtual machine is provided in an embodiment of the present application. Figure 3 As shown, in the case where there is no newly added virtual machine in the first computing device, the above step 220 includes steps 310 to 320.
[0098] Step 310: If the sum of the actual bandwidths used by the multiple first virtual machines reaches the total bandwidth, the required bandwidth of each first virtual machine is obtained.
[0099] In some embodiments, when the sum of the actual used bandwidths of the multiple first virtual machines in the first computing device reaches the total bandwidth, the first computing device may obtain the required bandwidth of each of the multiple first virtual machines.
[0100] Exemplarily, the bandwidth requirements of each first virtual machine may be directly obtained by the first computing device, or each first virtual machine may obtain its own bandwidth requirements and report them to the first computing device. In this embodiment, the specific method of obtaining the bandwidth requirements of the first virtual machine is not limited.
[0101] Step 320: determining a target virtual machine from among the plurality of first virtual machines based on the required bandwidth and the actually used bandwidth of each first virtual machine.
[0102] In some embodiments, after determining the required bandwidth of each first virtual machine, the first computing device may determine a target virtual machine whose bandwidth is to be adjusted among the multiple first virtual machines based on the required bandwidth and the actually used bandwidth of each first virtual machine.
[0103] Exemplarily, the first computing device may determine, based on the required bandwidth and the actually used bandwidth of each first virtual machine, a second virtual machine whose required bandwidth is greater than the actually used bandwidth among multiple first virtual machines, and determine a first virtual machine whose priority is lower than the second virtual machine among the multiple first virtual machines as a target virtual machine.
[0104] Through the above scheme, when the sum of the actual bandwidth used by multiple first virtual machines reaches the total bandwidth, the first computing device can further obtain the required bandwidth of each first virtual machine, so that the target virtual machine can be determined among the multiple first virtual machines based on the required bandwidth and the actual bandwidth used by each first virtual machine, and the maximum available bandwidth of the target virtual machine can be allocated.
[0105] Figure 4 A flow chart for determining the required bandwidth of each first virtual machine provided in an embodiment of the present application. Figure 4 As shown, the above step 310 includes steps 410 to 420.
[0106] Step 410: Obtain the byte transmission and reception volume at the network card driver interface corresponding to each first virtual machine according to a preset period through a preset command.
[0107] In some embodiments, the first computing device can obtain the total amount of second bytes sent and received by each first virtual machine at the network card driver interface within a preset period through a preset command (such as an ifconfig command, an ip command, etc.). The network card driver interface corresponding to each first virtual machine is an interface between the virtual network card in the first computing device and the virtual network card in each first virtual machine; the size of the preset period for obtaining the total amount of second bytes sent and received can be the same as the size of the preset period for obtaining the total amount of first bytes sent and received. Then, the first computing device can determine the difference between the total amount of second bytes sent and received obtained in the current preset period and the total amount of second bytes sent and received obtained in the previous preset period, and the difference is the amount of bytes sent and received by each first virtual machine in the current preset period (i.e., the second byte change).
[0108] Step 420: Determine the required bandwidth of each first virtual machine according to the byte transmission and reception volume at the network card driver interface corresponding to each first virtual machine and a preset period.
[0109] In some embodiments, after determining the second byte change of each first virtual machine within the current preset period, the required bandwidth of each first virtual machine may be determined based on the second byte change corresponding to each first virtual machine and the preset period.
[0110] The required bandwidth of each first virtual machine=the second byte change corresponding to each first virtual machine×8 / preset period.
[0111] Through the above scheme, the first computing device can automatically obtain the required bandwidth of each first virtual machine through a preset command, so as to determine the target virtual machine among multiple first virtual machines based on the required bandwidth of each first virtual machine and adjust the maximum available bandwidth of the target virtual machine.
[0112] In some embodiments, step 310 includes: obtaining the required bandwidth of each first virtual machine determined by task information corresponding to each target task among multiple target tasks that each first virtual machine needs to perform within a preset time period.
[0113] Exemplarily, in addition to directly obtaining the required bandwidth of each first virtual machine using a preset command through the first computing device, each first virtual machine can also determine its own required bandwidth and send the determined required bandwidth to the first computing device.
[0114] In some examples, each first virtual machine can obtain a corresponding task list, which includes one or more tasks that the first virtual machine needs to perform, and task information corresponding to each task. The task information may include information such as the estimated bandwidth corresponding to each task, the task execution duration, the task start time, and the task end time. The task start time corresponding to each task represents the task execution order of each task.
[0115] Exemplarily, the task list corresponding to the first virtual machine may refer to that shown in Table 1.
[0116] Table 1
[0117]
[0118] As shown in Table 1, the task list of the first virtual machine includes four tasks, namely, Task A, Task B, Task C and Task D, and the estimated bandwidths corresponding to the tasks are 30Mbps, 50Mbps, 40Mbps and 20Mbps respectively. The task execution time of Task A is 10s, the task start time is the 0th second, and the task end time is the 10th second; the task execution time of Task B is 50s, the task start time is the 5th second, and the task end time is the 55th second; the task execution time of Task C is 20s, the task start time is the 30th second, and the task end time is the 50th second; the task execution time of Task D is 30s, the task start time is the 60th second, and the task end time is the 90th second. Moreover, according to the task start time of each task, it can be known that the task execution order of each task is: Task A, Task B, Task C, Task D.
[0119] In some examples, each first virtual machine may determine one or more target tasks that need to be executed within a preset duration in a corresponding task list, and determine task information corresponding to each target task. The size of the preset duration may be the same as the size of the preset period used for obtaining the actual bandwidth used. The one or more target tasks that each first virtual machine needs to execute within the preset duration may include tasks that each first virtual machine is currently executing, and / or pending tasks that each first virtual machine has not yet executed.
[0120] For example, referring to Table 1, if the preset duration is 60s, and the first virtual machine starts to obtain the required bandwidth from the 0th second, then the target tasks that the first virtual machine needs to execute within the preset duration include the pending tasks A, B, and C that have not been executed. If the preset duration is 20s, and the first virtual machine starts to obtain the required bandwidth from the 10th second, then the target task that the first virtual machine needs to execute within the preset duration is the currently executed task B. If the preset duration is 50s, and the first virtual machine starts to obtain the required bandwidth from the 5th second, then the target tasks that the first virtual machine needs to execute within the preset duration include the currently executed task A and the pending tasks B and C that have not been executed.
[0121] In some examples, after each first virtual machine determines one or more target tasks that need to be executed within a preset time period and the task information corresponding to each target task, it can determine the parallel execution status of each target task within the preset time period based on the task execution time and task execution order corresponding to each target task, and determine the required bandwidth of each first virtual machine based on the estimated bandwidth corresponding to each target task and the parallel execution status.
[0122] For example, taking the preset duration as 60s, and the target tasks to be executed by the first virtual machine within the preset duration as target task A, target task B and target task C, the parallel execution status of each target task determined by the first virtual machine based on the task execution duration corresponding to the above target tasks and the task execution order can be referred to as shown in Table 2.
[0123] Table 2
[0124]
[0125] Exemplarily, as shown in Table 2, according to the task execution duration and task execution order corresponding to target task A, target task B and target task C in Table 1, the parallel execution of each target task can be determined as follows: from 0 seconds to 5 seconds, only target task A needs to be executed, from 5 seconds to 10 seconds, target task A and target task B need to be executed at the same time, from 10 seconds to 30 seconds, only target task B needs to be executed, from 30 seconds to 50 seconds, target task B and target task C need to be executed at the same time, and from 50 seconds to 55 seconds and from 55 seconds to 60 seconds, only target task B needs to be executed.
[0126] Furthermore, according to the estimated bandwidth corresponding to the above-mentioned target tasks and the parallel execution status, the total estimated bandwidth required for each time period within the preset duration can be determined. It is understandable that when multiple target tasks need to be executed in parallel, the required bandwidth is the sum of the estimated bandwidths of the multiple target tasks (i.e., the total estimated bandwidth). For example, when target tasks A and B need to be executed in parallel from the 5th second to the 10th second, the total estimated bandwidth is the sum of the estimated bandwidth for executing target task A and the estimated bandwidth for executing target task B, i.e., the total estimated bandwidth = 30Mbps + 50Mbps = 80Mbps.
[0127] Exemplarily, the first virtual machine may determine the required bandwidth of the first virtual machine within the preset duration according to the total estimated bandwidth required for each of the above time periods. In some examples, the first virtual machine may determine the maximum total estimated bandwidth among the total estimated bandwidths corresponding to multiple time periods as the required bandwidth of the first virtual machine; or the first virtual machine may also determine the average estimated bandwidth according to the total estimated bandwidth corresponding to each time period, and determine the average estimated bandwidth as the required bandwidth of the first virtual machine.
[0128] For example, as shown in Table 2, the first virtual machine may determine the maximum total estimated bandwidth, i.e., 90 Mbps, as the required bandwidth of the first virtual machine. Alternatively, the first virtual machine may determine the average estimated bandwidth according to the sum of the total estimated bandwidths corresponding to the multiple time periods and the number of the multiple time periods, i.e., average estimated bandwidth = sum of total estimated bandwidth / number of time periods = (30 Mbps + 80 Mbps + 50 Mbps + 90 Mbps + 50 Mbps + 50 Mbps) / 6 = 58 Mbps.
[0129] Through the above scheme, each first virtual machine can obtain the estimated bandwidth of the target task to be executed within the preset time based on the task list, and determine the required bandwidth within the preset time based on the estimated bandwidth of the target task, the task execution time and the task execution order. Each first virtual machine determines to send the determined required bandwidth to the first computing device, so that the first computing device can determine the target virtual machine among the multiple first virtual machines based on the required bandwidth of each first virtual machine, and adjust the maximum available bandwidth of the target virtual machine.
[0130] In the embodiment of the present application, the target virtual machine can also be determined by setting a priority. Specifically, in one implementation, step 220: if the sum of the actual bandwidth used by the multiple first virtual machines reaches the total bandwidth, then determining the target virtual machine from the multiple first virtual machines includes:
[0131] Determining a priority of each first virtual machine, wherein the priority indicates a priority of each first virtual machine when bandwidth is allocated;
[0132] According to the priorities of the first virtual machines, a first virtual machine whose priority is lower than the target priority is determined as a target virtual machine.
[0133] Here, for two first virtual machines with different priorities, the first virtual machine with a higher priority has a higher priority than the first virtual machine with a lower priority to obtain the desired bandwidth. In this embodiment, there are multiple ways to determine the priority of the first virtual machine. The staff can configure the priority for each first virtual machine, or the priority of the first virtual machine can be determined based on the historical bandwidth used by each first virtual machine, the task type corresponding to the currently executed task, etc.
[0134] Figure 5 A flowchart for determining a target virtual machine is provided in an embodiment of the present application. Figure 5 As shown, the above step 320 includes steps 510 to 530.
[0135] Step 510: Obtain the historical bandwidth usage of each first virtual machine, and determine the priority of each first virtual machine according to the historical bandwidth usage of each first virtual machine.
[0136] In some embodiments, when the actual bandwidth used by the plurality of first virtual machines reaches the total bandwidth and there are no newly added virtual machines in the host, the first computing device may adjust the maximum available bandwidth of each first virtual machine based on the priority of each first virtual machine. Exemplarily, the first computing device may preferentially reduce the maximum available bandwidth of the first virtual machine with a lower priority, so that the first virtual machine with a higher priority can obtain more bandwidth resources through reasonable allocation of bandwidth.
[0137] In some embodiments, the first computing device may obtain virtual machine information of each first virtual machine, and determine the priority of each first virtual machine based on the virtual machine information of each first virtual machine. The virtual machine information may include historical bandwidth usage.
[0138] In some examples, the first computing device may obtain the historical bandwidth usage of each first virtual machine in the past period of time (hereinafter referred to as the preset time range), and determine the total historical bandwidth usage of each first virtual machine in the preset time range. The total historical bandwidth usage of each first virtual machine in the preset time range may be determined as the historical bandwidth usage of each first virtual machine; or, the average historical bandwidth usage may be determined based on the total historical bandwidth usage of each first virtual machine in the preset time range and the preset time range, and the average historical bandwidth usage is determined as the historical bandwidth usage of each first virtual machine. Wherein, average historical bandwidth usage = total historical bandwidth usage / preset time range.
[0139] Taking the first virtual machines as first virtual machine V1, first virtual machine V2 and first virtual machine V3, and the preset time range as 7 days, if the total historical bandwidth usage of the first virtual machine V1, the first virtual machine V2 and the first virtual machine V3 within 7 days are 210Mbps, 350Mbps and 140Mbps respectively, the average historical bandwidth usage of each first virtual machine can be determined according to the above total historical bandwidth usage and the preset time range, and the average historical bandwidth usage is determined as the historical bandwidth usage of each first virtual machine, that is, the historical bandwidth usage of the first virtual machine V1, the first virtual machine V2 and the first virtual machine V3 are 30Mbps / day, 50Mbps / day and 20Mbps / day respectively.
[0140] In some embodiments, after determining the historical bandwidth usage of each first virtual machine, the priority of each first virtual machine can be determined based on the historical bandwidth usage of each first virtual machine. Exemplarily, the priority rule can be set as follows: the higher the historical bandwidth usage of the first virtual machine, the higher the priority of the first virtual machine; and the priority of each first virtual machine is determined based on the priority rule and the historical bandwidth usage of each first virtual machine.
[0141] Exemplarily, the priorities corresponding to different historical bandwidth usages may be pre-set. For example, the priority of the first virtual machine whose historical bandwidth usage is a high usage rate (such as greater than 80% of the total bandwidth) may be set to the highest priority (or level 1); the priority of the first virtual machine whose historical bandwidth usage is a medium usage rate (such as greater than or equal to 50% of the total bandwidth, and less than or equal to 80% of the total bandwidth) may be set to the second highest priority (or level 2); the priority of the first virtual machine whose historical bandwidth usage is a low usage rate (less than 50% of the total bandwidth) may be set to the lowest priority (or level 3). It should be noted that the above method of determining the priority of each first virtual machine based on the historical bandwidth usage of each first virtual machine is only an example and is not limited to this in the present embodiment.
[0142] Step 520: Based on the required bandwidth and the actually used bandwidth of each first virtual machine, determine a second virtual machine whose required bandwidth is greater than the actually used bandwidth among the multiple first virtual machines.
[0143] In some embodiments, based on the required bandwidth and actual bandwidth of each first virtual machine, a second virtual machine whose required bandwidth is greater than the actual bandwidth can be determined from multiple first virtual machines, so that more bandwidth resources can be allocated to the second virtual machine to meet the required bandwidth of the second virtual machine.
[0144] For example, taking the required bandwidths of the first virtual machine V1, the first virtual machine V2 and the first virtual machine V3 as 30Mbps, 40Mbps and 50Mbps respectively, and the actually used bandwidths as 20Mbps, 30Mbps and 50Mbps respectively, the required bandwidths of the first virtual machine V1 and the virtual machine V2 are greater than the actually used bandwidths, then the first virtual machine V1 and the first virtual machine V2 can be determined as the second virtual machine.
[0145] Step 530: According to the priorities of the first virtual machines, a first virtual machine with a lower priority than the second virtual machine among the multiple first virtual machines is determined as a target virtual machine, wherein the target priority corresponds to the priority of the second virtual machine.
[0146] In some embodiments, after determining the second virtual machine whose bandwidth requirement is greater than the actual bandwidth used, a target virtual machine whose priority is lower than the second virtual machine can be determined from among the multiple first virtual machines. Thus, by reducing the maximum available bandwidth of the target virtual machine, the second virtual machine whose bandwidth requirement is greater than the actual bandwidth used and whose priority is higher can obtain more bandwidth resources, that is, meet the bandwidth requirement of the second virtual machine.
[0147] Continuing with the above example, when the first virtual machine V1 and the first virtual machine V2 are the second virtual machines, if the priority of the first virtual machine V1 is the highest priority (or level 1), the priority of the first virtual machine V2 is the second highest priority (or level 2), and the priority of the first virtual machine V3 is the lowest priority (or level 3), then the first virtual machine V3 can be determined as the target virtual machine.
[0148] Through the above scheme, the priority of each first virtual machine can be determined based on the historical bandwidth usage of each first virtual machine, and a target virtual machine with a lower priority than the second virtual machine (that is, a virtual machine with a required bandwidth greater than the actual used bandwidth) can be determined among multiple first virtual machines, so that the maximum available bandwidth of the target virtual machine can be adjusted subsequently to enable the second virtual machine with a higher priority to use more bandwidth resources.
[0149] Figure 6 Another flow chart for determining a target virtual machine is provided in an embodiment of the present application. Figure 6 As shown, the above step 320 includes steps 610 to 640.
[0150] Step 610: Determine the importance of the tasks corresponding to the first virtual machines according to at least one of the task type, task duration, and user type corresponding to the tasks currently executed by the first virtual machines.
[0151] In some embodiments, each first virtual machine may perform related tasks during operation, such as data storage, data query, data backup, running real-time communication tools, software development, software testing, and other tasks. Each first virtual machine may have a corresponding task list, and the task list may include information such as the task type, task duration, and user type corresponding to the task to be performed by the first virtual machine. The first computing device may obtain the task list corresponding to each first virtual machine, and determine the task type, task duration, user type, and other information corresponding to the task currently performed by each first virtual machine based on the task list corresponding to each first virtual machine, and determine the task importance of each first virtual machine based on the above information.
[0152] For example, a scoring model may be established to pre-set scores for each task type, task duration, and user type, and the task type score, task duration score, and user type score may be combined to determine the importance of the task.
[0153] For example, the scores corresponding to various task types can be referred to as shown in Table 3:
[0154] Table 3
[0155] Task Type Points Critical tasks (such as real-time data processing, network connection tasks, etc.) 50 General tasks (such as data query, permission verification, etc.) 30 Background tasks (such as cache cleaning, regular data backup, etc.) 20
[0156] For example, the scores corresponding to various task durations can be shown in Table 4:
[0157] Table 4
[0158] Task duration Points Short-term tasks (e.g. tasks lasting less than 1 minute) 50 Medium-duration tasks (e.g., tasks lasting 1 to 5 minutes) 30 Long-duration tasks (e.g. tasks longer than 5 minutes) 20
[0159] For example, the scores corresponding to various user types can be shown in Table 5:
[0160] Table 5
[0161] User Type Points VIP / Administrator 50 Normal User 30 Visitors 20
[0162] Furthermore, the following formula (1) can be used to determine the importance of the task based on the task type score, task duration score, and user type score:
[0163] Task importance = ω1 × task type score + ω2 × task duration score + ω3 × user type score (1)
[0164] Among them, ω1 is the weight corresponding to the task type, ω2 is the weight corresponding to the task duration, and ω3 is the weight corresponding to the user type.
[0165] Step 620: Determine the priority of each first virtual machine according to the importance of the task corresponding to each first virtual machine.
[0166] In some embodiments, after determining the task importance of each first virtual machine, the priority of each first virtual machine can be determined based on the task importance of each first virtual machine. Exemplarily, the priority rule can be set as follows: the higher the task importance of the first virtual machine, the higher the priority of the first virtual machine; and based on the priority rule and the task importance of each first virtual machine, the priority of each first virtual machine is determined.
[0167] Exemplarily, priorities corresponding to different task importances may be pre-set. For example, the priority of the first virtual machine whose task importance is very important may be set to the highest priority (or level 1); the priority of the first virtual machine whose task importance is generally important may be set to the second highest priority (or level 2); and the priority of the first virtual machine whose task importance is not important may be set to the lowest priority (or level 3). It should be noted that the above method of determining the priority of each first virtual machine based on the task importance of each first virtual machine is only an example and is not limited to this in this embodiment.
[0168] Step 630: Based on the required bandwidth and the actually used bandwidth of each first virtual machine, determine a second virtual machine whose required bandwidth is greater than the actually used bandwidth among the multiple first virtual machines.
[0169] It can be understood that the implementation of step 630 can refer to the description of step 520, which will not be repeated here.
[0170] Step 640: According to the priorities of the first virtual machines, a first virtual machine with a lower priority than the second virtual machine among the multiple first virtual machines is determined as a target virtual machine, wherein the target priority corresponds to the priority of the second virtual machine.
[0171] It can be understood that the implementation of step 640 can refer to the description of step 530, which will not be repeated here.
[0172] Through the above scheme, the priority of each first virtual machine can be determined based on the importance of its task, and a target virtual machine with a lower priority than the second virtual machine (i.e., a virtual machine whose required bandwidth is greater than the actual used bandwidth) can be determined among multiple first virtual machines, so that the maximum available bandwidth of the target virtual machine can be adjusted subsequently to enable the second virtual machine with a higher priority to use more bandwidth resources.
[0173] In some embodiments, after determining the historical bandwidth usage and task importance of each first virtual machine, the first computing device may also determine the priority of each first virtual machine based on the historical bandwidth usage and task importance of each first virtual machine.
[0174] For example, preset priority scores and weights corresponding to historical bandwidth usage and task importance may be set, and a mapping relationship between the preset priority scores and the priorities may be established, so as to determine the priority scores corresponding to each virtual machine information and determine the priority of each first virtual machine based on the priority scores and the mapping relationship of each first virtual machine.
[0175] The weight and preset priority score corresponding to each virtual machine information may be referred to as shown in Table 6.
[0176] Table 6
[0177]
[0178] The mapping relationship between the preset priority score and the priority can be: a priority score of 100 to 80 corresponds to the highest priority (or level 1), a priority score of 80 to 50 corresponds to the second highest priority (or level 2), and a priority score of 50 to 0 corresponds to the lowest priority (or level 3).
[0179] For example, if the usage rate of the historical bandwidth used by the first virtual machine V1 is higher than 80% of the total bandwidth, and the importance of the task is very important, the priority score of the first virtual machine V1 is: 100×0.4+100×0.6=100; if the usage rate of the historical bandwidth used by the first virtual machine V2 is higher than 80% of the total bandwidth, and the importance of the task is not important, the priority score of the first virtual machine V2 is: 100×0.4+40×0.6=64; if the usage rate of the historical bandwidth used by the first virtual machine V3 is less than 50% of the total bandwidth, and the importance of the task is normal, the priority score of the first virtual machine V3 is: 40×0.4+70×0.6=58. According to the above priority scores and the above mapping relationship, it can be determined that the priority of the first virtual machine V1 is the highest priority (or level 1), and the priorities of the first virtual machine V2 and the first virtual machine V3 are both the lowest priority (or level 3).
[0180] In some embodiments, a first virtual machine running on a first computing device may not have been assigned to a task requiring network communication for a long time, but now the first virtual machine is assigned to a task requiring network communication. Therefore, to ensure that the first virtual machine can immediately obtain the required network resources for a quick response, the priority of the first virtual machine can be determined as the highest priority.
[0181] In some embodiments, after determining the target virtual machine based on the priority of each first virtual machine, the above step 230 includes: determining the first bandwidth to be adjusted of the target virtual machine according to the difference between the required bandwidth of the second virtual machine and the actual bandwidth used; determining the maximum available bandwidth of the target virtual machine according to the difference between the actual bandwidth used by the target virtual machine and the first bandwidth to be adjusted.
[0182] In some embodiments, after determining the target virtual machine, the bandwidth difference between the required bandwidth and the actual bandwidth of the second virtual machine can be determined based on the required bandwidth and the actual bandwidth used by the second virtual machine, and the first bandwidth to be adjusted of the target virtual machine can be determined based on the bandwidth difference.
[0183] For example, the required bandwidths of the first virtual machine V1, the first virtual machine V2, and the first virtual machine V3 are 30Mbps, 40Mbps, and 50Mbps respectively, and the actual bandwidths used are 20Mbps, 30Mbps, and 50Mbps respectively, the second virtual machines are the first virtual machine V1 and the first virtual machine V2, and the target virtual machine is the first virtual machine V3. Then the bandwidth difference corresponding to the second virtual machine V1 is 30Mbps-20Mbps=10Mbps, and the bandwidth difference corresponding to the second virtual machine V2 is 40Mbps-30Mbps=10Mbps, so the first bandwidth to be adjusted for the target virtual machine V3 is 10Mbps+10Mbps=20Mbps.
[0184] For example, the first bandwidths corresponding to the first virtual machine V1, the first virtual machine V2, and the first virtual machine V3 are 30Mbps, 30Mbps, and 50Mbps, respectively, and the actual bandwidths used are 20Mbps, 30Mbps, and 50Mbps, respectively. The second virtual machine is the first virtual machine V1, and the target virtual machines are the first virtual machine V2 and the first virtual machine V3. Then the bandwidth difference corresponding to the second virtual machine V1 is 30Mbps-20Mbps=10Mbps, and the total first bandwidth to be adjusted corresponding to the target virtual machine V2 and the target virtual machine V3 is 10Mbps+10Mbps=20Mbps. Further, the first bandwidths to be adjusted corresponding to the target virtual machine V2 and the target virtual machine V3 can be determined based on the total first bandwidth to be adjusted, such as the first bandwidth to be adjusted for the target virtual machine V2 can be 10Mbps, and the first bandwidth to be adjusted for the target virtual machine V3 can be 10Mbps.
[0185] In some embodiments, after determining the first bandwidth to be adjusted corresponding to each target virtual machine, the maximum available bandwidth of each target virtual machine can be determined according to the difference between the actual used bandwidth corresponding to each target virtual machine and the first bandwidth to be adjusted, and the maximum available bandwidth of each target virtual machine can be set through the traffic control module, that is, the maximum bandwidth upper limit for each target virtual machine is reset.
[0186] Using the above example, the actual bandwidth used by the target virtual machine V3 is 50 Mbps, and the first bandwidth to be adjusted is 20 Mbps. It can be determined that the maximum available bandwidth of the target virtual machine V3 is 50 Mbps-20 Mbps=30 Mbps.
[0187] Through the above scheme, when the sum of the actual bandwidth used by multiple first virtual machines is greater than the total bandwidth of the first computing device and there are no newly added virtual machines in the host, a target virtual machine with a lower priority than the second virtual machine (i.e., a virtual machine with a required bandwidth greater than the actual bandwidth used) can be determined among the multiple virtual machines based on the priority of each first virtual machine, and the maximum available bandwidth of the target virtual machine can be adjusted according to the difference between the actual bandwidth used by the target virtual machine and the first bandwidth to be adjusted, thereby ensuring that the second virtual machine can use more bandwidth resources and meet the bandwidth usage requirements of the second virtual machine, so as to achieve reasonable allocation of bandwidth resources and reduce network congestion.
[0188] In some embodiments, the above step 220 includes: if the sum of the actual bandwidth used by the multiple first virtual machines reaches the total bandwidth, each of the multiple first virtual machines is determined as a target virtual machine.
[0189] Exemplarily, when the sum of the actual bandwidth used by multiple first virtual machines reaches the total bandwidth and there are no new virtual machines in the first computing device, the first computing device can determine all the first virtual machines as target virtual machines to adjust the maximum available bandwidth of all the first virtual machines.
[0190] Figure 7 A flowchart for determining the maximum available bandwidth of each target virtual machine is provided in an embodiment of the present application. Figure 7 As shown, the above step 230 includes steps 710 to 730.
[0191] Step 710: Obtain the required bandwidth of each target virtual machine.
[0192] In some embodiments, the implementation method of obtaining the required bandwidth of each target virtual machine can refer to the description of the above step 310, which will not be repeated here.
[0193] Step 720: Determine a first bandwidth adjustment ratio according to the ratio of the required bandwidths of the target virtual machines.
[0194] In some embodiments, the first computing device may determine the first bandwidth adjustment ratio based on the required bandwidth of each first virtual machine. Determining the first bandwidth adjustment ratio based on the required bandwidth of each first virtual machine means determining the ratio of the required bandwidths of each first virtual machine as the first bandwidth adjustment ratio.
[0195] For example, taking the required bandwidths of the first virtual machine V1, the first virtual machine V2, and the first virtual machine V3 as 30 Mbps, 50 Mbps, and 40 Mbps respectively, the first bandwidth adjustment ratio is 30 Mbps: 50 Mbps: 40 Mbps = 3:5:4.
[0196] Step 730: Determine the maximum available bandwidth of each target virtual machine according to the product of the total bandwidth and the first bandwidth adjustment ratio.
[0197] In some embodiments, after the first bandwidth adjustment ratio is determined, the maximum available bandwidth of each first virtual machine may be determined according to the product of the total bandwidth of the first computing device and the first bandwidth adjustment ratio.
[0198] Continuing with the above example, if the total bandwidth is 100 Mbps, the maximum available bandwidth of the first virtual machine V1 is 100 Mbps×3 / 12=25 Mbps, the maximum available bandwidth of the first virtual machine V2 is 100 Mbps×5 / 12=42 Mbps, and the maximum available bandwidth of the first virtual machine V3 is 100 Mbps×4 / 12=33 Mbps.
[0199] Through the above solution, when the sum of the actual bandwidth used by multiple first virtual machines reaches the total bandwidth and there is no newly added virtual machine in the first computing device, the first bandwidth adjustment ratio can be determined based on the required bandwidth of each first virtual machine, and the total bandwidth can be allocated to each first virtual machine according to the first bandwidth adjustment ratio. In this way, the total bandwidth can be allocated according to the bandwidth demand of the first virtual machine, so that the first virtual machine with a higher bandwidth demand can be allocated more bandwidth resources, so as to achieve reasonable allocation of bandwidth resources and reduce network congestion.
[0200] In some embodiments, the above step 220 includes: when the sum of the actual bandwidth used by the multiple first virtual machines reaches the total bandwidth, if a third virtual machine is newly added to the host, then each of the first virtual machines and the third virtual machine is determined as a target virtual machine.
[0201] In some embodiments, when the sum of the actual bandwidth used by multiple first virtual machines reaches the total bandwidth of the first computing device, and there is a newly added virtual machine (hereinafter referred to as the third virtual machine) in the first computing device, all the first virtual machines and the newly added third virtual machine can be determined as target virtual machines.
[0202] For example, taking the first virtual machine as the first virtual machine V1, the first virtual machine V2 and the first virtual machine V3 as an example, if the third virtual machine V4 and the third virtual machine V5 are newly added to the first computing device, the first virtual machine V1, the first virtual machine V2, the first virtual machine V3, the third virtual machine V4 and the third virtual machine V5 are all determined as target virtual machines.
[0203] Figure 8 Another flow chart for determining the maximum available bandwidth of each target virtual machine provided in an embodiment of the present application. Figure 8 As shown, the above step 230 includes steps 810 to 820.
[0204] Step 810: determine the total number of virtual machines of the target virtual machine, and determine an average bandwidth value according to the total bandwidth and the total number of virtual machines.
[0205] In some embodiments, after the target virtual machine is determined, the total number of virtual machines of the target virtual machine may be determined first, and the average bandwidth may be determined based on the total bandwidth and the total number of virtual machines.
[0206] Continuing with the above example, taking the total bandwidth as 100Mbps, and the first computing device including the first virtual machine V1, the first virtual machine V2, the first virtual machine V3, the third virtual machine V4 and the third virtual machine V5, the total number of virtual machines of the target virtual machine is 5, and the average bandwidth = 100Mbps / 5 = 20Mbps.
[0207] Step 820: determine the average bandwidth value as the maximum available bandwidth of each target virtual machine.
[0208] In some embodiments, the first computing device may evenly distribute the total bandwidth to each target virtual machine. Exemplarily, the first computing device may determine the average bandwidth as the maximum available bandwidth of each target virtual machine.
[0209] Using the above example, the maximum available bandwidth of the first virtual machine V1, the first virtual machine V2, the first virtual machine V3, the third virtual machine V4 and the third virtual machine V5 is 20 Mbps.
[0210] Through the above scheme, when the sum of the actual bandwidth used by multiple first virtual machines reaches the total bandwidth and there is a newly added third virtual machine in the host, the total bandwidth can be evenly distributed to each first virtual machine and each third virtual machine, so that the newly added third virtual machine can be allocated bandwidth to perform tasks normally.
[0211] Fig. 9 Another flow chart for determining the maximum available bandwidth of each target virtual machine provided in the embodiment of the present application. Fig. 9 As shown, the above step 230 includes steps 910 to 930.
[0212] Step 910: Determine a second bandwidth adjustment ratio according to a ratio of actually used bandwidths of the first virtual machines.
[0213] In some embodiments, after the target virtual machine is determined, the second bandwidth adjustment ratio may be determined based on the actual bandwidth used by each first virtual machine. Determining the second bandwidth adjustment ratio based on the actual bandwidth used by each first virtual machine means determining the ratio of the actual bandwidth used by each first virtual machine as the second bandwidth adjustment ratio.
[0214] For example, taking the actual used bandwidths corresponding to the first virtual machine V1, the first virtual machine V2 and the first virtual machine V3 as 30 Mbps, 50 Mbps and 20 Mbps respectively, the second bandwidth adjustment ratio is 30 Mbps: 50 Mbps: 20 Mbps = 3:5:2.
[0215] Step 920: Determine the second bandwidth to be adjusted of each target virtual machine according to the product of the preset bandwidth adjustment total amount and the second bandwidth adjustment ratio.
[0216] In some embodiments, after determining the second bandwidth adjustment ratio, the second bandwidth to be adjusted corresponding to each target virtual machine can be determined based on the preset bandwidth adjustment total amount and the second bandwidth adjustment ratio. Exemplarily, the preset bandwidth adjustment total amount can be a predicted bandwidth adjustment value obtained after predicting the bandwidth value required by the newly added third virtual machine, or it can be a pre-set bandwidth adjustment value. It should be noted that the above method of determining the preset bandwidth adjustment total amount is only an example and is not limited to this in this embodiment.
[0217] For example, if the total bandwidth is 100Mbps, the actual bandwidths corresponding to the first virtual machine V1, the first virtual machine V2 and the first virtual machine V3 are 30Mbps, 50Mbps and 20Mbps respectively, and the third virtual machine V4 is added to the first computing device, the second bandwidth adjustment ratio is 30Mbps: 50Mbps: 20Mbps = 3: 5: 2. If the preset total bandwidth adjustment amount is 20Mbps, the second bandwidth to be adjusted corresponding to the first virtual machine V1 is 20Mbps × 3 / 10 = 6Mbps, the second bandwidth to be adjusted corresponding to the first virtual machine V2 is 20Mbps × 5 / 10 = 10Mbps, and the second bandwidth to be adjusted corresponding to the first virtual machine V3 is 20Mbps × 2 / 10 = 4Mbps. Then the second total bandwidth to be adjusted corresponding to the first virtual machine V1, the first virtual machine V2 and the first virtual machine V3 is 20Mbps, and the second total bandwidth to be adjusted 20Mbps can be determined as the second bandwidth to be adjusted corresponding to the second virtual machine V4.
[0218] Step 930: Determine the maximum available bandwidth of each target virtual machine according to the difference between the actual bandwidth used by each target virtual machine and the second bandwidth to be adjusted.
[0219] In some embodiments, after the second bandwidth to be adjusted of each target virtual machine is determined, the maximum available bandwidth of each target virtual machine may be determined according to the difference between the actual bandwidth used by each target virtual machine and the second bandwidth to be adjusted.
[0220] Exemplarily, when the number of third virtual machines is one, the second total bandwidth to be adjusted can be determined as the maximum available bandwidth of the third virtual machine; when the number of third virtual machines is multiple, the second total bandwidth to be adjusted can be evenly distributed to each third virtual machine, that is, the maximum available bandwidth of each second virtual machine is determined based on the second total bandwidth to be adjusted and the total number of third virtual machines.
[0221] Continuing with the above example, the maximum available bandwidth of the first virtual machine V1 is 30Mbps-6Mbps=24Mbps, the maximum available bandwidth of the first virtual machine V2 is 50Mbps-10Mbps=40Mbps, the maximum available bandwidth of the first virtual machine V3 is 20Mbps-4Mbps=16Mbps, and the maximum available bandwidth of the second virtual machine V4 is 20Mbps.
[0222] Continuing with the above example, if a third virtual machine V4 and a third virtual machine V5 are newly added to the first computing device, the second total bandwidth to be adjusted 20Mbps can be evenly distributed to the third virtual machine V4 and the third virtual machine V5, that is, the maximum available bandwidth of the third virtual machine V4 is 10Mbps, and the maximum available bandwidth of the second virtual machine V5 is 10Mbps.
[0223] Through the above scheme, when the sum of the actual bandwidth used by multiple first virtual machines reaches the total bandwidth and there is a newly added third virtual machine in the host, the second bandwidth adjustment ratio can be determined based on the actual bandwidth used by each first virtual machine, and the maximum available bandwidth of each first virtual machine and the third virtual machine can be determined based on the second bandwidth adjustment ratio, so that the newly added third virtual machine can be allocated bandwidth to perform tasks normally.
[0224] Fig.10 A flowchart of another bandwidth adjustment method provided in an embodiment of the present application. Fig.10 As shown, the method includes steps 1010 to 1030.
[0225] Step 1010: Obtain the maximum supplied bandwidth provided by the network device for the plurality of first computing devices, and obtain the total actually used bandwidth of each first computing device.
[0226] In some embodiments, in the adaptive bandwidth adjustment mode, the second computing device can dynamically adjust the total bandwidth of multiple first computing devices through the virtual machine management platform. Exemplarily, the second computing device can obtain the maximum supply bandwidth provided by the network device deployed by the network operator for multiple first computing devices through the virtual machine management platform, and periodically obtain the total actual bandwidth used and the total required bandwidth of each first computing device.
[0227] The total actual bandwidth used by the first computing device is determined according to the sum of the actual bandwidth used by the multiple first virtual machines in the first computing device; and the total required bandwidth of the first computing device is determined according to the sum of the required bandwidths of the multiple first virtual machines in the first computing device.
[0228] Step 1020: If the total actual bandwidth used by the plurality of first computing devices reaches the maximum supplied bandwidth, a target computing device is determined from the plurality of first computing devices.
[0229] In some embodiments, when the sum of the total actual bandwidth used by the plurality of first computing devices does not reach the maximum bandwidth provided, the second computing device may not adjust the total bandwidth of each first computing device. When the total actual bandwidth used by the plurality of first computing devices reaches the maximum bandwidth provided, the second computing device may determine a target computing device from the plurality of first computing devices to adjust the total bandwidth of the target computing device.
[0230] Step 1030: reallocate the total bandwidth of the target computing device based on the total actually used bandwidth of each first computing device.
[0231] In some embodiments, the second computing device may reallocate the total bandwidth of each target computing device through the virtual machine management platform based on information such as the maximum supplied bandwidth, the total actual bandwidth used by each first computing device, and the total required bandwidth of each first computing device.
[0232] Through the above scheme, in the adaptive bandwidth adjustment mode, if the sum of the total actual used bandwidth of multiple first computing devices reaches the maximum supplied bandwidth, the second computing device can dynamically adjust the total bandwidth of the target computing device among the multiple first computing devices, thereby further optimizing the network performance and improving the bandwidth utilization.
[0233] In some embodiments, the above step 1020 includes: if the sum of the total actually used bandwidth of the plurality of first computing devices reaches the maximum supplied bandwidth, then determining each first computing device as a target computing device.
[0234] Exemplarily, when the total actual bandwidth used by the plurality of first computing devices reaches the maximum supplied bandwidth, the second computing device may determine all the first computing devices as target computing devices to adjust the total bandwidth of all the first computing devices.
[0235] In some embodiments, the above step 1030 includes: obtaining the total required bandwidth of each first computing device; determining the third bandwidth adjustment ratio based on the ratio of the total required bandwidth of each target computing device; and determining the total bandwidth of each computing device based on the product of the maximum supplied bandwidth and the third bandwidth adjustment ratio.
[0236] Exemplarily, the second computing device may obtain the total required bandwidth of each first computing device, and the total required bandwidth of the first computing device may be determined according to the sum of the required bandwidths of multiple first virtual machines in the first computing device. The implementation method of obtaining the required bandwidth of each first virtual machine may refer to the description of step 310, which will not be repeated here.
[0237] Exemplarily, the second computing device may determine the ratio of the total required bandwidths of the first computing devices as the third bandwidth adjustment ratio. For example, taking the total required bandwidths of the first computing device H1, the first computing device H2, and the first computing device H3 as 200Mbps, 250Mbps, and 150Mbps, respectively, the third bandwidth adjustment ratio is 200Mbps: 250Mbps: 150Mbps = 4:5:3.
[0238] Exemplarily, after determining the third bandwidth adjustment ratio, the total bandwidth of each first computing device can be determined according to the product of the maximum supply bandwidth and the third bandwidth adjustment ratio. Using the above example, if the total bandwidth is 500Mbps, the total bandwidth of the first computing device H1 is 500Mbps×4 / 12=167Mbps, the total bandwidth of the first computing device H2 is 500Mbps×5 / 12=208Mbps, and the total bandwidth of the first computing device H3 is 500Mbps×3 / 12=125Mbps.
[0239] It can be understood that the way in which the second computing device allocates the total bandwidth of multiple first computing devices is not limited to the above-mentioned method of allocating according to the total required bandwidth ratio. The total bandwidth of multiple first computing devices can also be allocated according to other bandwidth adjustment methods, such as allocating bandwidth according to the priority of multiple first virtual machines in each first computing device, etc. This is not limited in the present embodiment.
[0240] Through the above solution, the second computing device can adjust the total bandwidth of multiple first computing devices based on the total required bandwidth of each first computing device through the virtual machine management platform, thereby further reducing the network delay or packet loss rate of the first computing device to optimize network performance.
[0241] Fig.11 A flowchart of another bandwidth adjustment method provided in an embodiment of the present application. Fig.11 As shown, the method includes steps 1101 to 1110. The bandwidth adjustment method provided in the present application is summarized as follows.
[0242] Step 1101: in response to the bandwidth adjustment mode being the adaptive bandwidth adjustment mode, the first computing device obtains the total bandwidth of the first computing device and the actual bandwidth used by each first virtual machine running on the first computing device.
[0243] It can be understood that the implementation method of step 1101 can refer to the relevant description of step 210, which will not be repeated here.
[0244] Step 1102: Determine whether the sum of the actual bandwidth usage of the plurality of first virtual machines running on the first computing device reaches the total bandwidth of the first computing device.
[0245] Exemplarily, if the sum of the actual bandwidth used by the multiple first virtual machines running on the first computing device reaches the total bandwidth of the first computing device, step 1103 is executed; if the sum of the actual bandwidth used by the multiple first virtual machines running on the first computing device does not reach the total bandwidth of the first computing device, step 1101 is executed.
[0246] Step 1103: If the sum of the actual bandwidth usage of the plurality of first virtual machines running on the first computing device reaches the total bandwidth of the first computing device, it is determined whether there is a newly added third virtual machine in the first computing device.
[0247] Exemplarily, if there is no newly added third virtual machine in the first computing device, step 1104 or step 1105 is executed; if there is a newly added third virtual machine in the first computing device, step 1106 or step 1107 is executed.
[0248] Step 1104: If the sum of the actual bandwidth used by the multiple first virtual machines reaches the total bandwidth, and there is no newly added third virtual machine in the first computing device, determine the second virtual machine among the multiple first virtual machines whose required bandwidth is greater than the actual bandwidth used, and determine the first virtual machine among the multiple first virtual machines whose priority is lower than the second virtual machine as the target virtual machine; adjust the maximum available bandwidth of the target virtual machine based on the required bandwidth and the actual bandwidth used by the second virtual machine.
[0249] It can be understood that the implementation method of step 1104 can refer to the relevant descriptions of steps 510 to 530 and steps 610 to 640, and will not be repeated here.
[0250] Step 1105: If the sum of the actual bandwidths used by multiple first virtual machines reaches the total bandwidth, and there is no newly added third virtual machine in the first computing device, the first bandwidth adjustment ratio is determined based on the required bandwidth of each first virtual machine, and the maximum available bandwidth of each first virtual machine is adjusted based on the total bandwidth and the first bandwidth adjustment ratio.
[0251] It can be understood that the implementation method of step 1105 can refer to the relevant descriptions of steps 710 to 730, which will not be repeated here.
[0252] Step 1106: If the sum of the actual bandwidths used by the multiple first virtual machines reaches the total bandwidth, and there is a newly added third virtual machine in the first computing device, the total bandwidth is evenly distributed to the first virtual machines and the third virtual machine.
[0253] It can be understood that the implementation method of step 1106 can refer to the relevant description of steps 810 to 820, which will not be repeated here.
[0254] Step 1107, if the sum of the actual bandwidth used by multiple first virtual machines reaches the total bandwidth, and there is a newly added third virtual machine in the first computing device, the second bandwidth adjustment ratio is determined based on the actual bandwidth used by the first virtual machine, and the maximum available bandwidth of the first virtual machine and the second virtual machine is adjusted based on the second bandwidth adjustment ratio and the preset bandwidth adjustment total amount.
[0255] It can be understood that the implementation method of step 1107 can refer to the relevant description of steps 910 to 930, which will not be repeated here.
[0256] Step 1108: The second computing device obtains the maximum supplied bandwidth and obtains the total actually used bandwidth of each first computing device.
[0257] It can be understood that the implementation method of step 1108 can refer to the relevant description of step 1010, which will not be repeated here.
[0258] Step 1109 , determining whether the sum of the total actually used bandwidths of the plurality of first computing devices reaches the maximum supplied bandwidth.
[0259] Exemplarily, if the total actual bandwidth used by the plurality of first computing devices does not reach the maximum bandwidth provided, step 1101 is executed; if the total actual bandwidth used by the plurality of first computing devices reaches the maximum bandwidth provided, step 1110 is executed.
[0260] Step 1110: if the total actual bandwidth used by the plurality of first computing devices reaches the maximum supplied bandwidth, a target computing device is determined among the plurality of first computing devices, and the total bandwidth of the target computing device is reallocated based on the total actual bandwidth used by each first computing device.
[0261] It can be understood that the implementation method of step 1110 can refer to the relevant description of step 1020 and step 1030, which will not be repeated here.
[0262] By applying the technical solution of the present application, adaptive adjustment of the bandwidth of a virtual machine and a first computing device running the virtual machine can be achieved, thereby improving the efficiency of bandwidth regulation, avoiding network congestion, optimizing network performance, and improving bandwidth utilization; it can also ensure that virtual machines whose bandwidth demand is greater than the actual bandwidth usage can use more bandwidth resources, so as to achieve reasonable allocation of bandwidth resources and normal progress of key tasks; and, in the case of a newly added virtual machine in the first computing device, bandwidth can be allocated to the newly added virtual machine so that the newly added virtual machine can perform tasks normally, thereby further avoiding network congestion and optimizing network performance.
[0263] In addition, the bandwidth adjustment method provided by the present application can be applied not only to bandwidth adjustment scenarios of virtual machines, but also to bandwidth adjustment scenarios such as cloud computing platforms, data centers, Internet of Things devices, mobile communication networks, and broadband network services. For example, in a cloud computing platform, the bandwidth adjustment method can be applied to dynamically adjust the bandwidth of each tenant to optimize network performance; in a large-scale data center environment, the bandwidth adjustment method can be applied to effectively manage and schedule network bandwidth between a large number of servers to ensure network stability and operating efficiency within the data center; in Internet of Things devices, the bandwidth adjustment method can be applied to dynamically adjust the bandwidth of each Internet of Things device to meet the needs of different devices and applications; in a mobile communication network, the bandwidth adjustment method can be applied to dynamically adjust the user's bandwidth according to the user's real-time bandwidth needs and network conditions; for operators providing broadband network services, the bandwidth adjustment method can be applied to perform more refined bandwidth management and bandwidth allocation.
[0264] Fig.12 A schematic diagram of a bandwidth adjustment device provided in an embodiment of the present application. Fig.12 As shown, the bandwidth adjustment device 1200 includes a first acquisition module 1210 , a first determination module 1220 and a first bandwidth allocation module 1230 .
[0265] The first acquisition module 1210 is configured to acquire the total bandwidth configured for the first computing device, and periodically acquire the actual bandwidth used by each first virtual machine.
[0266] The first determination module 1220 is configured to determine a target virtual machine from among the plurality of first virtual machines if the sum of the actually used bandwidths of the plurality of first virtual machines reaches the total bandwidth.
[0267] The first bandwidth allocation module 1230 is configured to reallocate the maximum available bandwidth of the target virtual machine based on the total bandwidth and / or the actual bandwidth used by each first virtual machine.
[0268] In some embodiments, the first determination module 1220 is specifically configured to: if the sum of the actual bandwidth used by multiple first virtual machines reaches the total bandwidth, obtain the required bandwidth of each first virtual machine; based on the required bandwidth and actual bandwidth used by each first virtual machine, determine the target virtual machine among the multiple first virtual machines.
[0269] In some embodiments, the first acquisition module 1210 is specifically configured to: obtain the byte sending and receiving volume at the network card driver interface corresponding to each first virtual machine according to a preset period through a preset command; wherein the network card driver interface corresponding to each first virtual machine is an interface between the virtual network card in the first computing device and the virtual network card in each first virtual machine; determine the required bandwidth of each first virtual machine based on the byte sending and receiving volume at the network card driver interface corresponding to each first virtual machine and the preset period.
[0270] In some embodiments, the first acquisition module 1210 is specifically configured to: obtain the required bandwidth of each first virtual machine determined by the task information corresponding to each target task among multiple target tasks that each first virtual machine needs to perform within a preset time period; wherein the task information includes the estimated bandwidth, task execution duration and task execution order corresponding to each target task; the task execution duration and task execution order corresponding to each target task are used to determine the parallel execution status of each target task within the preset time period, and the estimated bandwidth and parallel execution status corresponding to each target task are used to determine the required bandwidth of each first virtual machine.
[0271] In some embodiments, the first determination module 1220 is specifically configured to: obtain the historical bandwidth usage of each first virtual machine, and determine the priority of each first virtual machine based on the historical bandwidth usage of each first virtual machine; wherein, the higher the historical bandwidth usage of the first virtual machine, the higher the priority of the first virtual machine; based on the required bandwidth and the actual bandwidth usage of each first virtual machine, determine a second virtual machine whose required bandwidth is greater than the actual bandwidth usage among multiple first virtual machines; according to the priority of each first virtual machine, determine a first virtual machine whose priority is lower than that of the second virtual machine among the multiple first virtual machines as a target virtual machine.
[0272] In some embodiments, the first determination module 1220 is specifically configured to: determine the importance of the task corresponding to each first virtual machine based on at least one of the task type, task duration and user type corresponding to the task currently executed by the first virtual machine; determine the priority of each first virtual machine based on the importance of the task corresponding to each first virtual machine; wherein, the higher the importance of the task of the first virtual machine, the higher the priority of the first virtual machine; based on the required bandwidth and the actual used bandwidth of each first virtual machine, determine a second virtual machine whose required bandwidth is greater than the actual used bandwidth among multiple first virtual machines; according to the priority of each first virtual machine, determine a first virtual machine whose priority is lower than that of the second virtual machine among the multiple first virtual machines as the target virtual machine.
[0273] In some embodiments, the first bandwidth allocation module 1230 is specifically configured to: determine the first bandwidth to be adjusted of the target virtual machine based on the difference between the required bandwidth of the second virtual machine and the actual bandwidth used; determine the maximum available bandwidth of the target virtual machine based on the difference between the actual bandwidth used by the target virtual machine and the first bandwidth to be adjusted.
[0274] In some embodiments, the first determination module 1220 is specifically configured as follows: if the sum of the actual bandwidth used by multiple first virtual machines reaches the total bandwidth, each first virtual machine is determined as a target virtual machine; the first bandwidth allocation module 1230 is specifically configured as follows: obtain the required bandwidth of each target virtual machine; determine the first bandwidth adjustment ratio based on the ratio of the required bandwidth of each target virtual machine; determine the maximum available bandwidth of each target virtual machine based on the product of the total bandwidth and the first bandwidth adjustment ratio.
[0275] In some embodiments, the first determination module 1220 is specifically configured to: when the sum of the actual bandwidth used by multiple first virtual machines reaches the total bandwidth, if a third virtual machine is newly added to the first computing device, each first virtual machine and the third virtual machine is determined as a target virtual machine.
[0276] In some embodiments, the first bandwidth allocation module 1230 is specifically configured to: determine the total number of target virtual machines, and determine the average bandwidth according to the total bandwidth and the total number of virtual machines; and determine the average bandwidth as the maximum available bandwidth of each target virtual machine.
[0277] In some embodiments, the first bandwidth allocation module 1230 is specifically configured to: determine the second bandwidth adjustment ratio based on the ratio of the actual bandwidth used by each first virtual machine; determine the second bandwidth to be adjusted for each target virtual machine based on the product of the preset bandwidth adjustment total amount and the second bandwidth adjustment ratio; determine the maximum available bandwidth for each target virtual machine based on the difference between the actual bandwidth used by each target virtual machine and the second bandwidth to be adjusted.
[0278] In some embodiments, the first acquisition module 1210 is specifically configured to: in response to the bandwidth adjustment mode of the first computing device being the adaptive bandwidth adjustment mode, obtain the total bandwidth configured for the first computing device, and periodically obtain the actual bandwidth used by each first virtual machine.
[0279] Fig.13 A schematic diagram of another bandwidth adjustment device provided in an embodiment of the present application. Fig.13 As shown, the bandwidth adjustment device 1300 includes a second acquisition module 1310 , a second determination module 1320 and a second bandwidth allocation module 1330 .
[0280] The second acquisition module 1310 is configured to acquire the maximum supplied bandwidth provided by the network device for the plurality of first computing devices, and acquire the total actually used bandwidth of each first computing device.
[0281] The total actual used bandwidth of the first computing device is determined according to the sum of the actual used bandwidths of the multiple first virtual machines in the first computing device.
[0282] The second determination module 1320 is configured to determine a target computing device from among the plurality of first computing devices if the sum of the total actually used bandwidths of the plurality of first computing devices reaches the maximum provided bandwidth.
[0283] The second bandwidth allocation module 1330 is configured to reallocate the total bandwidth of the target computing device based on the total actual used bandwidth of each first computing device.
[0284] In some embodiments, the second determination module 1320 is specifically configured as follows: if the sum of the total actually used bandwidth of multiple first computing devices reaches the maximum supplied bandwidth, each first computing device is determined as a target computing device; the second bandwidth allocation module 1330 is specifically configured as follows: obtain the total required bandwidth of each first computing device; wherein the total required bandwidth of the first computing device is determined according to the sum of the required bandwidths of multiple first virtual machines in the first computing device; determine the third bandwidth adjustment ratio according to the ratio of the total required bandwidths of each target computing device; and determine the total bandwidth of each computing device according to the product of the maximum supplied bandwidth and the third bandwidth adjustment ratio.
[0285] Fig.14 A schematic diagram of a computing device provided for some embodiments of the present application. In some embodiments, the computing device may be a server, a terminal device, etc. The computing device includes one or more processors and a memory. The memory is configured to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the bandwidth adjustment method in the above-mentioned embodiment.
[0286] like Fig.14 As shown, the computing device 1400 includes: a processor (processor) 1401 and a memory 1402. Exemplarily, the computing device 1400 may also include: a communication interface (Communications Interface) 1403 and a communication bus 1404.
[0287] The processor 1401, the memory 1402 and the communication interface 1403 communicate with each other via the communication bus 1404. The communication interface 1403 is used to communicate with other devices such as client or other server network elements.
[0288] In some embodiments, the processor 1401 is used to execute the program 1405, and specifically, the relevant steps in the above-mentioned bandwidth adjustment method embodiment can be executed. Specifically, the program 1405 can include program code, and the program code includes computer executable instructions.
[0289] Exemplarily, the processor 1401 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement some embodiments of the present application. The computing device 1400 may include one or more processors, which may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0290] In some embodiments, the memory 1402 is used to store the program 1405. The memory 1402 may include a high-speed RAM memory, and may also include a non-volatile memory (NVM), such as at least one disk memory.
[0291] The program 1405 may be specifically called by the processor 1401 to enable the computing device 1400 to perform bandwidth adjustment method operations.
[0292] Some embodiments of the present application provide a computer-readable storage medium, which stores at least one executable instruction. When the executable instruction is executed on a computing device 1400, the computing device 1400 executes the bandwidth adjustment method in the above embodiment.
[0293] The executable instructions may be specifically used to enable the computing device 1400 to perform bandwidth adjustment method operations.
[0294] For example, the computer readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0295] The beneficial effects that can be achieved by the readable storage medium provided in some embodiments of the present application can refer to the beneficial effects of the corresponding bandwidth adjustment method provided above, and will not be repeated here.
[0296] It should be noted that, in the application, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0297] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0298] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, which can be embodied in any computer-readable medium for use by an instruction execution system, apparatus or device (such as a computer-based system, a system including a processor or other system that can fetch instructions from an instruction execution system, apparatus or device and execute instructions), or used in combination with these instruction execution systems, apparatuses or devices.
[0299] For the purposes of this specification, a "computer-readable medium" can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by an instruction execution system, apparatus, or device or in conjunction with such instruction execution system, apparatus, or device.
[0300] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection having one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM).
[0301] In addition, the computer readable medium can even be a paper or other suitable medium on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, and then editing, interpreting or processing in other suitable ways as necessary, and then storing it in the computer memory. It should be understood that various parts of the present application can be implemented in hardware, software, firmware or a combination thereof.
[0302] In the above embodiments, multiple steps or methods may be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it may be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0303] The implementation methods described above are only specific implementation methods of the present application and are not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present application should be included in the scope of protection of the present application.
Claims
1. A bandwidth adjustment method, characterized in that: For a first computing device, the first computing device including a plurality of first virtual machines, the method comprising: Acquire the total bandwidth configured for the first computing device, and periodically acquire the actual bandwidth used by each of the first virtual machines; If the sum of the actual bandwidths used by the multiple first virtual machines reaches the total bandwidth, a target virtual machine is determined from the multiple first virtual machines; there are one or more target virtual machines, and the target virtual machine is a virtual machine whose bandwidth is to be adjusted; Based on the total bandwidth and / or the actually used bandwidth of each of the first virtual machines, the maximum available bandwidth of the target virtual machine is reallocated.
2. The method according to claim 1, characterized in that If the sum of the actually used bandwidths of the multiple first virtual machines reaches the total bandwidth, determining a target virtual machine from the multiple first virtual machines includes: If the sum of the actual bandwidths used by the multiple first virtual machines reaches the total bandwidth, obtaining the required bandwidth of each of the first virtual machines; A target virtual machine is determined from the plurality of first virtual machines based on the required bandwidth and the actually used bandwidth of each of the first virtual machines.
3. The method according to claim 2, characterized in that The obtaining the required bandwidth of each of the first virtual machines includes: Obtaining the amount of bytes sent and received at the network card driver interface corresponding to each of the first virtual machines according to a preset period through a preset command; wherein the network card driver interface corresponding to each of the first virtual machines is an interface between a virtual network card in the first computing device and a virtual network card in each of the first virtual machines; The required bandwidth of each of the first virtual machines is determined according to the byte transmission and reception volume at the network card driver interface corresponding to each of the first virtual machines and the preset period.
4. The method according to claim 2, characterized in that: The obtaining the required bandwidth of each of the first virtual machines includes: Obtaining required bandwidth of each of the first virtual machines determined by task information corresponding to each of the target tasks among multiple target tasks that each of the first virtual machines needs to perform within a preset time period; Among them, the task information includes the estimated bandwidth, task execution duration and task execution order corresponding to each of the target tasks; the task execution duration and task execution order corresponding to each of the target tasks are used to determine the parallel execution status of each of the target tasks within the preset duration, and the estimated bandwidth and parallel execution status corresponding to each of the target tasks are used to determine the required bandwidth of each of the first virtual machines.
5. The method according to claim 1, characterized in that If the sum of the actually used bandwidths of the multiple first virtual machines reaches the total bandwidth, determining a target virtual machine from the multiple first virtual machines includes: Determining a priority of each first virtual machine, wherein the priority indicates a priority of each first virtual machine when bandwidth is allocated; According to the priorities of the first virtual machines, a first virtual machine whose priority is lower than the target priority is determined as the target virtual machine.
6. The method according to claim 5, characterized in that The step of determining, according to the priorities of the first virtual machines, a first virtual machine having a priority lower than a target priority as a target virtual machine includes: Acquire the historical bandwidth usage of each of the first virtual machines, and determine the priority of each of the first virtual machines according to the historical bandwidth usage of each of the first virtual machines; wherein the higher the historical bandwidth usage of the first virtual machine, the higher the priority of the first virtual machine; Based on the required bandwidth and the actually used bandwidth of each of the first virtual machines, determining a second virtual machine among the multiple first virtual machines whose required bandwidth is greater than the actually used bandwidth; According to the priorities of the first virtual machines, a first virtual machine among the multiple first virtual machines whose priority is lower than that of the second virtual machine is determined as the target virtual machine.
7. The method according to claim 5, characterized in that The step of determining, according to the priorities of the first virtual machines, a first virtual machine having a priority lower than a target priority as a target virtual machine includes: Determine the importance of tasks corresponding to the first virtual machines according to at least one of a task type, a task duration, and a user type corresponding to the task currently executed by the first virtual machine; Determining the priority of each first virtual machine according to the importance of the task corresponding to each first virtual machine; wherein the higher the importance of the task of the first virtual machine is, the higher the priority of the first virtual machine is; Based on the required bandwidth and the actually used bandwidth of each of the first virtual machines, determining a second virtual machine among the multiple first virtual machines whose required bandwidth is greater than the actually used bandwidth; According to the priorities of the first virtual machines, a first virtual machine among the multiple first virtual machines whose priority is lower than that of the second virtual machine is determined as the target virtual machine.
8. The method according to claim 6 or 7, characterized in that: in, The reallocating the maximum available bandwidth of the target virtual machine based on the total bandwidth and / or the actually used bandwidth of each of the first virtual machines includes: Determining a first bandwidth to be adjusted of the target virtual machine according to a difference between a required bandwidth of the second virtual machine and an actually used bandwidth; The maximum available bandwidth of the target virtual machine is determined according to the difference between the actual bandwidth used by the target virtual machine and the first bandwidth to be adjusted.
9. A bandwidth adjustment method, characterized in that: For a second computing device, the second computing device establishes a communication connection with a plurality of first computing devices and a network device, each of the plurality of first computing devices includes a plurality of first virtual machines, the method comprising: Acquire the maximum supplied bandwidth provided by the network device for the plurality of first computing devices, and acquire the total actually used bandwidth of each of the first computing devices; wherein the total actually used bandwidth of the first computing device is determined according to the sum of the actually used bandwidths of the plurality of first virtual machines in the first computing device; If the sum of the total actually used bandwidths of the plurality of first computing devices reaches the maximum supplied bandwidth, determining a target computing device from the plurality of first computing devices; Based on the total actually used bandwidth of each of the first computing devices, the total bandwidth of the target computing device is reallocated.
10. A computing device, characterized in that include: one or more processors; and A memory configured to: store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the bandwidth adjustment method according to any one of claims 1 to 8, or implement the bandwidth adjustment method according to claim 9.