CN116954874A - Resource allocation method, device, equipment and storage medium - Google Patents
Resource allocation method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN116954874A CN116954874A CN202210387958.5A CN202210387958A CN116954874A CN 116954874 A CN116954874 A CN 116954874A CN 202210387958 A CN202210387958 A CN 202210387958A CN 116954874 A CN116954874 A CN 116954874A
- Authority
- CN
- China
- Prior art keywords
- pmd
- virtual
- threads
- host
- parameter
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 66
- 238000013468 resource allocation Methods 0.000 title claims abstract description 28
- 238000012360 testing method Methods 0.000 claims abstract description 88
- 230000005540 biological transmission Effects 0.000 claims abstract description 52
- 238000012545 processing Methods 0.000 claims abstract description 30
- 238000013507 mapping Methods 0.000 claims description 17
- 239000002699 waste material Substances 0.000 abstract description 6
- 238000004891 communication Methods 0.000 description 12
- 238000011161 development Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 5
- 230000001351 cycling effect Effects 0.000 description 4
- 238000012546 transfer Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012806 monitoring device Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000011022 operating instruction Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5061—Partitioning or combining of resources
- G06F9/5077—Logical partitioning of resources; Management or configuration of virtualized resources
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5016—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/4557—Distribution of virtual machine instances; Migration and load balancing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45583—Memory management, e.g. access or allocation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/5018—Thread allocation
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The application provides a resource allocation method, a device, equipment and a storage medium. M virtual machines are deployed on a host, the host has N virtual processor resources which can be allocated, and Q PMD threads are deployed. The method comprises the following steps: acquiring a first parameter of a physical network card, wherein the first parameter is related to the maximum transmission rate of the physical network card; controlling the virtual test machine to carry out packet sending pressure test on the host machine at a first rate, and acquiring a second parameter of the host machine, wherein the second parameter is related to the total maximum transmission rate of the message processed by the M virtual machines based on Q PMD threads; the first rate is greater than or equal to the maximum transmission rate of the physical network card; obtaining a target number Z of PMD threads according to the first parameter and the second parameter; z is less than N, Z is used to determine the amount of virtual processor resources allocated for the PMD thread. The method reduces the waste of resources of the virtual processor and improves the efficiency of processing the message by the whole virtual machine in the virtual network.
Description
Technical Field
The present application relates to communications technologies, and in particular, to a method, an apparatus, a device, and a storage medium for resource allocation.
Background
Cloud computing enables the creation of multiple Virtual Machines (VMs) on one or more hosts sharing the CPU and memory resources of the host. The optimization of the message transceiving capacity of the virtual machine is currently performed through OpenvSwitch with DPDK technology (data plane development kit (Data Plane Development Kit, DPDK)). The data message passes through the physical network card sending path of the host machine and passes through the kernel Mode, and is forwarded by a Poll Mode Driver (PMD) thread to directly enter the virtual machine. Typically, after deployment OpenvSwitch (OvS), the host will empirically allocate a fixed number of PMD threads based on the number of non-uniform memory access (Non Uniform Memory Access, NUMA) nodes.
However, empirically assigning a fixed number of PMD threads often fails to acquire the throughput or expected packet rate and throughput of the server's maximum virtual network. If PMD is allocated more, virtual processor (Virtual Central Processing Unit, vCPU) resources are wasted, so that vCPU resources used for calculation by the server are reduced; if the PMD is allocated less, the efficiency of processing the message by the whole virtual machine in the virtual network is lower.
Disclosure of Invention
The application provides a resource allocation method, a device, equipment and a storage medium, which are used for solving the problems of vCPU resource waste or lower efficiency of processing messages by an integral virtual machine in a virtual network caused by vCPU resource allocation in the prior art.
In a first aspect, the present application provides a resource allocation method, where M virtual machines are deployed on a host, where the host has N virtual processor resources that can be allocated, Q PMD threads are currently deployed on the host, where the PMD threads are configured to forward a packet received by a physical network card of the host to a corresponding virtual machine for processing, one PMD thread occupies one virtual processor resource, where M and Q are integers greater than or equal to 1, and N is an integer greater than or equal to 2, and the method includes:
and acquiring a first parameter of the physical network card, wherein the first parameter is related to the maximum transmission rate of the physical network card.
Controlling a virtual testing machine to carry out packet sending pressure test on the host machine at a first rate, and obtaining a second parameter of the host machine, wherein the second parameter is related to the total maximum transmission rate of messages processed by the M virtual machines based on the Q PMD threads; the first rate is greater than or equal to a maximum transmission rate of the physical network card.
Obtaining a target number Z of the PMD threads according to the first parameter and the second parameter; the Z is less than the N, the Z being used to determine an amount of virtual processor resources allocated for the PMD thread.
Optionally, the first parameter includes: the maximum bandwidth of the physical network card and the speed-limiting packet rate, and the second parameters include: the M virtual machines process the total bandwidth and the total packet rate of the message based on the Q PMD threads.
Optionally, the obtaining the Z according to the first parameter and the second parameter includes: obtaining a first initial target number Z1 of the PMD threads according to the total packet rate and the speed-limiting packet rate; obtaining a second initial target number Z2 of the PMD threads according to the total bandwidth and the maximum bandwidth; and obtaining Z according to the first Z1 and the Z2.
Optionally, the obtaining the first initial target number Z1 of PMD threads according to the total packet rate and the speed-limiting packet rate includes: if the total packet rate is smaller than the speed-limiting packet rate, increasing the number of PMD threads until the total packet rate is smaller than the speed-limiting packet rate and the total packet rate is not increased, or the total packet rate is equal to the speed-limiting packet rate, so as to obtain Z1.
Optionally, the obtaining the second initial target number Z2 of PMD threads according to the total bandwidth and the maximum bandwidth includes: and if the total bandwidth is smaller than the maximum bandwidth, increasing the number of PMD threads until the total bandwidth is smaller than the maximum bandwidth and the total bandwidth is not increased, or the total bandwidth is equal to the maximum bandwidth, and obtaining the Z2.
Optionally, the obtaining the Z according to the Z1 and the Z2 includes: and taking the maximum value of the Z1 and the Z2 as the Z.
Optionally, the controlling the virtual testing machine to perform a packet sending pressure test on the host machine at a first rate, to obtain a second parameter of the host machine includes: deploying a virtual test machine; the virtual test machine is controlled to run a server process and the virtual machine on the host machine is controlled to run a message forwarding process, the server process is used for sending a test message to the host machine at a first rate, and the message forwarding process is used for exchanging address information of a sending end and address information of a receiving end in the test message and then returning the test message to the virtual test machine; acquiring packet rate and bandwidth value of each virtual machine; adding the packet rates of the virtual machines to obtain the total packet rate; and adding the bandwidth values of the virtual machines to obtain the total bandwidth.
Optionally, the obtaining the first parameter of the physical network card includes: obtaining the maximum bandwidth of the physical network card; and acquiring the speed-limiting packet rate of the physical network card according to the maximum bandwidth and the minimum message length of the physical network card.
Optionally, if the values of Z and Q are different, a mapping relationship between Z PMD threads and virtual processor resources of the host is obtained according to the Z, where the mapping relationship is used to configure the number of PMD threads of the host.
Optionally, the N allocable virtual processor resources include X virtual processor resources reserved for a virtual machine, and the obtaining, according to the Z, a mapping relationship between the Z PMD threads and the virtual processor resources of the host machine includes:
if Z is smaller than or equal to Y, distributing Z virtual processor resources to Z PMD threads from the Y virtual processor resources to obtain the mapping relation between the Z PMD threads and the virtual processor resources of the host; the Y is a virtual processor resource of the N virtual processor resources except the X virtual processor resources.
If Z is greater than Y and H idle virtual processor resources exist in the X virtual processor resources, distributing the Y virtual processor resources and the H idle virtual processor resources to Z PMD threads to obtain a mapping relation between the Z PMD threads and the virtual processor resources of the host, wherein H is an integer less than or equal to the difference between Z and Y.
In a second aspect, the present application provides a resource allocation device, where the test device is connected to the host, the host is deployed with the M virtual machines, the host has the N virtual processor resources that can be allocated, the host is currently deployed with the Q PMD threads, the PMD threads are used to forward a packet received by a physical network card of the host to the corresponding virtual machine for processing, the one PMD thread occupies one virtual processor resource, both M and Q are integers greater than or equal to 1, and N is an integer greater than or equal to 2, and the resource allocation device is applied to the test device, and includes:
The acquisition module is used for acquiring a first parameter of the physical network card, wherein the first parameter is related to the maximum transmission rate of the physical network card; acquiring a second parameter of the host, wherein the second parameter is related to the total maximum transmission rate of the message processed by the M virtual machines based on the Q PMD threads; the first rate is greater than or equal to a maximum transmission rate of the physical network card.
And the testing module is used for controlling the virtual testing machine to carry out the packet sending pressure test on the host machine at a first speed.
The processing module is used for obtaining the target number Z of the PMD threads according to the first parameter and the second parameter; the Z is less than the N, the Z being used to determine an amount of virtual processor resources allocated for the PMD thread.
In a third aspect, the present application provides a test apparatus comprising: a processor, and a memory communicatively coupled to the processor; the memory stores computer-executable instructions; the processor executes computer-executable instructions stored in the memory to implement the resource allocation method according to any of the first aspects.
In a fourth aspect, the present application provides a computer-readable storage medium having stored therein computer-executable instructions for implementing the resource allocation method according to any of the first aspects when executed by a processor.
According to the resource allocation method, the device, the equipment and the storage medium, the number of PMD threads is dynamically planned by combining the data transmission rate of the host machine physical network card and the total data transmission rate of the virtual machine deployed on the host machine, so that the problems of waste of vCPU resources or lower efficiency of processing messages by the whole virtual machine in the virtual network are avoided.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
Fig. 1 is a schematic view of a virtual network scenario provided in an embodiment of the present application;
FIG. 2 is a schematic diagram of a host architecture according to an embodiment of the present application;
fig. 3 is a schematic flow chart of a resource allocation method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a resource allocation device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a test apparatus according to an embodiment of the present application.
Specific embodiments of the present application have been shown by way of the above drawings and will be described in more detail below. The drawings and the written description are not intended to limit the scope of the inventive concepts in any way, but rather to illustrate the inventive concepts to those skilled in the art by reference to the specific embodiments.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the application. Rather, they are merely examples of apparatus and methods consistent with aspects of the application as detailed in the accompanying claims.
For ease of understanding, a description is first given of one possible virtual network scenario involved in an embodiment of the present application.
Fig. 1 is a schematic diagram of a possible virtual network scenario according to an embodiment of the present application, as shown in fig. 1, a host may be deployed with M virtual machines, where the M virtual machines are used to process data packets.
The host referred to herein may be an electronic device for data processing, and may be a server or a terminal device, for example. In the operating system of the host, the virtual memory is divided into a Kernel Space (Kernel Space) and a User Space (User Space). Core software running at a higher privilege level, independent of the normal application, in kernel space resides on the protected memory space, possessing all the rights to access hardware devices. Code in user space runs at a lower privilege level, only sees the portions of system resources they are allowed to use, and certain specific system functions are not available, nor are kernel space and hardware devices directly accessible, as well as some other specific usage restrictions. The M virtual machines are deployed on the user space of the host machine.
The host adopts Open vSwitch with DPDK technology (data plane development suite (Data Plane Development Kit, DPDK)) to send and receive messages to and from the virtual machine. That is, the host machine invokes a Polling Mode Driver (PMD) thread to directly forward the data message to the virtual machine through the host machine physical network card send path crossing the kernel space. That is, the host machine forwards the data message received on its physical network card to the virtual machine for processing by calling the PMD thread. Further, the host machine forwards the data message received by the network interface controller (network interface controller, NIC) on the host machine physical network card to the virtual network card port of the virtual machine by calling the PMD thread, and the virtual machine receives the data message through the virtual network card port.
The physical network card of the host is used for the host to carry out communication connection and data transmission with the external equipment. The host invokes the PMD thread in the host for connecting the physical network card NIC with the virtual network card port of the virtual machine. The PMD thread is responsible for data transfer functions between the physical network card NIC and the virtual network card port of the virtual machine as a data transfer portal.
The host may be an electronic device using a NUMA architecture processor, and the processor may be divided into a plurality of NUMA nodes according to actual needs. In addition, the host has N virtual processor (vCPU) resources that can be allocated, and the N virtual processor (vCPU) resources are equally allocated to a plurality of NUMA nodes. Illustratively, the host architecture shown in FIG. 2 is taken as an example. As shown in FIG. 2, the host divides the processor into 4 NUMA nodes according to actual needs, 96 virtual processor (vCPU) resources can be allocated on the host, and each NUMA node has 24 vCPU resources.
The host can deploy one or more virtual machines according to actual needs, and each virtual machine can occupy one or more vCPU resources according to needs. In addition, each PMD thread needs to occupy and bind a vCPU resource, and the more the PMD threads, the higher the transmission efficiency of data transmission. For example, according to actual requirements, 5 virtual machines with double cores are required to be deployed, each core of each virtual machine occupies one vCPU resource, and then the 5 virtual machines totally occupy 10 vCPU resources of a host; and setting the number of PMD threads to 20 according to experience, wherein each PMD thread occupies and binds one vCPU resource, and occupies 20 vCPU resources in total. The virtual machines are all deployed in a user space of the host, and the one or more virtual machines are based on the Open vSwitch standard and are used for processing data content in a data message received from the PMD thread.
In the prior art, optimization of the message transceiving capacity of the virtual machine is performed based on Open vSwitch with DPDK technology (data plane development suite (Data Plane Development Kit, DPDK)). Typically after deploying Open vSwitch, the host can empirically allocate a fixed number of PMD threads based on the number of NUMA nodes, i.e., on each NUMA node, a fixed number of PMD threads is empirically allocated on average. The host may also allocate only empirically allocated fixed PMD threads on only one NUMA node. The fixed number of PMD threads are used to transfer data.
However, in this Open vSwitch with DPDK virtual network scenario, the total ability of N virtual machines to send and receive messages is limited by the ability of PMD threads in Open vSwitch to distribute messages. The prior art, which empirically assigns a fixed number of PMD threads, often fails to obtain the maximum virtual network throughput or desired packet rate (Packet Per Second, PPS) of the server hosts. If too many PMD threads are allocated, the waste of vCPU resources is caused, and the vCPU resources for calculation of a virtual machine arranged in a server host are reduced; if the PMD threads are too few, the transmission capacity utilization rate of the host machine physical network card is lower, namely the efficiency of processing the message by the whole virtual machine in the virtual network is lower.
In view of this, the present application proposes a resource allocation method based on Open vSwitch with DPDK technology, which can combine the data transmission rate of the host machine physical network card and the total data transmission rate of the virtual machine deployed on the host machine, dynamically plan the number of PMD threads, and avoid the problem of wasting vCPU resources or having lower efficiency of processing messages by the whole virtual machine in the virtual network.
The embodiment of the application takes a host using a NUMA architecture processor as shown in FIG. 2 as an example. Because the physical network card of the host is directly connected to the NUMA0 node, the working efficiency of the PMD thread configured on the NUMA0 node is higher, and therefore, the following embodiment of the application takes the configuration of the PMD thread on the NUMA0 node as an example.
With continued reference to fig. 1, the method may be performed by a test device with which the host may be communicatively coupled via a wired or wireless network. The test device may be a physical device that is specially deployed, or may be a configuration device for remotely configuring the host machine, or a monitoring device for remotely monitoring the host machine, or the like. The test device may be, for example, an electronic device such as a terminal device, a server, or the like.
The following describes the technical solution of the present application and how the technical solution of the present application solves the above technical problems with reference to a specific embodiment by taking the virtual network scenario shown in fig. 1 as an example. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 3 is a flow chart of a resource allocation method according to an embodiment of the present application, as shown in fig. 3, where the method in this embodiment includes the following steps:
s301, acquiring a first parameter of the physical network card, wherein the first parameter is related to the maximum transmission rate of the physical network card.
For example, the first parameter includes a maximum bandwidth and a speed-limiting packet rate of the physical network card, or the first parameter is a maximum bandwidth of the physical network card, or the first parameter is a speed-limiting packet rate of the physical network card.
Taking the case that the first parameter includes the maximum bandwidth and the speed limiting packet rate of the physical network card as an example, the following manner may be adopted to obtain:
and step A, obtaining the maximum bandwidth of the physical network card. The maximum bandwidth of the physical network card is a bandwidth value corresponding to the actual highest transmission rate of the physical network card, and the bandwidth value can be obtained from the transmission rate of the physical network card of the host machine by the test equipment or can be obtained by the test equipment through the transmission capacity pressure test of the physical network card of the host machine.
And B, acquiring the speed-limiting packet rate of the physical network card. The speed limit packet rate P of the physical network card is the packet data packet transmission rate corresponding to the actual highest transmission rate of the physical network card, which can be obtained by testing the transmission capacity pressure of the host physical network card by the test equipment, or can be obtained by calculating the bandwidth value M corresponding to the maximum bandwidth of the physical network card and the minimum packet length L of the message, as shown in the following formula (1):
P=M*1000*1000/(L+12+8) (1)
before the message is sent, whether the line is idle or not is monitored for a period of time, and the message can be sent only after the line is idle. This listening time is the frame Gap (IPG), which is the time to transmit 12 bytes. In order to be able to accept the synchronization, a Preamble (Preamble) of 8 bytes is added before the ethernet frame structure, wherein 7 bytes are AA (whose binary form is 01010101) for synchronization with the receiving end, and 8 th bytes are AB (frame delimiter) for delimitation, indicating that the ethernet frame follows from now on. Therefore, the actual length of the shortest frame is equal to l+12+8.
For example, if the bandwidth value M corresponding to the maximum bandwidth of the physical network card is 10000Mb/s and the packet length L of the minimum packet is 64 bytes, the speed-limiting packet rate 14880952PPS can be calculated.
S302, controlling a virtual testing machine to carry out packet sending pressure test on a host machine at a first rate, and acquiring a second parameter of the host machine, wherein the second parameter is related to the total maximum transmission rate of messages processed by M virtual machines based on Q PMD threads; the first rate is greater than or equal to a maximum transmission rate of the physical network card.
For example, when the first parameter includes a maximum bandwidth and a speed-limited packet rate of the physical network card, the second parameter may include a total bandwidth and the total packet rate of the M virtual machines for processing the packet based on the Q PMD threads; or when the first parameter is the maximum bandwidth of the physical network card, the second parameter may be the total bandwidth of the message processed by the M virtual machines based on the Q PMD threads; or when the first parameter is the speed limit packet rate of the physical network card, the second parameter may be the total packet rate of the messages processed by the M virtual machines based on the Q PMD threads.
The packet sending capability of the virtual test machine is not lower than the data transmission capability of the host physical network card, namely, the message sending rate of the virtual test machine is greater than or equal to the maximum transmission rate of the host physical network card, so that the virtual test machine can obtain the transmission rate of the physical network card and the transmission rate of the virtual machine when the host physical network card uses the maximum transmission rate to carry out data transmission through pressure test.
The virtual testing machine is controlled to carry out the packet sending pressure test on the host machine at the first speed, and the second parameter of the host machine is obtained, for example, the method can be realized by the following steps:
firstly, a virtual test machine is deployed on the test equipment or on the electronic equipment which can be controlled by the test equipment, and the virtual test machine can be in communication connection with a host machine of the host machine in a wired or wireless network mode and is used for sending test data messages to the host machine.
It should be understood that when the virtual test machine has been deployed in advance, the virtual test machine may also be directly used to perform the packet-issuing pressure test, without further deployment. That is, deploying the virtual test machine is an optional step.
In the following embodiments, the test apparatus is referred to as a test terminal, and the host is referred to as a service terminal.
And secondly, the test equipment can control the virtual test machine to run a server process and control the virtual machine on the host machine to run a message forwarding process, wherein the server process is used for sending a test message to the host machine at a first rate, and the message forwarding process is used for returning the address information of the sending end and the address information of the receiving end in the test message to the virtual test machine after exchanging.
And controlling the virtual test machine to run a server process, so that the test end sends a test message to the host machine at a first rate which is greater than or equal to the speed limit packet rate of the host machine physical network card. The length of the data packet containing the test packet may be the minimum length of the data packet containing the test packet, specifically related to the length of the data packet used when calculating the speed-limiting packet rate of the physical network card, or the speed-limiting packet rate of the physical network card, and the length of the data packet containing the test packet are both determined according to the length of the data packet supported by the host, and in this embodiment, the length of the data packet with the minimum packet is taken as an example.
The test message may carry information such as VLAN of the tenant network, MAC address of the test virtual machine, IP address of the test virtual machine, MAC address of the virtual machine, IP address of the virtual machine, etc. The test message is transmitted to M virtual machines on the host machine through Q PMD threads. After the M virtual machines process the test message, the virtual machine controls the virtual machine on the host machine to run a message forwarding process, and the message forwarding process can enable the host machine of the server to exchange the sending address and the destination address in the received test message, so that the test message can be forwarded back to the virtual machine of the test end from the virtual machine on the host machine of the server through Q PMD threads. The Q described above may be the number of PMD threads currently being used by the host or last time they were run. The initial value may be set for the host at the time of the test, and may be, for example, 1.
The second parameters include: the M virtual machines process the total bandwidth of the message and the total packet rate based on the Q PMD threads as an example, and after the virtual test machine is controlled to carry out the packet sending pressure test on the host machine at the first rate, the packet rate and the bandwidth value of each virtual machine can be obtained. For example, the test device can obtain the data transmission rates of the test messages forwarded by the M virtual machines through the Q PMD threads respectively through the number of the data packets including the test messages sent at the first rate and the number of the data packets including the test messages returned.
The virtual test machine can obtain the bandwidth value and the packet rate of the test message forwarded by the M virtual machines through Q PMD threads respectively through the number of the data packets which are sent out at the first rate and the number of the data packets which are returned and contain the test message, and the packet rate of each virtual machine is added to obtain the total packet rate of the test message forwarded by the M virtual machines through Q PMD threads; and adding the bandwidth values of the virtual machines to obtain the total bandwidth of the M virtual machines for forwarding the test message through the Q PMD threads.
For example, the linear packet rate for each virtual machine is A n The linear packet rate of the first virtual machine is A 1 The linear packet rate of the second virtual machine is A 2 The linear packet rate of the Mth virtual machine is A M The virtual network transmission total packet rate of the host is A, and A=A 1 +A 2 +…+A M . Each virtual machine has a bandwidth value B n The bandwidth value of the first virtual machine is B 1 The bandwidth value of the second virtual machine is B 2 The bandwidth value of the Mth virtual machine is B M The total transmission bandwidth of the virtual network of the host is B, and B=B 1 +B 2 +…+B M 。
It should be noted that the foregoing is merely illustrative of how the second parameter of the host may be obtained by using the packet sending pressure test, and the method is not limited thereto.
S303, obtaining a target number Z of PMD threads according to the first parameter and the second parameter; z is less than N.
An example is described below of how the target number of PMD threads Z can be obtained based on the first and second parameters.
First case: the first parameters of the physical network card include: maximum bandwidth and rate limiting packet rate of the physical network card. The second parameters include: the M virtual machines handle the total bandwidth and total packet rate of the message based on the Q PMD threads.
In this scenario, obtaining the target number Z of PMD threads according to the first parameter and the second parameter may include, for example, the following steps:
s401, obtaining a first initial target number Z1 of PMD threads according to the total packet rate and the speed-limiting packet rate;
through step S302, when the number of the current PMD threads is Q, the packet rate An of each virtual machine is obtained, and the total packet rate a of the M virtual machines for processing the message based on the Q PMD threads is calculated, and the total packet rate a is compared with the speed-limiting packet rate P corresponding to the actual highest transmission rate of the host physical network card.
For example, if the total packet rate is less than P, the number of PMD threads is increased, i.e., the number of PMD threads after the increase is q+1, and correspondingly, the number of virtual processor resources occupied by the PMD threads is q+1. Step S302 is repeated by using the increased PMD quantity until the total packet rate is smaller than the speed-limiting packet rate and the total packet rate is not increased any more, or the total packet rate is equal to P, so as to obtain Z1.
Illustratively, if the total packet rate is equal to P, then Q is taken as Z1.
For example, if the total packet rate is greater than P, then the number of PMD threads is reduced by one, i.e., the reduced number of PMD threads is Q-1, and correspondingly, the number of virtual processor resources used for PMD threads is Q-1. And (S302) cycling the step with the reduced PMD number until the total packet rate is greater than the speed-limiting packet rate and the total packet rate is not reduced, or the total packet rate is equal to P, so as to obtain Z1.
S402, obtaining a second initial target number Z2 of PMD threads according to the total bandwidth and the maximum bandwidth;
through step S302, when the number of the current PMD threads is Q, the bandwidth value Bn of each virtual machine is obtained, and the total bandwidth B of the message processed by the M virtual machines based on the Q PMD threads is calculated, and the total bandwidth B is compared with the maximum bandwidth M corresponding to the actual highest transmission rate of the host physical network card.
For example, if the total bandwidth is smaller than M, the number of PMD threads is increased, i.e., the number of PMD threads after the increase is q+1, and correspondingly, the number of virtual processor resources occupied by the PMD threads is q+1. And (S302) cycling the step (S302) by using the increased PMD quantity until the total bandwidth is smaller than the maximum bandwidth and the total bandwidth is not increased any more, or the total bandwidth value is equal to M, so as to obtain Z2.
Exemplary, if the total bandwidth is equal to M, then Q is taken as Z2
For example, if the total bandwidth is greater than M, then the number of PMD threads is reduced, i.e., the reduced number of PMD threads is Q-1, and correspondingly, the number of virtual processor resources used for PMD threads is Q-1. Step S302 is repeated by using the reduced PMD quantity until the total bandwidth is larger than the maximum bandwidth and the total bandwidth is not increased, or the total bandwidth is equal to M, so as to obtain Z2.
S403, obtaining Z according to the first Z1 and the first Z2.
Alternatively, the maximum value of Z1 and Z2 is taken as Z according to Z1 and Z2 obtained as described above.
Optionally, according to Z1 and Z2 obtained above, the minimum value of Z1 and Z2 is taken as Z.
Optionally, according to Z1 and Z2 obtained above, any integer value between Z1 and Z2 is taken as Z.
Second case: the first parameters of the physical network card include: maximum bandwidth of the physical network card. The second parameters include: the M virtual machines handle the total bandwidth of the message based on the Q PMD threads.
In this scenario, obtaining the target number Z of PMD threads according to the first parameter and the second parameter may include, for example, the following steps:
s501, obtaining a target number Z of PMD threads according to the total bandwidth and the maximum bandwidth;
How to obtain the total bandwidth refers to the foregoing embodiments, and is not described herein.
For example, if the total bandwidth is smaller than M, the number of PMD threads is increased, i.e., the number of PMD threads after the increase is q+1, and correspondingly, the number of virtual processor resources occupied by the PMD threads is q+1. And (S302) cycling the step (S302) by using the increased PMD quantity until the total bandwidth is smaller than the maximum bandwidth and the total bandwidth is not increased any more, or the total bandwidth is equal to M, so as to obtain Z.
Illustratively, if the total bandwidth is equal to M, Q is taken as Z.
For example, if the total bandwidth is greater than M, then the number of PMD threads is reduced, i.e., the reduced number of PMD threads is Q-1, and correspondingly, the number of virtual processor resources used for PMD threads is Q-1. Step S302 is repeated by using the reduced PMD quantity until the total bandwidth is larger than the maximum bandwidth and the total bandwidth is not reduced, or the total bandwidth is equal to M, and Z is obtained.
Third case: the first parameters of the physical network card include: the speed-limiting packet rate of the physical network card. The second parameters include: the M virtual machines process the total packet rate of the message based on the Q PMD threads.
In this scenario, obtaining the target number Z of PMD threads according to the first parameter and the second parameter may include, for example, the following steps:
S601, obtaining the target number Z of PMD threads according to the total packet rate and the speed-limiting packet rate.
How to obtain the total packet rate refers to the foregoing embodiments, and is not described herein.
For example, if the total packet rate is less than P, the number of PMD threads is increased, i.e., the number of PMD threads after the increase is q+1, and correspondingly, the number of virtual processor resources occupied by the PMD threads is q+1. Step S302 is repeated by using the increased PMD quantity until the total packet rate is smaller than the speed-limiting packet rate and the total packet rate is not increased any more, or the total packet rate is equal to P, so as to obtain Z.
Illustratively, if the total packet rate is equal to P, Q is taken as Z.
For example, if the total packet rate is greater than P, then the number of PMD threads is reduced by one, i.e., the reduced number of PMD threads is Q-1, and correspondingly, the number of virtual processor resources used for PMD threads is Q-1. And (S302) cycling the step with the reduced PMD number until the total packet rate is greater than the speed-limiting packet rate and the total packet rate is not reduced, or the total packet rate is equal to P, so as to obtain Z.
The Z values obtained in the manner described above can be used to determine the amount of virtual processor resources allocated for the PMD thread.
Optionally, after the testing device obtains the Z value, the testing device outputs the Z value, and the user may configure the host according to the Z value output by the testing device. The host machine can be configured by manually modifying parameters of the host machine by a user, and the specific configuration method is not limited by the application.
Optionally, after the Z value is obtained by the test device, the test device may directly modify parameters configuring the host, and configure a resource allocation manner of the host.
In this implementation manner, after the step S303, the embodiment of the present application may further include the following:
s304, if the values of Z and Q are different, according to Z, obtaining the mapping relation between Z PMD threads and virtual processor resources of the host machine, wherein the mapping relation is used for configuring the number of PMD threads of the host machine.
On the host machine, the N allocatable virtual processor resources may include X virtual processor resources reserved for the virtual machine and Y virtual processor resources reserved for the PMD thread, where Y is a virtual processor resource other than the X virtual processor resources in the N virtual processor resources. The host may include non-allocatable virtual processor resources, e.g., virtual processor resources reserved for the operating system, in addition to allocatable virtual processor resources.
The different values of Z and Q indicate that the resources allocated for PMD are unreasonable at present, and the problems of waste of vCPU resources or lower efficiency of processing messages by the whole virtual machine in the virtual network exist.
If the X virtual processor resources reserved for the virtual machine and the Y virtual processor resources reserved for the PMD thread are fixed, namely the number of the virtual processor resources which can be occupied by the virtual machine at maximum is X, and the number of the virtual processor resources which can be occupied by the PMD thread at maximum is Y. Then in this implementation:
if Z is less than or equal to Y, then Z virtual processor resources are allocated from the Y virtual processor resources to the Z PMD threads.
If Z is greater than Y, Y virtual processor resources are allocated to Y PMD threads.
If the X virtual processor resources reserved for the virtual machine and the Y virtual processor resources reserved for the PMD thread can be dynamically adjusted according to the usage of another part, then in this implementation manner:
if Z is less than or equal to Y, then Z virtual processor resources are allocated from the Y virtual processor resources to the Z PMD threads.
If Z is greater than Y and there are no free virtual processor resources in the X virtual processor resources, then Y virtual processor resources are allocated to Y PMD threads.
If Z is greater than Y and H idle virtual processor resources exist in the X virtual processor resources, the Y virtual processor resources and the H idle virtual processor resources in the X virtual processor resources are distributed to Z PMD threads. Wherein H is an integer less than or equal to the difference between Z and Y.
It should be noted that, although the above description is exemplified by the PMD thread dynamically occupying the virtual processor resources reserved for the virtual machine. However, it should be understood that when Z is smaller than Y, when the resources of the virtual machine are insufficient, the virtual processor resources reserved for the PMD thread and being idle may also be dynamically occupied, which will not be described in detail.
Optionally, after the step S304, the method may further include the following steps:
the mapping relationship of Z and virtual processor resources allocated to the Z PMD threads is preserved. The mapping relation is that each PMD thread corresponds to one virtual processor one by one, so that the number Z of the PMD threads and the range of Z virtual processors bound with the Z PMD threads are confirmed. When the resources of the host machine are distributed, the virtual processor used for being bound with each PMD thread is determined, and each virtual processor is prevented from being used for more than one purpose, so that the efficiency of processing messages by the whole virtual machine in the virtual network is reduced.
The data transmission rate of the host machine physical network card and the data transmission rate of each virtual machine are obtained, and the data transmission rates of all the virtual machines are summed to obtain the total data transmission rate of all the virtual machines. And the total data transmission rate is compared with the data transmission rate of the host machine physical network card, so that the number of PMD threads is reasonably and dynamically planned, the allocation of vCPU resources is reasonably determined, the PPS (Packet Per Second) and throughput in the virtual network are improved, and the problem of waste of vCPU resources or lower message processing efficiency of the whole virtual machine in the virtual network is avoided.
Fig. 4 is a schematic structural diagram of a resource allocation device according to an embodiment of the present application. The testing device is connected with a host machine, M virtual machines are deployed on the host machine, the host machine is provided with N virtual processor resources which can be allocated, Q PMD threads are currently deployed on the host machine, the PMD threads are used for forwarding a message received by a physical network card of the host machine to the corresponding virtual machine for processing, one PMD thread occupies one virtual processor resource, M and Q are integers which are larger than or equal to 1, and N is an integer which is larger than or equal to 2; the device is applied to test equipment.
As shown in fig. 4, the resource allocation apparatus includes: an acquisition module 11, a test module 12 and a processing module 13.
The obtaining module 11 is configured to obtain a first parameter of the physical network card, where the first parameter is related to a maximum transmission rate of the physical network card. For example, acquiring the bandwidth of a physical network card; and acquiring the speed-limiting packet rate of the physical network card according to the bandwidth of the physical network card and the minimum message length.
The test module 12 is configured to control the virtual test machine to perform a packet sending pressure test on the host machine at a first rate. For example, test module 12 is specifically configured to deploy a virtual test machine. Controlling a virtual test machine to run a server process and controlling a virtual machine on a host machine to run a message forwarding process, and obtaining packet rate and bandwidth values of each virtual machine; adding the packet rates of the virtual machines to obtain a total packet rate; and adding the bandwidth values of the virtual machines to obtain the total bandwidth. The message forwarding process is used for exchanging the address information of the transmitting end and the address information of the receiving end in the test message and then returning the test message to the virtual test machine, and the server process is used for sending the test message to the host machine at a first rate.
The obtaining module 11 is further configured to obtain a second parameter of the host after the testing module 12 controls the virtual testing machine to perform the packet sending pressure test on the host at the first rate. The second parameter is related to the total maximum transmission rate of the message processed by the M virtual machines based on the Q PMD threads; the first rate is greater than or equal to a maximum transmission rate of the physical network card.
And the processing module 13 is configured to obtain, according to the first parameter and the second parameter, a target number Z of PMD threads, where Z is smaller than N, and the Z is used to determine the number of virtual processor resources allocated for the PMD threads.
In one possible implementation, the first parameter includes: the maximum bandwidth and the speed-limiting packet rate of the physical network card, and the second parameters include: the M virtual machines handle the total bandwidth and total packet rate of the message based on the Q PMD threads.
In this implementation manner, the processing module 13 is specifically configured to obtain a first initial target number Z1 of PMD threads according to the total packet rate and the speed-limiting packet rate; obtaining a second initial target number Z2 of PMD threads according to the total bandwidth and the maximum bandwidth; z is obtained from Z1 and Z2.
For example, the processing module 13 is specifically configured to increase the number of PMD threads when the total packet rate is less than the speed-limiting packet rate until the total packet rate is less than the speed-limiting packet rate and the total packet rate is no longer increased, or the total packet rate is equal to the speed-limiting packet rate, to obtain Z1.
For example, the processing module 13 is specifically configured to increase the number of PMD threads when the total bandwidth is smaller than the maximum bandwidth until the total bandwidth is smaller than the maximum bandwidth and the total bandwidth is not increased, or the total bandwidth is equal to the maximum bandwidth, so as to obtain Z2.
For example, the processing module 13 is specifically configured to take the maximum value of Z1 and Z2 as Z.
Optionally, the obtaining module 11 is further configured to obtain, according to Z, a mapping relationship between the Z PMD threads and virtual processor resources of the host when the values of Z and Q are different, where the mapping relationship is used to configure the number of PMD threads of the host.
For example, the processing module 13 is specifically configured to allocate Z virtual processor resources from the Y virtual processor resources to the Z PMD threads when Z is less than or equal to Y. When Z is greater than Y and H idle virtual processor resources exist in the X virtual processor resources, the Y virtual processor resources and the H idle virtual processor resources are distributed to Z PMD threads.
Wherein Y is a virtual processor resource of the N virtual processor resources other than the X virtual processor resources. H is an integer less than or equal to the difference between Z and Y. The mapping relationship of Z and virtual processor resources allocated to the Z PMD threads is preserved.
The resource allocation device provided by the embodiment of the present application may execute the resource allocation method shown in fig. 3 in the above method embodiment, and its implementation principle and technical effects are similar, and are not described herein again. The resource allocation means may be, for example, the aforementioned test device or a chip of the test device, for example, a processor or the like.
Fig. 5 is a schematic structural diagram of a test apparatus according to the present application. The test device may be, for example, the above-mentioned test device for determining allocation of host vCPU resources. As shown in fig. 5, the test apparatus 500 may include: at least one processor 501, memory 502, and a communication interface 503.
A memory 502 for storing a program. In particular, the program may include program code including computer-operating instructions.
The memory 502 may comprise high-speed RAM memory or may further comprise non-volatile memory (non-volatile memory), such as at least one disk memory.
The processor 501 is configured to execute computer-executable instructions stored in the memory 502 to implement the resource allocation method described in the foregoing method embodiment. The processor 501 may be a central processing unit (Central Processing Unit, abbreviated as CPU), or an application specific integrated circuit (Application Specific Integrated Circuit, abbreviated as ASIC), or one or more integrated circuits configured to implement embodiments of the present application.
The processor 501 may perform communication interaction with an external device through the communication interface 503, where the external device may be, for example, a host to which vCPU resources are to be allocated, and in a specific implementation, if the communication interface 503, the memory 502, and the processor 501 are implemented independently, the communication interface 503, the memory 502, and the processor 501 may be connected to each other through buses and complete communication therebetween. The bus may be an industry standard architecture (Industry Standard Architecture, abbreviated ISA) bus, an external device interconnect (Peripheral Component, abbreviated PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated EISA) bus, among others. Buses may be divided into address buses, data buses, control buses, etc., but do not represent only one bus or one type of bus.
Alternatively, in a specific implementation, if the communication interface 503, the memory 502, and the processor 501 are integrated on a chip, the communication interface 503, the memory 502, and the processor 501 may complete communication through internal interfaces.
The present application also provides a computer-readable storage medium, which may include: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk or an optical disk, etc., in which program codes may be stored, and in particular, the computer-readable storage medium stores program instructions for the methods in the above embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the application.
Claims (13)
1. The resource allocation method is characterized in that M virtual machines are deployed on a host, the host has N allocable virtual processor resources, Q PMD threads are currently deployed on the host, the PMD threads are used for forwarding a message received by a physical network card of the host to a corresponding virtual machine for processing, one PMD thread occupies one virtual processor resource, M and Q are integers greater than or equal to 1, and N is an integer greater than or equal to 2, and the method comprises the following steps:
acquiring a first parameter of the physical network card, wherein the first parameter is related to the maximum transmission rate of the physical network card;
controlling a virtual testing machine to carry out packet sending pressure test on the host machine at a first rate, and obtaining a second parameter of the host machine, wherein the second parameter is related to the total maximum transmission rate of messages processed by the M virtual machines based on the Q PMD threads; the first rate is greater than or equal to the maximum transmission rate of the physical network card;
obtaining a target number Z of the PMD threads according to the first parameter and the second parameter; the Z is less than the N, the Z being used to determine an amount of virtual processor resources allocated for the PMD thread.
2. The method of claim 1, wherein the first parameter comprises: the maximum bandwidth and the speed-limiting packet rate of the physical network card, and the second parameters include: the M virtual machines process the total bandwidth and total packet rate of the message based on the Q PMD threads.
3. The method of claim 2, wherein said deriving said Z from said first parameter and said second parameter comprises:
obtaining a first initial target number Z1 of the PMD threads according to the total packet rate and the speed-limiting packet rate;
obtaining a second initial target number Z2 of the PMD threads according to the total bandwidth and the maximum bandwidth;
and obtaining Z according to the first Z1 and the Z2.
4. The method of claim 3, wherein said deriving a first initial target number Z1 of PMD threads from said total packet rate and said rate-limiting packet rate comprises:
if the total packet rate is smaller than the speed-limiting packet rate, increasing the number of PMD threads until the total packet rate is smaller than the speed-limiting packet rate and the total packet rate is not increased, or the total packet rate is equal to the speed-limiting packet rate, so as to obtain Z1.
5. The method of claim 3, wherein the deriving a second initial target number Z2 of PMD threads from the total bandwidth and the maximum bandwidth comprises:
and if the total bandwidth is smaller than the maximum bandwidth, increasing the number of PMD threads until the total bandwidth is smaller than the maximum bandwidth and the total bandwidth is not increased, or the total bandwidth is equal to the maximum bandwidth, and obtaining the Z2.
6. The method according to any one of claims 3-5, wherein said deriving said Z from said Z1 and said Z2 comprises:
and taking the maximum value of the Z1 and the Z2 as the Z.
7. The method of any of claims 2-5, wherein controlling the virtual testing machine to perform a packet-sending pressure test on the host machine at a first rate to obtain the second parameter of the host machine comprises:
deploying a virtual test machine;
the virtual test machine is controlled to run a server process and the virtual machine on the host machine is controlled to run a message forwarding process, the server process is used for sending a test message to the host machine at a first rate, and the message forwarding process is used for exchanging address information of a sending end and address information of a receiving end in the test message and then returning the test message to the virtual test machine;
Acquiring packet rate and bandwidth value of each virtual machine;
adding the packet rates of the virtual machines to obtain the total packet rate;
and adding the bandwidth values of the virtual machines to obtain the total bandwidth.
8. The method according to any one of claims 2-5, wherein the obtaining the first parameter of the physical network card includes:
obtaining the maximum bandwidth of the physical network card;
and acquiring the speed-limiting packet rate of the physical network card according to the maximum bandwidth and the minimum message length of the physical network card.
9. The method according to any one of claims 1-5, further comprising:
and if the Z and the Q are different in value, acquiring the mapping relation between Z PMD threads and the virtual processor resource of the host machine according to the Z, wherein the mapping relation is used for configuring the number of the PMD threads of the host machine.
10. The method of claim 9, wherein the N allocatable virtual processor resources include X virtual processor resources reserved for a virtual machine, and wherein the obtaining, according to the Z, a mapping relationship between the Z PMD threads and the virtual processor resources of the host includes:
If Z is smaller than or equal to Y, distributing Z virtual processor resources to Z PMD threads from the Y virtual processor resources to obtain the mapping relation between the Z PMD threads and the virtual processor resources of the host; the Y is a virtual processor resource except the X virtual processor resources in N virtual processor resources;
if Z is greater than Y and H idle virtual processor resources exist in the X virtual processor resources, distributing the Y virtual processor resources and the H idle virtual processor resources to Z PMD threads to obtain a mapping relation between the Z PMD threads and the virtual processor resources of the host, wherein H is an integer less than or equal to the difference between Z and Y.
11. The utility model provides a resource allocation device, its characterized in that, test equipment is connected with host computer, the host computer is disposed with M virtual machines, the host computer has the N virtual processor resources that can allocate, the host computer is disposed with Q PMD thread at present on, PMD thread is used for with the message that the physical network card of host computer received forward to corresponding virtual machine and handle, a PMD thread occupy a virtual processor resource, M and Q are all greater than or equal to 1's integer, N is greater than or equal to 2's integer, resource allocation device is applied to test equipment, include:
The acquisition module is used for acquiring a first parameter of the physical network card, wherein the first parameter is related to the maximum transmission rate of the physical network card; acquiring a second parameter of the host, wherein the second parameter is related to the total maximum transmission rate of the message processed by the M virtual machines based on the Q PMD threads; the first rate is greater than or equal to the maximum transmission rate of the physical network card;
the testing module is used for controlling the virtual testing machine to carry out package sending pressure test on the host machine at a first speed;
the processing module is used for obtaining the target number Z of the PMD threads according to the first parameter and the second parameter; the Z is less than the N, the Z being used to determine an amount of virtual processor resources allocated for the PMD thread.
12. A test apparatus, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored in the memory to implement the resource allocation method of any one of claims 1 to 10.
13. A computer-readable storage medium, comprising: stored in the computer readable storage medium are computer executable instructions which, when executed by a processor, are adapted to carry out the resource allocation method according to any one of claims 1 to 10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210387958.5A CN116954874A (en) | 2022-04-14 | 2022-04-14 | Resource allocation method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210387958.5A CN116954874A (en) | 2022-04-14 | 2022-04-14 | Resource allocation method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116954874A true CN116954874A (en) | 2023-10-27 |
Family
ID=88447854
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210387958.5A Pending CN116954874A (en) | 2022-04-14 | 2022-04-14 | Resource allocation method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116954874A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117149447A (en) * | 2023-10-31 | 2023-12-01 | 苏州元脑智能科技有限公司 | Bandwidth adjustment method, device, equipment and storage medium |
-
2022
- 2022-04-14 CN CN202210387958.5A patent/CN116954874A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117149447A (en) * | 2023-10-31 | 2023-12-01 | 苏州元脑智能科技有限公司 | Bandwidth adjustment method, device, equipment and storage medium |
CN117149447B (en) * | 2023-10-31 | 2024-02-13 | 苏州元脑智能科技有限公司 | Bandwidth adjustment method, device, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11201783B2 (en) | Analyzing and configuring workload distribution in slice-based networks to optimize network performance | |
CN108270676B (en) | Network data processing method and device based on Intel DPDK | |
US20140108584A1 (en) | Method and Apparatus for Network Resource Virtual Partitioning | |
US8817619B2 (en) | Network system with quality of service management and associated management method | |
WO2014022395A1 (en) | Priority driven channel allocation for packet transferring | |
CN108848038B (en) | Token bucket-based traffic management method and token bucket node | |
US20140036680A1 (en) | Method to Allocate Packet Buffers in a Packet Transferring System | |
CN106571978B (en) | Data packet capturing method and device | |
JP2009524308A (en) | Method and system for dynamic resource allocation | |
CN108768667B (en) | Method for inter-chip network communication of multi-core processor | |
WO2020134153A1 (en) | Distribution method, system and processing device | |
US20200076742A1 (en) | Sending data using a plurality of credit pools at the receivers | |
CN113938435A (en) | Data transmission method, data transmission device, electronic device, storage medium, and program product | |
CN116954874A (en) | Resource allocation method, device, equipment and storage medium | |
CN113825251A (en) | Session establishing method, device, system and computer storage medium | |
US10911366B2 (en) | Technologies for balancing throughput across input ports of a multi-stage network switch | |
DE102018006687A1 (en) | TECHNIQUES FOR SELECTING NON-MINIMUM WAYS AND THREADING THE CONNECTION SPEEDS TO INCREASE THE THROUGHPUT IN A NETWORK | |
CN110932998B (en) | Message processing method and device | |
JP2008181387A (en) | I/o bus system and its management method | |
CN114816651A (en) | Communication method, device and system | |
CN115378885B (en) | Virtual machine service network bandwidth management method and device under super fusion architecture | |
CN112311694A (en) | Priority adjustment method and device | |
CN113824652B (en) | Method and device for scheduling queues | |
CN111245794B (en) | Data transmission method and device | |
JP2014187430A (en) | Communication system, relay device, communication method, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |