Methods, apparatus, devices, and storage media for quality of service control of virtual machines

By employing a token bucket mechanism in the cloud computing platform to perform quality of service control on virtual machine clusters, the problem of distinguishing and managing storage and network resources is solved, achieving efficient resource utilization and quality of service control, and improving the processing efficiency and flexibility of operation requests.

CN119806733BActive Publication Date: 2025-10-31BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411864197.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-10-31
Estimated Expiration
2044-12-17

AI Technical Summary

Technical Problem

In cloud computing platforms, existing technologies struggle to effectively differentiate and control the quality of service (QoS) of storage and network resources, resulting in inefficient resource management and an inability to meet the QoS requirements of different users and applications.

Method used

A token bucket mechanism is used to control the quality of service of the virtual machine cluster. By setting up token buckets and queues at the target layer, tokens are generated according to the service quality limit, and the amount of available tokens is controlled. This ensures that operation requests are only sent to the target layer for processing when there are enough available tokens, thereby achieving independent control over the number of operations per second and bandwidth.

Benefits of technology

It improves the efficiency of virtual machine cluster resource management and the flexibility of service quality control, ensures timely processing of operation requests, avoids network congestion, and makes reasonable use of resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806733B_ABST
    Figure CN119806733B_ABST
Patent Text Reader

Abstract

This disclosure provides a method, apparatus, device, and storage medium for quality of service control of virtual machines, relating to the fields of computer technology, particularly cloud computing, virtualization, and big data. The specific implementation scheme is as follows: when the available token quantity in the target token bucket of the target layer of the virtual machine cluster is insufficient to meet the target token quantity required for an operation request, the operation request is stored in the target queue corresponding to the target layer; wherein, the tokens of the target layer are periodically generated according to the service quality upper limit of the target layer; when the available token quantity in the target token bucket is updated to meet the target token quantity required for the operation request, the target token quantity is deducted from the updated available token quantity; if the target token quantity is successfully deducted, the operation request is sent from the target queue to the target layer for processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to the fields of cloud computing, virtualization, and big data. Background Technology

[0002] Currently, cloud computing has become a widely adopted solution in the industry, providing powerful computing and storage capabilities for enterprises and individuals. Open-source cloud computing platforms use virtualization technology to abstract computing, network, and storage resources into resource pools, thereby providing users with elastic, scalable, and stable cloud infrastructure solutions.

[0003] Device-level QoS (Quality of Service) is a commonly used resource management strategy in cloud platform systems. Its core lies in the allocation and management of physical device resources (disks) to ensure the quality of service for different users and applications. Summary of the Invention

[0004] This disclosure provides a method, apparatus, device, and storage medium for quality of service control of virtual machines.

[0005] According to one aspect of this disclosure, a method for quality of service control of a virtual machine is provided, comprising:

[0006] If the number of available tokens in the target token bucket of the target layer of the virtual machine cluster is insufficient to meet the target token quantity required for an operation request, the operation request will be stored in the target queue corresponding to the target layer; the tokens of the target layer are generated periodically according to the service quality cap of the target layer.

[0007] If the available tokens in the target token bucket are updated to the target tokens required to satisfy the operation request, the target tokens are deducted from the updated available tokens.

[0008] If the target token amount is successfully deducted, the operation request will be sent from the target queue to the target layer for processing.

[0009] According to another aspect of this disclosure, a service quality control device for virtual machines is provided, comprising:

[0010] The first processing module stores the operation request in the target queue corresponding to the target layer when the available tokens in the target token bucket of the target layer of the virtual machine cluster cannot meet the target token quantity required for the operation request; wherein, the tokens of the target layer are generated periodically according to the service quality upper limit of the target layer;

[0011] The second processing module is used to deduct the target token amount from the updated available token amount when the available token amount in the target token bucket is updated to the target token amount required to satisfy the operation request.

[0012] The sending module is used to send the operation request from the target queue to the target layer for processing after successfully deducting the target token amount.

[0013] According to another aspect of this disclosure, an electronic device is provided, comprising:

[0014] At least one processor; and

[0015] The memory is communicatively connected to the at least one processor; wherein,

[0016] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform any of the methods described in the present disclosure.

[0017] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform any of the methods according to embodiments of this disclosure.

[0018] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements any of the methods according to embodiments of this disclosure.

[0019] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0020] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0021] Figure 1 This is a flowchart illustrating a virtual machine service quality control method according to an embodiment of the present disclosure;

[0022] Figure 2 This is an architecture diagram of a virtual machine according to an embodiment of the present disclosure;

[0023] Figure 3 This is a schematic diagram of service quality control according to an embodiment of the present disclosure;

[0024] Figure 4 This is a schematic diagram of the process for generating a target layer token according to an embodiment of the present disclosure;

[0025] Figure 5 This is a schematic diagram of the overall process of a virtual machine service quality control method according to an embodiment of the present disclosure;

[0026] Figure 6This is a schematic diagram of a virtual machine service quality control device according to an embodiment of the present disclosure;

[0027] Figure 7 This is a block diagram of an electronic device used to implement the virtual machine quality of service control method of the present disclosure embodiments. Detailed Implementation

[0028] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0029] The terms “first,” “second,” etc., used in this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion, such as including a series of steps or units. A method, system, product, or apparatus is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or apparatuses.

[0030] In scenarios where multiple user virtual machines run on a large-scale cloud platform system, these virtual machines may simultaneously send a large number of operation requests, all of which require the cloud platform's resources to process. Therefore, it is necessary to implement quality of service (QoS) control for virtual machines to ensure efficiency, stability, and user satisfaction in the cloud computing environment.

[0031] This disclosure proposes a method for quality of service control of virtual machines, such as... Figure 1 The diagram shown illustrates the process of this method, which includes the following:

[0032] S101, if the number of available tokens in the target token bucket of the target layer of the virtual machine cluster is insufficient to meet the target token quantity required for the operation request, the operation request will be stored in the target queue corresponding to the target layer; wherein, the tokens of the target layer are generated periodically according to the service quality upper limit of the target layer.

[0033] The virtual machine cluster can be divided into different layers according to requirements, and each layer can be used as a target layer. For example, if you want to control the quality of service (QoS) of the entire virtual machine cluster, you can use the entire cluster as the target layer. If you want to control the QoS of a portion of the virtual machines, you can use that portion as the target layer.

[0034] During implementation, service quality control is carried out independently at different levels, and the target level of control can be flexibly defined to achieve flexible management and control of service quality at different levels.

[0035] In this embodiment, the target layer employs a token bucket mechanism to control service quality. The target layer can set a corresponding service quality cap. When this cap is exceeded, the number of available tokens in the target token bucket of the target layer will become scarce, and new operation requests will be suspended and placed in the target queue to wait due to insufficient available tokens.

[0036] Understandably, the purpose of periodically generating tokens at the target layer is to rhythmically generate new tokens based on the target layer's service quality cap, so that they can be consumed by subsequent operation requests. As a finite resource, tokens enable control over the service quality of the target layer.

[0037] S102, if the available tokens in the target token bucket are updated to the target tokens required to satisfy the operation request, the target tokens are deducted from the updated available tokens.

[0038] S103, if the target token amount is successfully deducted, the operation request is sent from the target queue to the target layer for processing.

[0039] For example, if the available token quantity in the target layer is A, and the target token quantity required for the operation request is B, and A is less than B, it means that the available token quantity in the target layer of the virtual machine cluster cannot meet the target token quantity required for the operation request. It is necessary to wait for the available token quantity in the target layer to be updated until the required target token quantity is met, at which point the target token quantity is deducted from the updated available token quantity. If the target token quantity is successfully deducted, the operation request is sent from the target queue to the target layer for processing.

[0040] In this embodiment, the generation rate of service quality control tokens at the target layer ensures that the number of available tokens at the target layer is kept within the service quality limit while maximizing the efficiency of operation request transmission. Furthermore, the target queue can store operation requests exceeding the service quality limit of the target layer, ensuring that operation requests are as complete as possible and preventing task loss. When sufficient tokens are available, the operation request is resent to the corresponding target layer for processing, which not only ensures timely processing of operation requests but also avoids network congestion impacting cloud platform performance. Based on the method proposed in this embodiment, service quality control of virtual machines can be implemented, making reasonable use of virtual machine platform resources. Moreover, based on different definitions of the target layer, flexible control of service quality can be achieved, improving the convenience of service quality control.

[0041] Accordingly, in some embodiments, if the available token quantity at the target layer meets the target token quantity required for the operation request, and if the target token quantity is successfully deducted from the available token quantity, the operation request is sent to the target layer for processing.

[0042] During implementation, if the available token quantity of the target layer is A and the target token quantity required for the operation request is C, and A is greater than C, it means that the available token quantity of the target layer of the virtual machine cluster meets the target token quantity required for the operation request. In this case, the target token quantity can be directly deducted from the available token quantity and the operation request can be sent to the target layer for processing.

[0043] In this embodiment of the disclosure, the token bucket mechanism can be used to directly send operation requests to the target layer for execution when there are enough available tokens, thereby improving the overall service quality.

[0044] In related technologies, SPDK (Storage Performance Development Kit) is a mainstream virtualization I / O (Input / Output) acceleration solution. The overall architecture of SPDK, such as... Figure 2 As shown: Qemu-KVM (Qemu-Kernel Virtual Machine) creates Vhost-ctrlr (a simulated disk device) on the virtual machine side. Based on the Hypervisor (software layer), a virtioblk (semi-virtualized disk) type device is injected into the virtual machine. The virtioblk driver implements the front end of the virtual I / O queue. SPDK acts as a proxy layer between the virtual machine and the NVMeSSD (non-volatile memory express Solid State Disk) disk hardware, building a connection between the back end of the virtual I / O queue and the front end of the virtual I / O queue on the upstream virtual machine side, providing a user-level NVMe driver to manage the downstream physical disks. In its specific implementation, SPDK handles requests on the I / O queue and responses from the NVMe disk in a polling manner, reducing the overhead of asynchronous event notifications and interrupt injection. Bdev (Block Device), as a general block storage abstraction layer in SPDK, hides the implementation details of the underlying storage devices and provides a unified interface to the outside world.

[0045] In some embodiments, the operation request includes write operation requests and / or read operation requests for the Bdev of the virtual machine cluster.

[0046] Specifically, a write operation request for Bdev is an operation to write data to Bdev; a read operation request for Bdev is an operation to read data from Bdev.

[0047] In this embodiment of the disclosure, in a virtual machine cluster based on the SPDK architecture, the IO operations of Bdev can be controlled based on the target layer to make reasonable use of Bdev's resources.

[0048] In some embodiments, the target layer includes at least one of the following control layers:

[0049] 1) The whole machine layer includes multiple virtual machines in the virtual machine cluster, which are used to control the overall service quality of multiple virtual machines based on the target token bucket of the whole machine layer.

[0050] In this embodiment of the disclosure, by taking the whole machine layer as the target layer, service quality control can be added at the whole machine level to achieve control over the overall service quality of the virtual machine cluster.

[0051] 2) Virtual machine layer: The virtual machine layer is used to control the quality of service of each virtual machine in multiple virtual machines by using the target token bucket of the virtual machine.

[0052] The virtual machine can be Qemu-KVM, where Qemu is a widely used virtual machine emulator. Once started, Qemu is a user process running on the physical machine, used to simulate various external devices of the virtual machine, such as disks and network cards. KVM is a kernel module that implements virtualization technology, simulating the virtual machine's CPU instructions and memory access. Qemu-KVM work together to provide customers with a complete virtual machine simulation.

[0053] Service quality control at the virtual machine layer allows for individual control of the service quality of each virtual machine. For example, a virtual machine cluster may contain *m* virtual machines. At the virtual machine layer, the service quality of each of these *m* virtual machines can be controlled separately, with each virtual machine having its own target token bucket. The token generation rate within the target token buckets of different virtual machines can be determined based on the service quality cap of each virtual machine. For example, if the service quality cap for virtual machine *m1* is *a*, and the service quality cap for virtual machine *m2* is *b*, then if *a* is greater than *b*, the number of tokens generated per unit time in the target token bucket of virtual machine *m1* will be higher than that of virtual machine *m2*. In this way, different virtual machines are isolated at the virtual machine layer, enabling individual management of their service quality.

[0054] In this embodiment of the disclosure, adding a service quality cap at the virtual machine level allows for individual service quality control for different virtual machines. For example, differentiated resource allocation can be applied to different virtual machines to improve resource management efficiency and flexibility.

[0055] 3) Block device Bdev layer, used to control the service quality of each Bdev in the virtual machine cluster using the target token bucket corresponding to the Bdev.

[0056] In SPDK, block device (Bdev) is a fundamental abstraction used to represent storage devices, such as traditional hard drives, solid-state drives (SSDs), and NVMe SSDs. SPDK represents a virtualization I / O acceleration solution. It acts as a proxy layer between the virtual machine's simulated disk device and the physical machine's disk hardware. It builds a virtual I / O queue backend that connects to the virtual machine's simulated device, providing user-space NVMe drivers to manage the disk device. By handling requests in the I / O queue and responses from the NVMe disk through polling, it can reduce overhead on the virtual machine's I / O path.

[0057] One SPDK can manage multiple Bdevs. Different Bdevs can correspond to their own target token buckets to achieve service quality control for different Bdevs.

[0058] In this embodiment of the disclosure, service quality control for different Bdevs is implemented at the block device (Bdev) layer, thereby enabling flexible service quality control at the block device layer.

[0059] In some embodiments, the service quality ceiling for each virtual machine within the virtual machine layer is determined based on the performance of each virtual machine; similarly, the service quality ceiling for each Bdev within the Bdev layer is determined based on the performance of each Bdev layer.

[0060] The service quality cap can be set as follows: service quality cap for the whole machine layer > service quality cap for the virtual machine layer > service quality cap for the block device (Bdev) layer.

[0061] During implementation, the target layer includes the system layer, virtual machine layer, and block device (Bdev) layer, and all three layers can enable service quality control using the token bucket approach. For example, Figure 3 A concrete example illustrates the upper limit of service quality for the three layers mentioned above. Figure 3In this framework, Level 1 IOPS (Input / Output Per Second) represents the upper limit of operations per second for the entire machine layer, and Level 1 BPS (bits per second) is the upper limit of the bit rate corresponding to the bandwidth, representing the upper limit of the amount of data that the entire machine layer can transmit per unit time. Level 0 IOPS represents the upper limit of operations per second for the virtual machine layer, and Level 0 BPS is the upper limit of the bit rate corresponding to the bandwidth, representing the upper limit of the amount of data that the virtual machine layer can transmit per unit time. Each virtual machine layer can set its own BPS and IOPS based on its actual situation; they can be the same or different. The IOPS and BPS of each Bdev represent the upper limit of operations per second and the upper limit of the amount of data transmitted per unit time for each Bdev.

[0062] In this embodiment of the disclosure, since each layer has its own unique circumstances, a service quality upper limit is set based on its own actual situation so that the service quality of each device is within a reasonable and controllable range, thereby improving the efficiency of service quality control.

[0063] In related technologies, SPDK-based architectures can only achieve service quality control at the Bdev layer, but cannot effectively distinguish between the control of storage resources and network resources. Therefore, in this embodiment, for the target layer, service quality includes at least one of the following service items: operations per second and bandwidth; wherein each service item uses a separate token bucket for service quality control.

[0064] Operations per second (OPD) represents the number of input / output operations per second, which is an important indicator for measuring the performance of storage devices in the target layer. It indicates the number of read and write operations that the storage device can complete per second.

[0065] Bandwidth represents the amount of data that can be transmitted per unit of time, reflecting the capacity of the data transmission channel. The unit of time can be within 1 second.

[0066] This can be understood as each service item using its own token bucket for service quality control.

[0067] For example, for the system layer, virtual machine layer, and Bdev layer, a first token bucket can be used to implement Quality of Service (QoS) control for operations per second (OPS), and a second token bucket can be used to implement QoS control for bandwidth. The QoS control of the first and second token buckets is executed independently. This allows for independent control of bandwidth and storage resources at the target layer. When QoS control is applied to OPS at the target layer, the first token bucket serves as the target token bucket. When QoS control is applied to bandwidth at the target layer, the second token bucket serves as the target token bucket. When QoS control is required for both bandwidth and OPS, both the first and second token buckets serve as target token buckets, determining whether to issue an operation request. If the available tokens in at least one of the first and second token buckets are insufficient to meet the target token quantity required for an operation request, the operation request must be suspended and stored in the target queue, waiting for sufficient tokens before it can be issued.

[0068] Taking the overall system layer as an example, the overall system layer performs quality of service (QoS) control over the entire virtual machine cluster, so it has a first token bucket and a second token bucket. When QoS control is applied to the number of operations per second (OPS) at the overall system layer, the first token bucket is the target token bucket. When QoS control is applied to the bandwidth at the overall system layer, the second token bucket is the target token bucket. When QoS control is required for both bandwidth and OPS, both the first and second token buckets serve as target token buckets, determining whether to issue an operation request. If the available tokens in at least one of the first and second token buckets are insufficient to meet the target token quantity required for an operation request, the operation request must be suspended and stored in the corresponding target queue at the overall system layer, waiting for sufficient tokens before it can be issued.

[0069] Taking a single virtual machine at the virtual machine layer as an example, the quality of service (QoS) of each virtual machine is controlled individually. Each virtual machine has a corresponding first token bucket and a second token bucket. When QoS control is applied to the virtual machine's operations per second (OPS), the virtual machine's first token bucket becomes the target token bucket. When QoS control is applied to the virtual machine's bandwidth, the virtual machine's second token bucket becomes the target token bucket. When both bandwidth and OPS of the virtual machine require QoS control, both the virtual machine's first and second token buckets serve as target token buckets, determining whether to issue an operation request. If the available tokens in at least one of the first and second token buckets are insufficient to meet the target token quantity required for an operation request, the operation request is suspended and stored in the target queue corresponding to that virtual machine, waiting for sufficient tokens before it can be issued.

[0070] Taking a single Bdev in the Bdev layer as an example, the Bdev layer controls the quality of service (QoS) of each Bdev individually. Each Bdev corresponds to a first token bucket and a second token bucket. When QoS control is applied to the operations per second (OPS) of a Bdev, the first token bucket of that Bdev serves as the target token bucket. When QoS control is applied to the bandwidth of that Bdev, the second token bucket of that Bdev serves as the target token bucket. When both bandwidth and OPS of a Bdev require QoS control, both the first and second token buckets of that Bdev serve as target token buckets, determining whether to issue an operation request. If the available token quantity in at least one of the first and second token buckets of that Bdev is insufficient to meet the target token quantity required for an operation request, the operation request needs to be suspended and stored in the target queue of the Bdev layer, waiting for sufficient tokens before it can be issued.

[0071] In this embodiment of the disclosure, the number of operations per second can limit the number of read and write operations that can be completed per second, and the bandwidth can limit the amount of data transmitted. The combination of the two can realize independent control of bandwidth and storage resources, thereby limiting the overall service quality control efficiency of the target layer.

[0072] In some embodiments, where the service item includes operations per second, the target token bucket includes at least one first sub-token bucket, and at least one of the following first sub-control items in the operations per second is controlled individually using the corresponding first sub-token bucket:

[0073] The maximum number of write and read operations per second;

[0074] The maximum number of write operations per second;

[0075] The maximum number of read operations per second.

[0076] The upper limit of the total number of write and read operations per second, the upper limit of write operations per second, and the upper limit of read operations per second can be set based on the actual situation of the target layer itself. This embodiment of the disclosure does not limit this.

[0077] In implementation, for different layers, the first token bucket of the corresponding layer can be divided into first sub-token bucket 1, first sub-token bucket 2, and first sub-token bucket 3. For example, for the whole machine layer, virtual machine layer, and Bdev layer, first sub-token bucket 1 controls the quality of service (QoS) of the number of write operations per second, first sub-token bucket 2 controls the QoS of the number of read operations per second, and first sub-token bucket 3 controls the QoS of the total number of read and write operations per second. Specifically, the QoS control of write and read operations based on first sub-token bucket 1 and first sub-token bucket 2 is executed independently, while the QoS control of the total number of read and write operations is implemented based on first sub-token bucket 3. This allows for independent control of each sub-control item at the target layer.

[0078] When the operation request is a write operation, the first sub-token bucket 1 is the target token bucket. If the total number of read and write operations is controlled, then the first sub-token bucket 3 is also a target token bucket. Similarly, when the operation request is a read operation, the first sub-token bucket 2 is the target token bucket. If the total number of read and write operations is controlled, then the first sub-token bucket 3 is also a target token bucket. When the operation request includes both write and read operations, the first sub-token buckets 1, 2, and 3 are all used as target token buckets. If the available tokens in at least one of the target token buckets are insufficient to meet the target token quantity required for the operation request, the operation request needs to be suspended and stored in the target queue corresponding to the target layer, waiting for sufficient available tokens before it can be issued.

[0079] Taking the overall system layer as an example, the overall system layer controls the service quality of the entire virtual machine cluster. Therefore, the first token bucket contains three sub-token buckets: first sub-token bucket 1, first sub-token bucket 2, and first sub-token bucket 3. When the service quality control is applied to the number of operations per second at the overall system layer, if the operation request is a write operation, first sub-token bucket 1 becomes the target token bucket. If the total number of read and write operations at the overall system layer is controlled, then first sub-token bucket 3 also becomes the target token bucket. Similarly, if the operation request is a read operation, first sub-token bucket 2 becomes the target token bucket; if the total number of read and write operations at the overall system layer is controlled, then first sub-token bucket 3 also becomes the target token bucket. When the operation request includes both write and read operations, first sub-token bucket 1, first sub-token bucket 2, and first sub-token bucket 3 are all used as target token buckets. If the available tokens in at least one of the target token buckets are insufficient to meet the target token quantity required for the operation request, the operation request needs to be suspended and stored in the target queue corresponding to the overall system layer, waiting for sufficient available tokens before it can be issued.

[0080] Taking a single virtual machine at the virtual machine layer as an example, the service quality (SQW) of each virtual machine is controlled individually at the virtual machine layer. Therefore, the first token bucket contains three sub-token buckets: first sub-token bucket 1, first sub-token bucket 2, and first sub-token bucket 3. When SQW is controlled on the number of operations per second at the virtual machine layer, if the operation request is a write operation, first sub-token bucket 1 becomes the target token bucket. If the total number of read and write operations at the virtual machine layer is controlled, then first sub-token bucket 3 also becomes the target token bucket. Similarly, if the operation request is a read operation, first sub-token bucket 2 becomes the target token bucket; if the total number of read and write operations at the virtual machine layer is controlled, then first sub-token bucket 3 also becomes the target token bucket. When the operation request includes both write and read operations, first sub-token bucket 1, first sub-token bucket 2, and first sub-token bucket 3 are all used as target token buckets. If the available tokens in at least one of the target token buckets are insufficient to meet the target token quantity required for the operation request, the operation request needs to be suspended and stored in the corresponding target queue at the virtual machine layer, waiting for sufficient available tokens before it can be issued.

[0081] Taking a single Bdev at the Bdev layer as an example, the Bdev layer controls the quality of service (QoS) of each individual Bdev separately. Therefore, the first token bucket contains three sub-token buckets: first sub-token bucket 1, first sub-token bucket 2, and first sub-token bucket 3. When QoS control is applied to the number of operations per second (PSD) at the Bdev layer, if the operation request is a write operation, first sub-token bucket 1 becomes the target token bucket. If the total number of read and write operations at the Bdev layer is controlled, then first sub-token bucket 3 also becomes the target token bucket. Similarly, if the operation request is a read operation, first sub-token bucket 2 becomes the target token bucket; if the total number of read and write operations at the Bdev layer is controlled, then first sub-token bucket 3 also becomes the target token bucket. When the operation request includes both write and read operations, first sub-token bucket 1, first sub-token bucket 2, and first sub-token bucket 3 are all used as target token buckets. If the available token quantity in at least one of the target token buckets is insufficient to meet the target token quantity required for the operation request, the operation request needs to be suspended and stored in the target queue corresponding to the block device Bdev layer, waiting for sufficient available tokens before it can be issued.

[0082] In this embodiment of the disclosure, the upper limit of read and write operations per second is controlled, which can improve the efficiency of managing the storage performance of the target layer and further improve resource management efficiency.

[0083] In some embodiments, where the service item includes bandwidth, the target token bucket includes at least one second sub-token bucket, and at least one of the following second sub-control items in the bandwidth is controlled individually using the corresponding second sub-token bucket:

[0084] The maximum total bandwidth for write and read operations per second;

[0085] The maximum bandwidth for write operations per second;

[0086] The maximum bandwidth for read operations per second.

[0087] The total bandwidth limit for write and read operations per second, the bandwidth limit for write operations per second, and the bandwidth limit for read operations per second can be set based on the actual situation of the target layer itself, and this disclosure does not limit them.

[0088] In implementation, when using the second token bucket to control bandwidth quality of service (QoS), it can be divided into three sub-token buckets: second sub-token bucket 1, second sub-token bucket 2, and second sub-token bucket 3. For example, at the system layer, virtual machine layer, and Bdev layer, second sub-token bucket 1 controls the QoS of bandwidth for write operations per second, second sub-token bucket 2 controls the QoS of bandwidth for read operations per second, and second sub-token bucket 3 controls the QoS of the total bandwidth for both read and write operations per second. The QoS control of bandwidth based on second sub-token bucket 1 and second sub-token bucket 2 is executed independently. The QoS control of the total read and write bandwidth based on second sub-token bucket 3 allows for independent control of each sub-control item at the target layer.

[0089] When the operation request is a write operation, the second sub-token bucket 1 becomes the target token bucket; if the total bandwidth for read and write operations is controlled, then the second sub-token bucket 3 also becomes the target token bucket. Similarly, when the operation request is a read operation, the second sub-token bucket 2 becomes the target token bucket; if the total bandwidth for read and write operations is controlled, then the second sub-token bucket 3 also becomes the target token bucket. When the operation request includes both write and read operations, the second sub-token buckets 1, 2, and 3 are all used as target token buckets. If the available token quantity in at least one of the target token buckets is insufficient to meet the target token quantity required for the operation request, the operation request needs to be suspended and stored in the target queue corresponding to the target layer, waiting for sufficient available tokens before it can be issued.

[0090] Taking the overall system layer as an example, the overall system layer controls the service quality of the entire virtual machine cluster. Therefore, the second token bucket contains second sub-token bucket 1, second sub-token bucket 2, and second sub-token bucket 3. When the service quality control is applied to the bandwidth per second of the overall system layer, if the operation request is a write operation, second sub-token bucket 1 is the target token bucket. If the total bandwidth of read and write operations of the overall system layer is controlled, then second sub-token bucket 3 is also a target token bucket. Similarly, if the operation request is a read operation, second sub-token bucket 2 is the target token bucket; if the total bandwidth of read and write operations of the overall system layer is controlled, then second sub-token bucket 3 is also a target token bucket. When the operation request includes both write and read operations, second sub-token bucket 1, second sub-token bucket 2, and second sub-token bucket 3 are all used as target token buckets. If the available tokens in at least one of the target token buckets are insufficient to meet the target token quantity required for the operation request, the operation request needs to be suspended and stored in the target queue corresponding to the overall system layer, waiting for sufficient available tokens before it can be issued.

[0091] Taking a single virtual machine at the virtual machine layer as an example, the service quality (SQW) of each virtual machine is controlled individually at the virtual machine layer. Therefore, the second token bucket contains second sub-token bucket 1, second sub-token bucket 2, and second sub-token bucket 3. When SQW control is applied to the bandwidth per second at the virtual machine layer, if the operation request is a write operation, second sub-token bucket 1 becomes the target token bucket. If the total bandwidth for read and write operations at the virtual machine layer is controlled, then second sub-token bucket 3 also becomes the target token bucket. Similarly, if the operation request is a read operation, second sub-token bucket 2 becomes the target token bucket; if the total bandwidth for read and write operations at the virtual machine layer is controlled, then second sub-token bucket 3 also becomes the target token bucket. When the operation request includes both write and read operations, second sub-token bucket 1, second sub-token bucket 2, and second sub-token bucket 3 are all used as target token buckets. If the available tokens in at least one of the target token buckets are insufficient to meet the target token quantity required for the operation request, the operation request needs to be suspended and stored in the corresponding target queue at the virtual machine layer, waiting for sufficient available tokens before it can be issued.

[0092] Taking a single Bdev at the Bdev layer as an example, the Bdev layer controls the quality of service (QoS) of each individual Bdev separately. Therefore, the second token bucket contains second sub-token bucket 1, second sub-token bucket 2, and second sub-token bucket 3. When QoS control is applied to the bandwidth per second of the Bdev layer, if the operation request is a write operation, second sub-token bucket 1 is the target token bucket. If the total bandwidth for read and write operations at the Bdev layer is controlled, then second sub-token bucket 3 is also a target token bucket. Similarly, if the operation request is a read operation, second sub-token bucket 2 is the target token bucket; if the total bandwidth for read and write operations at the Bdev layer is controlled, then second sub-token bucket 3 is also a target token bucket. When the operation request includes both write and read operations, second sub-token bucket 1, second sub-token bucket 2, and second sub-token bucket 3 are all used as target token buckets. If the available tokens in at least one of the target token buckets are insufficient to meet the target token quantity required for the operation request, the operation request needs to be suspended and stored in the corresponding target queue of the Bdev layer, waiting for sufficient available tokens before it can be issued.

[0093] Continuing from the previous point, when the operation request is a write request, and quality of service control is applied to the number of operations per second and bandwidth of the target layer, the first sub-token bucket 1 and the second sub-token bucket 2 are used as target token buckets. If the total number of operations per second and bandwidth of read and write operations at the target layer are controlled, then the first sub-token bucket 3 and the second sub-token bucket 3 are also target token buckets. When the operation request is a read request, and quality of service control is applied to the number of operations per second and bandwidth of the target layer, the first sub-token bucket 2 and the second sub-token bucket 2 are used as target token buckets. If the total number of operations per second and bandwidth of read and write operations at the target layer are controlled, then the first sub-token bucket 3 and the second sub-token bucket 3 are also target token buckets.

[0094] In this embodiment of the disclosure, controlling the upper limit of read and write operations based on bandwidth can effectively manage the network performance of the target layer, thereby further improving resource management efficiency.

[0095] In some embodiments, a token for the target layer is generated, and the specific process is as follows: Figure 4 As shown:

[0096] S401, when the target control item in the service quality of the target layer reaches the rate limit, determine the token update frequency of the target control item based on the rate limit of the target control item.

[0097] S402, based on the token update frequency, generate tokens for target control items in the target layer.

[0098] In practice, if the target control item is a, which is the total bandwidth limit for write and read operations per second, then the number of bytes supported per second is a*1024*1024 bytes. Therefore, the number of bytes generated per ms is (a*1024*1024) / 1000. Assuming that a token supports n bytes, the token update frequency is n / [(a*1024*1024) / 1000]ms, that is, a token is generated every n / [(a*1024*1024) / 1000]ms.

[0099] In practice, if the target control item is a bandwidth limit of b for write operations per second, then the number of bytes generated per second is b*1024*1024 bytes, and the number of bytes generated per ms is (b*1024*1024) / 1000. Assuming that a token supports n bytes, the token update frequency is n / [(b*1024*1024) / 1000]ms, that is, a token is generated once every n / [(b*1024*1024) / 1000]ms.

[0100] In implementation, with the target control item having a bandwidth limit of c for read operations per second, the number of bytes generated per second is c*1024*1024 bytes, and the number of bytes generated per second is (c*1024*1024) / 1000. Assuming a token supports n bytes, the token update frequency is n / [(c*1024*1024) / 1000] ms, meaning a token is generated once every n / [(c*1024*1024) / 1000] ms. Note that b and c are both positive numbers less than a, and n is a positive number.

[0101] In practice, if the target control item is a maximum of d total write and read operations per second, then the number of operations that can be processed per second is d, and the number of operations that can be processed per ms is d / 1000. Assuming that a token supports n operations, the token update frequency is n / (d / 1000)ms, which means that a token is generated once every n / (d / 1000)ms.

[0102] In practice, if the target control item is that the maximum number of write operations per second is e, then the number of write operations that can be processed in 1 second is e, and the number of operations that can be processed in 1 ms is e / 1000. Assuming that a token supports n operations, the token update frequency is n / (e / 1000) ms, that is, a token is generated once every n / (e / 1000) ms.

[0103] In implementation, if the target control term is a maximum of f read operations per second, then the number of read operations that can be processed per second is f, and the number of operations that can be processed per second is f / 1000. Assuming that a token supports n operations, the token update frequency is n / (f / 1000) ms, meaning that a token is generated once every n / (f / 1000) ms. Here, d is greater than e and f, and d, e, and f are all positive numbers.

[0104] In this embodiment of the disclosure, after achieving the rate limit, the target layer token is generated based on the token update frequency, which can effectively control the balance between token updates and consumption, thereby improving the accuracy of quality of service control.

[0105] In some embodiments, in response to an enable operation for service quality control using token bucket on the target layer, the service quality of the target layer is controlled using token bucket; or, in response to a message that service quality control is not performed using token bucket on the target layer, the service quality of the target layer is controlled in the default manner.

[0106] Among these, the service quality of the target layer can be enabled or disabled based on the actual situation.

[0107] The service quality of the target layer is controlled in the default way, that is, a service quality control method other than the token bucket mechanism is used.

[0108] Specifically, at least one of the first and second sub-control items within the service items of the target layer can be enabled or disabled. If the target layer enables quality of service control for write operations per second in the operands per second, then the first sub-token bucket 1 is enabled as the target token bucket. If the target layer enables quality of service control for read operations per second in the operands per second, then the first sub-token bucket 2 is enabled as the target token bucket. And so on, each sub-token bucket can be individually enabled or disabled.

[0109] In this embodiment of the disclosure, the service quality control is performed on whether the token bucket is enabled at the target layer based on the actual situation, making the method more universal.

[0110] When the target layer includes the whole machine layer, virtual machine layer, and block device (Bdev) layer, and all three layers (whether the whole machine layer, virtual machine layer, or Bdev layer) use a token bucket mechanism for quality of service control, the entire process is implemented as follows: Figure 5 As shown, it includes:

[0111] S501, an operation request has been received;

[0112] S502, determine whether the available token quantity at the whole machine layer meets the target token quantity required for the operation request. If not, execute S503; if so, execute S504.

[0113] S503, Stored in the target queue of the whole machine layer, waiting for the update of the available token quantity of the whole machine layer. If the available token quantity of the whole machine layer is updated to the target token quantity required to satisfy the operation request, execute S504.

[0114] S504, if the target token amount is successfully deducted from the available token amount at the whole machine layer, the operation request is sent down to the whole machine layer for processing;

[0115] S505, determine whether the available token quantity at the virtual machine layer meets the target token quantity required for the operation request. If not, execute S506; if so, execute S507.

[0116] S506, Stored in the target queue of the virtual machine layer, waiting for the update of the available token quantity of the virtual machine layer. If the available token quantity of the virtual machine layer is updated to the target token quantity required to satisfy the operation request, execute S507.

[0117] S507: If the target token amount is successfully deducted from the available token amount in the virtual machine layer, the operation request is sent down to the virtual machine layer for processing.

[0118] S508, determine whether the available token quantity at the block device Bdev layer meets the target token quantity required for the operation request. If not, execute S509; if so, execute S510.

[0119] S509, Stored in the target queue of the block device Bdev layer, waiting for the update of the available token quantity of the block device Bdev layer. If the available token quantity of the block device Bdev layer is updated to the target token quantity required to satisfy the operation request, execute S510.

[0120] S510: If the target token amount is successfully deducted from the available token amount in the block device Bdev layer, the operation request is sent to the block device Bdev layer for processing.

[0121] In related technologies, QoS is generally implemented only at the Bdev layer. During implementation, storage performance is uniformly managed and controlled at the Bdev layer to ensure that different applications or services can access storage resources according to predetermined performance requirements. SPDK defines various QoS metrics at the Bdev layer, such as IOPS and BPS. However, in cloud computing platforms, where hundreds of virtual machines share underlying hardware resources, setting QoS only at the Bdev layer may present the following problems:

[0122] 1. Uneven global resource allocation: The QoS of the Bdev layer mainly manages the performance of block devices, but it cannot consider the resource allocation among multiple virtual machines globally. This may lead to some virtual machines excessively consuming resources, while other virtual machines do not receive sufficient performance guarantees.

[0123] 2. Confusing Network and Storage Resources: In cloud computing platforms, network and storage are two core resources. Setting QoS only at the Bdev layer cannot effectively distinguish and manage these two types of resources, which may lead to network congestion affecting storage performance, or storage bottlenecks limiting network efficiency.

[0124] Therefore, in this embodiment, a three-level QoS metric, such as IOPS and BPS, is defined by combining the overall performance of the virtual machine and the individual performance of each virtual machine. This allows for a global consideration of resource allocation among multiple virtual machines. Furthermore, it enables independent control of bandwidth and storage resources, distinguishing and managing these two types of resources, thus ensuring the overall efficiency of service quality control for the cloud computing platform.

[0125] Based on the same technical concept, this disclosure also proposes a virtual machine service quality control device 600, such as... Figure 6 As shown, it includes:

[0126] The first processing module 601 is used to store the operation request in the target queue corresponding to the target layer when the available token quantity in the target token bucket of the target layer of the virtual machine cluster is insufficient to meet the target token quantity required for the operation request; wherein, the tokens of the target layer are generated periodically according to the service quality upper limit of the target layer;

[0127] The second processing module 602 is used to deduct the target token amount from the updated available token amount when the available token amount in the target token bucket is updated to the target token amount required to satisfy the operation request;

[0128] The sending module 603 is used to send the operation request from the target queue to the target layer for processing when the target token amount is successfully deducted.

[0129] In some embodiments, the target layer includes at least one of the following control layers:

[0130] The overall system layer includes multiple virtual machines in the virtual machine cluster, and is used to control the overall service quality of the multiple virtual machines based on the target token bucket of the overall system layer.

[0131] The virtual machine layer is used to control the quality of service of each virtual machine among the plurality of virtual machines using the target token bucket of the virtual machine.

[0132] The block device (Bdev) layer is used to control the quality of service of each Bdev in the virtual machine cluster using the target token bucket corresponding to the Bdev.

[0133] In some embodiments, the service quality cap for each virtual machine within the virtual machine layer is determined based on the performance of each virtual machine.

[0134] The service quality cap for each Bdev within the Bdev layer is determined based on the performance of each Bdev layer.

[0135] In some embodiments, a third processing module is further included, for:

[0136] In response to the activation operation of enabling token bucket-based service quality control for the target layer, the service quality of the target layer is controlled using token bucket; or,

[0137] In response to a message that the target layer does not have a token bucket enabled for quality of service control, the quality of service of the target layer is controlled in the default manner.

[0138] In some embodiments, for the target layer, the quality of service includes at least one of the following service items: operations per second, bandwidth;

[0139] Each service item uses a separate token bucket for service quality control.

[0140] In some embodiments, where the service item includes the number of operations per second, the target token bucket includes at least one first sub-token bucket, and at least one of the following first sub-control items in the number of operations per second is controlled individually using a corresponding first sub-token bucket:

[0141] The maximum number of write and read operations per second;

[0142] The maximum number of write operations per second;

[0143] The maximum number of read operations per second.

[0144] In some embodiments, where the service item includes the bandwidth, the target token bucket includes at least one second sub-token bucket, and at least one of the following second sub-control items in the bandwidth is controlled individually using a corresponding second sub-token bucket:

[0145] The maximum total bandwidth for write and read operations per second;

[0146] The maximum bandwidth for write operations per second;

[0147] The maximum bandwidth for read operations per second.

[0148] In some embodiments, a generation module is further included, configured to:

[0149] When the target control item in the quality of service of the target layer reaches the rate limit, the update frequency of the token of the target control item is determined based on the rate limit of the target control item.

[0150] Based on the token's update frequency, a token for the target control item in the target layer is generated.

[0151] In some embodiments, a fourth processing module is further included, for:

[0152] If the available token quantity at the target layer meets the target token quantity required for the operation request, and the target token quantity is successfully deducted from the available token quantity, the operation request is sent to the target layer for processing.

[0153] In some embodiments, the operation request includes write operation requests and / or read operation requests for the Bdev of the virtual machine cluster.

[0154] The specific functions and examples of each module and submodule of the apparatus in this disclosure can be found in the relevant descriptions of the corresponding steps in the above method embodiments, and will not be repeated here.

[0155] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0156] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0157] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0158] like Figure 7As shown, device 700 includes a computing unit 701, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 702 or a computer program loaded from storage unit 708 into random access memory (RAM) 703. RAM 703 may also store various programs and data required for the operation of device 700. The computing unit 701, ROM 702, and RAM 703 are interconnected via bus 704. Input / output (I / O) interface 705 is also connected to bus 704.

[0159] Multiple components in device 700 are connected to I / O interface 705, including: input unit 706, such as keyboard, mouse, etc.; output unit 707, such as various types of monitors, speakers, etc.; storage unit 708, such as disk, optical disk, etc.; and communication unit 709, such as network card, modem, wireless transceiver, etc. Communication unit 709 allows device 700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0160] The computing unit 701 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as a virtual machine quality of service (QoS) control method. For example, in some embodiments, the QoS control method for a virtual machine can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program can be loaded and / or installed on device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the QoS control method for a virtual machine described above can be performed. Alternatively, in other embodiments, the computing unit 701 can be configured to perform the QoS control method for a virtual machine by any other suitable means (e.g., by means of firmware).

[0161] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0162] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0163] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0164] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0165] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0166] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0167] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0168] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for quality of service control of virtual machines, comprising: If the number of available tokens in the target token bucket of the target layer of the virtual machine cluster is insufficient to meet the target token quantity required for the operation request, the operation request is stored in the target queue corresponding to the target layer. The tokens of the target layer are generated periodically according to the service quality upper limit of the target layer. The virtual machine cluster is divided into different layers according to the requirements, and each layer serves as the target layer. Service quality control is performed independently for each layer. If the available tokens in the target token bucket are updated to the target tokens required to satisfy the operation request, the target tokens are deducted from the updated available tokens. If the target token amount is successfully deducted, the operation request is sent from the target queue to the target layer for processing.

2. The method according to claim 1, wherein, The target layer includes at least one of the following control layers: The overall system layer includes multiple virtual machines in the virtual machine cluster, and is used to control the overall service quality of the multiple virtual machines based on the target token bucket of the overall system layer. The virtual machine layer is used to control the quality of service of each virtual machine among the plurality of virtual machines using the target token bucket of the virtual machine. The block device (Bdev) layer is used to control the quality of service of each Bdev in the virtual machine cluster using the target token bucket corresponding to the Bdev.

3. The method according to claim 2, wherein, The service quality ceiling for each virtual machine within the virtual machine layer is determined based on the performance of each virtual machine. The service quality cap for each Bdev within the Bdev layer is determined based on the performance of each Bdev layer.

4. The method according to claim 2, further comprising: In response to the activation operation of enabling service quality control using the token bucket method for the target layer, the service quality of the target layer is controlled using the token bucket method. or, In response to a message that the target layer does not have a token bucket enabled for quality of service control, the quality of service of the target layer is controlled in the default manner.

5. The method according to claim 1, wherein, for the target layer, the quality of service includes at least one of the following service items: operations per second, bandwidth; in, Each service item uses a separate token bucket for service quality control.

6. The method according to claim 5, wherein, When the service item includes the number of operations per second, the target token bucket includes at least one first sub-token bucket, and at least one of the following first sub-control items in the number of operations per second is controlled individually using the corresponding first sub-token bucket: The maximum number of write and read operations per second; The maximum number of write operations per second; The maximum number of read operations per second.

7. The method according to claim 5, wherein, When the service item includes the bandwidth, the target token bucket includes at least one second sub-token bucket, and at least one of the following second sub-control items in the bandwidth is controlled individually using the corresponding second sub-token bucket: The maximum total bandwidth for write and read operations per second; The maximum bandwidth for write operations per second; The maximum bandwidth for read operations per second.

8. The method according to any one of claims 1-7, wherein, Generating the token for the target layer includes: When the target control item in the quality of service of the target layer reaches the rate limit, the update frequency of the token of the target control item is determined based on the rate limit of the target control item; Based on the token's update frequency, a token for the target control item in the target layer is generated.

9. The method according to any one of claims 1-7, further comprising: If the available token quantity at the target layer meets the target token quantity required for the operation request, and the target token quantity is successfully deducted from the available token quantity, the operation request is sent to the target layer for processing.

10. The method according to claim 1, wherein, The operation requests include write operation requests and / or read operation requests for the Bdev of the virtual machine cluster.

11. A service quality control device for virtual machines, comprising: The first processing module is used to store the operation request in the target queue corresponding to the target layer when the available tokens in the target token bucket of the target layer of the virtual machine cluster cannot meet the target tokens required for the operation request. The tokens of the target layer are generated periodically according to the service quality upper limit of the target layer. The virtual machine cluster is divided into different layers according to the needs, and each layer serves as the target layer. The different layers are independently controlled for service quality. The second processing module is used to deduct the target token amount from the updated available token amount when the available token amount in the target token bucket is updated to the target token amount required to satisfy the operation request. The sending module is used to send the operation request from the target queue to the target layer for processing when the target token amount is successfully deducted.

12. The apparatus according to claim 11, wherein, The target layer includes at least one of the following control layers: The overall system layer includes multiple virtual machines in the virtual machine cluster, and is used to control the overall service quality of the multiple virtual machines based on the target token bucket of the overall system layer. The virtual machine layer is used to control the quality of service of each virtual machine among the plurality of virtual machines using the target token bucket of the virtual machine. The block device (Bdev) layer is used to control the quality of service of each Bdev in the virtual machine cluster using the target token bucket corresponding to the Bdev.

13. The apparatus according to claim 12, wherein, The service quality cap for each virtual machine within the virtual machine layer is determined based on the performance of each virtual machine. The service quality cap for each Bdev within the Bdev layer is determined based on the performance of each Bdev layer.

14. The apparatus of claim 12, further comprising a third processing module, configured to: In response to the activation operation of enabling token bucket-based service quality control for the target layer, the service quality of the target layer is controlled using token bucket; or, In response to a message that the target layer does not have a token bucket enabled for quality of service control, the quality of service of the target layer is controlled in the default manner.

15. The apparatus of claim 11, wherein, for the target layer, the quality of service includes at least one of the following: operations per second, bandwidth; in, Each service item uses a separate token bucket for service quality control.

16. The apparatus according to claim 15, wherein, When the service item includes the number of operations per second, the target token bucket includes at least one first sub-token bucket, and at least one of the following first sub-control items in the number of operations per second is controlled individually using the corresponding first sub-token bucket: The maximum number of write and read operations per second; The maximum number of write operations per second; The maximum number of read operations per second.

17. The apparatus according to claim 15, wherein, When the service item includes the bandwidth, the target token bucket includes at least one second sub-token bucket, and at least one of the following second sub-control items in the bandwidth is controlled individually using the corresponding second sub-token bucket: The maximum total bandwidth for write and read operations per second; The maximum bandwidth for write operations per second; The maximum bandwidth for read operations per second.

18. The apparatus according to any one of claims 11-17, further comprising a generation module for: When the target control item in the quality of service of the target layer reaches the rate limit, the update frequency of the token of the target control item is determined based on the rate limit of the target control item; Based on the token's update frequency, a token for the target control item in the target layer is generated.

19. The apparatus according to any one of claims 11-17, further comprising a fourth processing module for: If the available token quantity at the target layer meets the target token quantity required for the operation request, and the target token quantity is successfully deducted from the available token quantity, the operation request is sent to the target layer for processing.

20. The apparatus according to claim 11, wherein, The operation requests include write operation requests and / or read operation requests for the Bdev of the virtual machine cluster.

21. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method of any one of claims 1-10.

22. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-10.

23. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-10.

Citation Information

Patent Citations

  • Dynamic disk bandwidth allocation method in virtualization environment

    CN102270104A

  • Virtual machine starting method and device, computer readable storage medium and electronic equipment

    CN111090498A