CN111831397A - Method, device, equipment and storage medium for processing IO (input/output) request - Google Patents

Method, device, equipment and storage medium for processing IO (input/output) request Download PDF

Info

Publication number
CN111831397A
CN111831397A CN202010691259.0A CN202010691259A CN111831397A CN 111831397 A CN111831397 A CN 111831397A CN 202010691259 A CN202010691259 A CN 202010691259A CN 111831397 A CN111831397 A CN 111831397A
Authority
CN
China
Prior art keywords
request
target
request queue
queue
read
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.)
Granted
Application number
CN202010691259.0A
Other languages
Chinese (zh)
Other versions
CN111831397B (en
Inventor
李学辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision System Technology Co Ltd
Original Assignee
Hangzhou Hikvision System Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision System Technology Co Ltd filed Critical Hangzhou Hikvision System Technology Co Ltd
Priority to CN202010691259.0A priority Critical patent/CN111831397B/en
Publication of CN111831397A publication Critical patent/CN111831397A/en
Application granted granted Critical
Publication of CN111831397B publication Critical patent/CN111831397B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659Command handling arrangements, e.g. command buffers, queues, command scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45579I/O management, e.g. providing access to device drivers or storage

Abstract

The application discloses a method, a device, equipment and a storage medium for processing an IO request, and belongs to the technical field of computers. The method comprises the following steps: receiving a target IO request sent by a target virtual machine, and acquiring attribute information of a first IO request queue corresponding to a target logical partition; determining whether the first IO request queue meets a first receiving condition for receiving a target IO request; if the first IO request queue meets the first receiving condition, adding the target IO request into the first IO request queue for processing; and if the first IO request queue does not meet the first receiving condition, determining whether the second IO request queue meets the receiving condition for receiving the target IO request or not based on the attribute information of the second IO request queue corresponding to the public logic partition, and if the second IO request queue meets the receiving condition, adding the target IO request into the second IO request queue for processing. The method and the device can reduce the possibility of preempting the storage performance of the storage equipment between the virtual machines.

Description

Method, device, equipment and storage medium for processing IO (input/output) request
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for processing an IO request.
Background
As virtualization technology matures and the processing capacity of a computer gets stronger and stronger, running multiple virtual machines in a server, it is a common technical means to provide corresponding services for users through the virtual machines.
At present, a plurality of virtual machines can be operated in one server through a virtualization technology, and then corresponding service programs are operated in the virtual machines, so that services are provided for users. In the service program, a large number of read and write operations are involved, and in the related art, a technician typically divides a Storage device of a server, such as a Solid State Disk (SSD), into a plurality of NS (namespaces) through a SPDK (Storage Performance Development Kit), and then each virtual machine can mount one or more logical partitions. When a service program in the virtual machine needs to perform read-write operation, a corresponding IO (Input/Output) request can be issued to a corresponding logical partition through an interface in the SPDK to process the IO request, thereby completing the read-write operation.
In the course of implementing the present application, the inventors found that the related art has at least the following problems:
the services that need to be processed may be different in each virtual machine in the server, and the number of IO requests that need to be processed is also different in different services. When the number of IO requests that need to be processed in some virtual machines increases, the number of IO requests that need to be processed in the corresponding logical partition increases, and the storage performance of the storage device may be preempted, thereby affecting the normal processing of IO requests of other virtual machines.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a storage medium for processing an IO request, which can reduce the possibility of preempting the storage performance of storage equipment among virtual machines. The technical scheme is as follows:
in one aspect, a method for processing an IO request is provided, where the method includes:
receiving a target IO request sent by a target virtual machine, wherein the target IO request carries an identifier of a target logical partition corresponding to the target virtual machine;
acquiring attribute information of a first IO request queue corresponding to the target logical partition based on the identifier;
determining whether the first IO request queue meets a first receiving condition for receiving the target IO request or not based on the attribute information of the first IO request queue;
if the first IO request queue meets the first receiving condition, adding the target IO request into the first IO request queue for processing;
and if the first IO request queue does not meet the first receiving condition, determining whether a second IO request queue meets a second receiving condition for receiving the target IO request or not based on attribute information of the second IO request queue corresponding to a public logical partition, and if the second IO request queue meets the second receiving condition, adding the target IO request into the second IO request queue for processing, wherein the public logical partition is a logical partition which is not distributed with a virtual machine currently.
Optionally, the attribute information includes the number of read requests, the number of write requests, the amount of data to be read of the read requests, and the amount of data to be written of the write requests.
Optionally, the determining, based on the attribute information of the first IO request queue, whether the first IO request queue meets a first receiving condition for receiving the target IO request includes:
if the number of the read requests in the first IO request queue is smaller than the first number threshold, the data amount to be read of the read requests in the first IO request queue is smaller than the first data amount threshold, the sum of the number of the read requests and the number of the write requests in the first IO request queue is smaller than the third number threshold, and the sum of the data amount to be read of the read requests and the data amount to be written of the write requests in the first IO request queue is smaller than the third data amount threshold, determining that the first IO request queue meets the condition of receiving the target IO request;
and if the number of the read requests in the first IO request queue is greater than or equal to the second number threshold, or the data volume to be read of the read requests in the first IO request queue is greater than or equal to the first data volume threshold, or the sum of the number of the read requests and the number of the write requests in the first IO request queue is greater than or equal to the third number threshold, or the sum of the data volume to be read of the read requests and the data volume to be written of the write requests in the first IO request queue is greater than or equal to the third data volume threshold, determining that the first IO request queue does not satisfy the condition for receiving the target IO request.
Optionally, the determining, based on the attribute information of the first request queue, whether the first IO request queue meets a condition for receiving the target IO request includes:
if the number of the write requests in the first IO request queue is smaller than the second number threshold, the data quantity to be written of the write requests in the first IO request queue is smaller than the second data quantity threshold, the sum of the numbers of the read requests and the write requests in the first IO request queue is smaller than the third number threshold, and the sum of the data quantity to be read of the read requests and the data quantity to be written of the write requests in the first IO request queue is smaller than the third data quantity threshold, determining that the first IO request queue meets the condition for receiving the target IO request;
and if the number of the write requests in the first IO request queue is greater than or equal to the second number threshold, or the data volume to be written of the write requests in the first IO request queue is greater than or equal to the second data volume threshold, or the sum of the numbers of the read requests and the write requests in the first IO request queue is greater than or equal to the third number threshold, or the sum of the data volume to be read of the read requests and the data volume to be written of the write requests in the first IO request queue is greater than or equal to the third data volume threshold, determining that the first IO request queue does not satisfy the condition for receiving the target IO request.
Optionally, the determining, by the first IO request queue corresponding to the public logical partition, whether the second IO request queue meets a second receiving condition for receiving the target IO request includes:
if the number of the read requests in the second IO request queue is smaller than the fourth number threshold, the data amount to be read of the read requests in the second IO request queue is smaller than the fourth data amount threshold, the sum of the number of the read requests and the number of the write requests in the second IO request queue is smaller than the sixth number threshold, and the sum of the data amount to be read of the read requests and the data amount to be written of the write requests in the second IO request queue is smaller than the sixth data amount threshold, determining that the second IO request queue meets a second receiving condition for receiving the target IO request;
and if the number of the read requests in the second IO request queue is greater than or equal to the fourth number threshold, or the data amount to be read of the read requests in the second IO request queue is greater than or equal to the fourth data amount threshold, or the sum of the number of the read requests and the number of the write requests in the second IO request queue is greater than or equal to the sixth number threshold, or the sum of the data amount to be read of the read requests and the data amount to be written of the write requests in the second IO request queue is greater than or equal to the sixth data amount threshold, determining that the second IO request queue does not satisfy a second receiving condition for receiving the target IO request.
Optionally, the determining, by the method for determining whether the second IO request queue meets a second receiving condition for receiving the target IO request based on attribute information of the second IO request queue corresponding to the public logical partition, where the target IO request is a write request, includes:
if the number of the write requests in the second IO request queue is smaller than the fifth number threshold, the data amount to be written of the write requests in the second IO request queue is smaller than the fifth data amount threshold, the sum of the number of the read requests and the number of the write requests in the second IO request queue is smaller than the sixth number threshold, and the sum of the data amount to be read of the read requests and the data amount to be written of the write requests in the second IO request queue is smaller than the sixth data amount threshold, determining that the second IO request queue meets a second receiving condition for receiving the target IO request;
and if the number of the write requests in the second IO request queue is greater than or equal to the fifth number threshold, or the amount of data to be written of the write requests in the second IO request queue is greater than or equal to the fifth data amount threshold, or the sum of the number of the read requests and the number of the write requests in the second IO request queue is greater than or equal to the sixth number threshold, or the sum of the amount of data to be read of the read requests and the amount of data to be written of the write requests in the second IO request queue is greater than or equal to the sixth data amount threshold, determining that the second IO request queue does not satisfy a second receiving condition for receiving the target IO request.
Optionally, the method further includes:
if the first IO request queue does not meet the first receiving condition and the second IO request queue does not meet the second receiving condition, determining a queue for receiving the target IO request from the first IO request queue and the second IO request queue based on the attribute information of the first IO request queue and the attribute information of the second IO request queue;
and if the first IO request queue is determined to be the queue for receiving the target IO request, adding the target IO request into the first IO request queue for processing, and if the second IO request queue is determined to be the queue for receiving the target IO request, adding the target IO request into the second IO request queue for processing.
Optionally, the determining, based on the attribute information of the first IO request queue and the attribute information of the second IO request queue, a queue to receive the target IO request from among the first IO request queue and the second IO request queue includes:
determining a first time to be processed of the target IO request based on the attribute information of the first IO request queue, determining a second time to be processed of the target IO request based on the attribute information of the second IO request queue, determining the first IO request queue to receive the queue of the target IO request if the first time to be processed is smaller than the second time to be processed, and determining the second IO request queue to receive the queue of the target IO request if the first time to be processed is larger than the second time to be processed.
Optionally, the determining, by the attribute information of the first IO request queue, a first time to be processed of the target IO request, where the target IO request is a write request, includes:
determining a first to-be-processed time length of a target IO request based on the number of write requests in the first IO request queue and a first preset processing speed, determining a second to-be-processed time length of the target IO request based on the to-be-written data amounts of all write requests in the first IO request queue and a second preset processing speed, determining a third to-be-processed time length of the target IO request based on the number of read requests and write requests in the first IO request queue and a third preset processing speed, and determining a fourth to-be-processed time length of the target IO request based on the sum of the to-be-read data amounts of all read requests and the to-be-written data amounts of all write requests in the first IO request queue and a fourth preset processing speed;
determining the longest time length of the first time length to be processed, the second time length to be processed, the third time length to be processed and the fourth time length to be processed as the time length to be processed corresponding to the target IO request, and adding the current system time to the time length to be processed corresponding to the target IO request to obtain the first time length to be processed of the target IO request.
Optionally, the determining, by the attribute information of the first IO request queue, a first time to be processed of the target IO request, where the target IO request is a read request, includes:
determining a fifth to-be-processed time length of a target IO request based on the number of read requests in the first IO request queue and a fifth preset processing speed, determining a sixth to-be-processed time length of the target IO request based on the data amounts to be read of all the read requests in the first IO request queue and the sixth preset processing speed, determining a third to-be-processed time length of the target IO request based on the number of the read requests and the write requests in the first IO request queue and the third preset processing speed, and determining a fourth to-be-processed time length of the target IO request based on the sum of the data amounts to be read of all the read requests and the data amounts to be written of all the write requests in the first IO request queue and the fourth preset processing speed;
determining the longest time length of the third to-be-processed time length, the fourth to-be-processed time length, the fifth to-be-processed time length and the sixth to-be-processed time length as the to-be-processed time length corresponding to the target IO request, and adding the to-be-processed time length corresponding to the target IO request to the current system time to obtain the first to-be-processed time of the target IO request.
Optionally, the determining, by the attribute information of the second IO request queue, a second time to be processed of the target IO request, where the target IO request is a write request, includes:
determining a seventh waiting time of the target IO request based on the number of the write requests in the second IO request queue and a seventh preset processing speed, determining an eighth waiting time of the target IO request based on the data volumes to be written of all the write requests in the second IO request queue and the eighth preset processing speed, determining a ninth waiting time of the target IO request based on the number of the read requests and the write requests in the second IO request queue and the ninth preset processing speed, and determining a tenth waiting time of the target IO request based on the sum of the data volumes to be read of all the read requests and the data volumes to be written of all the write requests in the second IO request queue and the tenth preset processing speed;
determining the longest duration of the seventh to-be-processed duration, the eighth to-be-processed duration, the ninth to-be-processed duration and the tenth to-be-processed duration as the to-be-processed duration corresponding to the target IO request, and adding the to-be-processed duration corresponding to the target IO request to the current system time to obtain a second to-be-processed time of the target IO request.
Optionally, the determining, by the attribute information of the second IO request queue, a second time to be processed of the target IO request, where the target IO request is a read request, includes:
determining eleventh to-be-processed time length of a target IO request based on the number of read requests in the second IO request queue and an eleventh preset processing speed, determining twelfth to-be-processed time length of the target IO request based on the to-be-read data amount and the twelfth preset processing speed of all read requests in the second IO request queue, determining ninth to-be-processed time length of the target IO request based on the number of read requests and write requests in the second IO request queue and a ninth preset processing speed, and determining tenth to-be-processed time length of the target IO request based on the sum of the to-be-read data amount and the to-be-written data amount of all write requests in the second IO request queue and the tenth preset processing speed;
determining the longest duration of the ninth to-be-processed duration, the tenth to-be-processed duration, the eleventh to-be-processed duration and the twelfth to-be-processed duration as the to-be-processed duration corresponding to the target IO request, and adding the to-be-processed duration corresponding to the target IO request to the current system time to obtain a second to-be-processed time of the target IO request.
Optionally, if it is determined that the first IO request queue is a queue that receives the target IO request, adding the target IO request to the first IO request queue for processing, including:
adding the target IO request and the first moment to be processed into the first IO request queue;
when the system time reaches a first time to be processed, processing the target IO request;
if the second IO request queue is determined to be the queue for receiving the target IO request, adding the target IO request into the second IO request queue for processing, including:
adding the target IO request and the second to-be-processed time into the second IO request queue;
and when the system time reaches a second to-be-processed time, processing the target IO request.
Optionally, the determining, by the logical partition, a second to-be-processed time of the target IO request based on the attribute information of the second IO request queue includes:
determining the processing priority of the target logical partition according to the identifier of the target logical partition carried in the target IO request;
determining a target position of the target IO request in the second IO request queue according to the processing priority of the target logical partition;
determining a thirteenth waiting time length of a target IO request based on the number of write requests in the second IO request queue before the target position and a seventh preset processing speed, determining a fourteenth waiting time length of the target IO request based on the data amount to be written of the write requests in the second IO request queue before the target position and an eighth preset processing speed, determining a fifteenth waiting time length of the target IO request based on the number of read requests and write requests in the second IO request queue before the target position and a ninth preset processing speed, and determining a sixteenth waiting time length of the target IO request based on the sum of the data amount to be read of the read requests and the data amount to be written of the write requests in the second IO request queue before the target position and a tenth preset processing speed;
determining the longest duration of the thirteenth to-be-processed duration, the fourteenth to-be-processed duration, the fifteenth to-be-processed duration and the sixteenth to-be-processed duration as the to-be-processed duration corresponding to the target IO request, and adding the to-be-processed duration corresponding to the target IO request to the current system time to obtain a second to-be-processed time of the target IO request.
Optionally, the determining, by the logical partition, a second to-be-processed time of the target IO request based on the attribute information of the second IO request queue includes:
determining the processing priority of the target logical partition according to the identifier of the target logical partition carried in the target IO request;
determining a target position of the target IO request in the second IO request queue according to the processing priority of the target logical partition;
determining a seventeenth waiting time of a target IO request based on the number of read requests and an eleventh preset processing speed in the second IO request queue before the target position, determining an eighteenth waiting time of the target IO request based on the amount of data to be read of the read requests and the twelfth preset processing speed in the second IO request queue before the target position, determining a fifteenth waiting time of the target IO request based on the number of the read requests and the write requests in the second IO request queue before the target position and the ninth preset processing speed, and determining a sixteenth waiting time of the target IO request based on the sum of the amount of data to be read of the read requests and the amount of data to be written of the write requests in the second IO request queue before the target position and the tenth preset processing speed;
determining the longest time length of the seventeenth waiting time length, the eighteenth waiting time length, the nineteenth waiting time length and the twentieth waiting time length as the waiting time length corresponding to the target IO request, and adding the waiting time length corresponding to the target IO request to the current system time to obtain the second waiting time of the target IO request.
Optionally, the determining a target position of the target IO request in the second IO request queue according to the processing priority of the target logical partition includes:
determining a first IO request with a processing priority higher than or equal to that of a target IO request in IO requests of a second IO request queue, determining a first position of the first IO request in the second IO request queue, and determining a position behind the first position in the second IO request queue as the target position.
Optionally, after determining the second IO request queue to receive the queue of the target IO request, the method includes:
adding the target IO request and the second to-be-processed time to a target position of the second IO request queue;
and updating the to-be-processed time corresponding to each IO request after the target position in the second IO request queue.
And when the system time reaches a second to-be-processed time, processing the target IO request.
In another aspect, an apparatus for processing an IO request is provided, the apparatus including:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a target IO request sent by a target virtual machine, and the target IO request carries an identifier of a target logical partition corresponding to the target virtual machine;
the obtaining module is used for obtaining attribute information of a first IO request queue corresponding to the target logical partition based on the identifier;
a determining module, configured to determine, based on attribute information of the first IO request queue, whether the first IO request queue meets a first receiving condition for receiving the target IO request;
the processing module is used for adding the target IO request into the first IO request queue for processing if the first IO request queue meets the first receiving condition;
the determining module is configured to determine whether the second IO request queue satisfies a second receiving condition for receiving the target IO request based on attribute information of the second IO request queue corresponding to a common logical partition if the first IO request queue does not satisfy the first receiving condition;
and the processing module is configured to add the target IO request into the second IO request queue for processing if the second IO request queue meets the second receiving condition, where the common logical partition is a logical partition to which a virtual machine is not currently allocated.
Optionally, the attribute information includes the number of read requests, the number of write requests, the amount of data to be read of the read requests, and the amount of data to be written of the write requests.
Optionally, the target IO request is a read request, and the determining module is configured to:
if the number of the read requests in the first IO request queue is smaller than the first number threshold, the data amount to be read of the read requests in the first IO request queue is smaller than the first data amount threshold, the sum of the number of the read requests and the number of the write requests in the first IO request queue is smaller than the third number threshold, and the sum of the data amount to be read of the read requests and the data amount to be written of the write requests in the first IO request queue is smaller than the third data amount threshold, determining that the first IO request queue meets the condition of receiving the target IO request;
and if the number of the read requests in the first IO request queue is greater than or equal to the second number threshold, or the data volume to be read of the read requests in the first IO request queue is greater than or equal to the first data volume threshold, or the sum of the number of the read requests and the number of the write requests in the first IO request queue is greater than or equal to the third number threshold, or the sum of the data volume to be read of the read requests and the data volume to be written of the write requests in the first IO request queue is greater than or equal to the third data volume threshold, determining that the first IO request queue does not satisfy the condition for receiving the target IO request.
Optionally, the target IO request is a write request, and the determining module is configured to:
if the number of the write requests in the first IO request queue is smaller than the second number threshold, the data quantity to be written of the write requests in the first IO request queue is smaller than the second data quantity threshold, the sum of the numbers of the read requests and the write requests in the first IO request queue is smaller than the third number threshold, and the sum of the data quantity to be read of the read requests and the data quantity to be written of the write requests in the first IO request queue is smaller than the third data quantity threshold, determining that the first IO request queue meets the condition for receiving the target IO request;
and if the number of the write requests in the first IO request queue is greater than or equal to the second number threshold, or the data volume to be written of the write requests in the first IO request queue is greater than or equal to the second data volume threshold, or the sum of the numbers of the read requests and the write requests in the first IO request queue is greater than or equal to the third number threshold, or the sum of the data volume to be read of the read requests and the data volume to be written of the write requests in the first IO request queue is greater than or equal to the third data volume threshold, determining that the first IO request queue does not satisfy the condition for receiving the target IO request.
Optionally, the target IO request is a read request, and the determining module is configured to:
if the number of the read requests in the second IO request queue is smaller than the fourth number threshold, the data amount to be read of the read requests in the second IO request queue is smaller than the fourth data amount threshold, the sum of the number of the read requests and the number of the write requests in the second IO request queue is smaller than the sixth number threshold, and the sum of the data amount to be read of the read requests and the data amount to be written of the write requests in the second IO request queue is smaller than the sixth data amount threshold, determining that the second IO request queue meets a second receiving condition for receiving the target IO request;
and if the number of the read requests in the second IO request queue is greater than or equal to the fourth number threshold, or the data amount to be read of the read requests in the second IO request queue is greater than or equal to the fourth data amount threshold, or the sum of the number of the read requests and the number of the write requests in the second IO request queue is greater than or equal to the sixth number threshold, or the sum of the data amount to be read of the read requests and the data amount to be written of the write requests in the second IO request queue is greater than or equal to the sixth data amount threshold, determining that the second IO request queue does not satisfy a second receiving condition for receiving the target IO request.
Optionally, the target IO request is a write request, and the determining module is configured to:
if the number of the write requests in the second IO request queue is smaller than the fifth number threshold, the data amount to be written of the write requests in the second IO request queue is smaller than the fifth data amount threshold, the sum of the number of the read requests and the number of the write requests in the second IO request queue is smaller than the sixth number threshold, and the sum of the data amount to be read of the read requests and the data amount to be written of the write requests in the second IO request queue is smaller than the sixth data amount threshold, determining that the second IO request queue meets a second receiving condition for receiving the target IO request;
and if the number of the write requests in the second IO request queue is greater than or equal to the fifth number threshold, or the amount of data to be written of the write requests in the second IO request queue is greater than or equal to the fifth data amount threshold, or the sum of the number of the read requests and the number of the write requests in the second IO request queue is greater than or equal to the sixth number threshold, or the sum of the amount of data to be read of the read requests and the amount of data to be written of the write requests in the second IO request queue is greater than or equal to the sixth data amount threshold, determining that the second IO request queue does not satisfy a second receiving condition for receiving the target IO request.
Optionally, the determining module is further configured to:
if the first IO request queue does not meet the first receiving condition and the second IO request queue does not meet the second receiving condition, determining a queue for receiving the target IO request from the first IO request queue and the second IO request queue based on the attribute information of the first IO request queue and the attribute information of the second IO request queue;
and if the first IO request queue is determined to be the queue for receiving the target IO request, adding the target IO request into the first IO request queue for processing, and if the second IO request queue is determined to be the queue for receiving the target IO request, adding the target IO request into the second IO request queue for processing.
Optionally, the determining module is configured to:
determining a first time to be processed of the target IO request based on the attribute information of the first IO request queue, determining a second time to be processed of the target IO request based on the attribute information of the second IO request queue, determining the first IO request queue to receive the queue of the target IO request if the first time to be processed is smaller than the second time to be processed, and determining the second IO request queue to receive the queue of the target IO request if the first time to be processed is larger than the second time to be processed.
Optionally, the target IO request is a write request, and the determining module is configured to:
determining a first to-be-processed time length of a target IO request based on the number of write requests in the first IO request queue and a first preset processing speed, determining a second to-be-processed time length of the target IO request based on the to-be-written data amounts of all write requests in the first IO request queue and a second preset processing speed, determining a third to-be-processed time length of the target IO request based on the number of read requests and write requests in the first IO request queue and a third preset processing speed, and determining a fourth to-be-processed time length of the target IO request based on the sum of the to-be-read data amounts of all read requests and the to-be-written data amounts of all write requests in the first IO request queue and a fourth preset processing speed;
determining the longest time length of the first time length to be processed, the second time length to be processed, the third time length to be processed and the fourth time length to be processed as the time length to be processed corresponding to the target IO request, and adding the current system time to the time length to be processed corresponding to the target IO request to obtain the first time length to be processed of the target IO request.
Optionally, the target IO request is a read request, and the determining module is configured to:
determining a fifth to-be-processed time length of a target IO request based on the number of read requests in the first IO request queue and a fifth preset processing speed, determining a sixth to-be-processed time length of the target IO request based on the data amounts to be read of all the read requests in the first IO request queue and the sixth preset processing speed, determining a third to-be-processed time length of the target IO request based on the number of the read requests and the write requests in the first IO request queue and the third preset processing speed, and determining a fourth to-be-processed time length of the target IO request based on the sum of the data amounts to be read of all the read requests and the data amounts to be written of all the write requests in the first IO request queue and the fourth preset processing speed;
determining the longest time length of the third to-be-processed time length, the fourth to-be-processed time length, the fifth to-be-processed time length and the sixth to-be-processed time length as the to-be-processed time length corresponding to the target IO request, and adding the to-be-processed time length corresponding to the target IO request to the current system time to obtain the first to-be-processed time of the target IO request.
Optionally, the target IO request is a write request, and the determining module is configured to:
determining a seventh waiting time of the target IO request based on the number of the write requests in the second IO request queue and a seventh preset processing speed, determining an eighth waiting time of the target IO request based on the data volumes to be written of all the write requests in the second IO request queue and the eighth preset processing speed, determining a ninth waiting time of the target IO request based on the number of the read requests and the write requests in the second IO request queue and the ninth preset processing speed, and determining a tenth waiting time of the target IO request based on the sum of the data volumes to be read of all the read requests and the data volumes to be written of all the write requests in the second IO request queue and the tenth preset processing speed;
determining the longest duration of the seventh to-be-processed duration, the eighth to-be-processed duration, the ninth to-be-processed duration and the tenth to-be-processed duration as the to-be-processed duration corresponding to the target IO request, and adding the to-be-processed duration corresponding to the target IO request to the current system time to obtain a second to-be-processed time of the target IO request.
Optionally, the target IO request is a read request, and the determining module is configured to:
determining eleventh to-be-processed time length of a target IO request based on the number of read requests in the second IO request queue and an eleventh preset processing speed, determining twelfth to-be-processed time length of the target IO request based on the to-be-read data amount and the twelfth preset processing speed of all read requests in the second IO request queue, determining ninth to-be-processed time length of the target IO request based on the number of read requests and write requests in the second IO request queue and a ninth preset processing speed, and determining tenth to-be-processed time length of the target IO request based on the sum of the to-be-read data amount and the to-be-written data amount of all write requests in the second IO request queue and the tenth preset processing speed;
determining the longest duration of the ninth to-be-processed duration, the tenth to-be-processed duration, the eleventh to-be-processed duration and the twelfth to-be-processed duration as the to-be-processed duration corresponding to the target IO request, and adding the to-be-processed duration corresponding to the target IO request to the current system time to obtain a second to-be-processed time of the target IO request.
Optionally, the processing module is configured to:
adding the target IO request and the first moment to be processed into the first IO request queue;
when the system time reaches a first time to be processed, processing the target IO request;
the processing module is used for:
adding the target IO request and the second to-be-processed time into the second IO request queue;
and when the system time reaches a second to-be-processed time, processing the target IO request.
Optionally, the logical partition corresponds to a processing priority, the target IO request is a write request, and the determining module is configured to:
determining the processing priority of the target logical partition according to the identifier of the target logical partition carried in the target IO request;
determining a target position of the target IO request in the second IO request queue according to the processing priority of the target logical partition;
determining a thirteenth waiting time length of a target IO request based on the number of write requests in the second IO request queue before the target position and a seventh preset processing speed, determining a fourteenth waiting time length of the target IO request based on the data amount to be written of the write requests in the second IO request queue before the target position and an eighth preset processing speed, determining a fifteenth waiting time length of the target IO request based on the number of read requests and write requests in the second IO request queue before the target position and a ninth preset processing speed, and determining a sixteenth waiting time length of the target IO request based on the sum of the data amount to be read of the read requests and the data amount to be written of the write requests in the second IO request queue before the target position and a tenth preset processing speed;
determining the longest duration of the thirteenth to-be-processed duration, the fourteenth to-be-processed duration, the fifteenth to-be-processed duration and the sixteenth to-be-processed duration as the to-be-processed duration corresponding to the target IO request, and adding the to-be-processed duration corresponding to the target IO request to the current system time to obtain a second to-be-processed time of the target IO request.
Optionally, the logical partition corresponds to a processing priority, the target IO request is a read request, and the determining module is configured to:
determining the processing priority of the target logical partition according to the identifier of the target logical partition carried in the target IO request;
determining a target position of the target IO request in the second IO request queue according to the processing priority of the target logical partition;
determining a seventeenth waiting time of a target IO request based on the number of read requests and an eleventh preset processing speed in the second IO request queue before the target position, determining an eighteenth waiting time of the target IO request based on the amount of data to be read of the read requests and the twelfth preset processing speed in the second IO request queue before the target position, determining a fifteenth waiting time of the target IO request based on the number of the read requests and the write requests in the second IO request queue before the target position and the ninth preset processing speed, and determining a sixteenth waiting time of the target IO request based on the sum of the amount of data to be read of the read requests and the amount of data to be written of the write requests in the second IO request queue before the target position and the tenth preset processing speed;
determining the longest time length of the seventeenth waiting time length, the eighteenth waiting time length, the nineteenth waiting time length and the twentieth waiting time length as the waiting time length corresponding to the target IO request, and adding the waiting time length corresponding to the target IO request to the current system time to obtain the second waiting time of the target IO request.
Optionally, the determining module is configured to:
determining a first IO request with a processing priority higher than or equal to that of a target IO request in IO requests of a second IO request queue, determining a first position of the first IO request in the second IO request queue, and determining a position behind the first position in the second IO request queue as the target position.
Optionally, the apparatus further includes an update module, configured to:
adding the target IO request and the second to-be-processed time to a target position of the second IO request queue;
and updating the to-be-processed time corresponding to each IO request after the target position in the second IO request queue.
And when the system time reaches a second to-be-processed time, processing the target IO request.
In yet another aspect, a computer device is provided, and the computer device includes a processor and a memory, where the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the operations performed by the method for processing an IO request as described above.
In still another aspect, a computer-readable storage medium is provided, in which at least one instruction is stored, and the at least one instruction is loaded and executed by a processor to implement the operations performed by the method for processing an IO request as described above.
The technical scheme provided by the embodiment of the application has the following beneficial effects:
by setting the IO processing queue for the logical partition corresponding to each virtual machine and setting the receiving condition of the target IO request for the IO processing queue according to the attribute information of the IO processing queue, if the first IO request queue corresponding to the target IO request does not meet the corresponding receiving condition, the target IO request can be added into the second IO request queue corresponding to the common logical partition to process the target IO request, so that the storage performance of the storage device can be effectively utilized, the IO request sent by the virtual machine to the storage device is limited, and the possibility of the storage performance of each virtual machine to preempt the storage device can be reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application;
fig. 2 is a flowchart of a method for processing an IO request according to an embodiment of the present application;
fig. 3 is a flowchart of a method for processing an IO request according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an apparatus for processing an IO request according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a computer device provided in an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Fig. 1 is a schematic diagram of an implementation environment provided in an embodiment of the present application, where the method for processing an IO request provided in the embodiment of the present application may be implemented by a server or a terminal, where the server or the terminal may be provided with at least one virtual machine, the at least one virtual machine may run in the server or the terminal, and the server may further include a storage device, such as an SSD (solid state Drive), which may provide a data read/write function for the at least one virtual machine.
With the development of scientific technology, the performance of various hardware (such as processors and storage devices) is stronger, and the processing capacity of the server of each enterprise is higher. With the maturity of virtualization technology, an enterprise can set a plurality of virtual machines in its own server, and provide services for users by running the plurality of virtual machines in the server, so that different services can be provided for a plurality of users by one server. For example, a cloud operating system runs a corresponding operating system in a virtual machine provided in a server, so that a user can use the corresponding operating system through a network. A plurality of virtual machines arranged in a server may share a storage device in the server, but different services (programs) run in different virtual machines are different, and the amount of data that the corresponding virtual machine needs to read and write in different time periods may have a large difference, so that the virtual machine running in the server may have a problem of preempting the performance of the storage device in the server. According to the method for processing the IO request, the performance of the corresponding storage device can be allocated to the running virtual machines in the server, so that the problem that the performance of the storage device is seized among the virtual machines can be effectively solved.
Fig. 2 is a flowchart of a method for processing an IO request according to an embodiment of the present application. Referring to fig. 2, the embodiment includes:
step 201, receiving a target IO request sent by a target virtual machine, where the target IO request carries an identifier of a target logical partition corresponding to the target virtual machine.
In implementation, when the virtual machine performs a data read/write operation, an IO request may be sent to the storage device to complete the data read/write operation. For example, the virtual machine may send an IO request to the Storage device through an SPDK (Storage performance development kit). The SPDK is a storage architecture with end-to-end reference, and includes a drive layer, a block device layer, a protocol processing layer, etc. in the SPDK. When an IO request exists in a virtual machine, the virtual machine can send the IO request to a corresponding protocol target (protocol interface) in an SPDK protocol processing layer through a protocol front end according to a protocol type of the IO request to complete corresponding protocol processing, then can issue the IO request to a block device layer, and finally, the block device layer issues the IO request to a storage device to complete corresponding IO processing. In addition, the SPDK may divide a storage device, for example, an SSD in a server running at least one virtual machine, into a plurality of NSs, each virtual machine may be mounted to a first or a plurality of NS, and when a virtual machine sends a target IO request (i.e., any IO request) to the SPDK, the target IO request may carry a corresponding NS identifier, i.e., an identifier of a target logical partition. The IO request may be divided into a read request and a write request, when data running in the virtual machine needs to read data from the storage device, the read request may be sent to the storage device, the read request may carry address information of the data to be read in the storage device, and a data size of the data to be read, when the data running in the virtual machine needs to write data in the storage device, the write request may be sent to the storage device, and the read request may carry the data to be written.
Step 202, obtaining attribute information of a first IO request queue corresponding to the target logical partition based on the identifier.
The attribute information includes the number of read requests, the number of write requests, the amount of data to be read of the read requests, and the amount of data to be written of the write requests.
In implementation, a technician may set a corresponding IO request queue for each logical partition, and after receiving an IO request sent by a virtual machine, a block device layer of the SPDK may enter the corresponding IO request processing queue according to a logical partition identifier carried in the IO request. When the IO request queue receives one IO request, the attribute information of the IO request queue may be updated, that is, the number of read requests, the number of write requests, the amount of data to be read of the read requests, and the amount of data to be written of the write requests in each IO request in the IO request queue are updated.
Technical personnel can determine the number of IO requests to be processed currently and the data volume to be read and written of each virtual machine by setting the IO request queues corresponding to the logic partitions and updating the attribute information of the IO request queues, and then can limit the IO requests of the virtual machines to be issued to the storage device according to the determined number of the IO requests to be processed currently and the determined data volume to be read and written of each virtual machine, so that the storage performance of the storage device is distributed to each virtual machine. Therefore, after receiving the target IO request, the attribute information of the first IO request queue corresponding to the target IO request may be obtained, that is, the number of read requests, the number of write requests, the amount of data to be read of the read requests, and the amount of data to be written of the write requests in the first IO request queue are obtained.
Step 203, determining whether the first IO request queue meets a first receiving condition for receiving the target IO request based on the attribute information of the first IO request queue.
In implementation, after determining the attribute information of the first IO request queue corresponding to the target logical partition, it may be determined whether the first IO request queue satisfies a first receiving condition for receiving the target IO request according to the attribute information of the first IO request queue. The first receiving condition may be set by a technician, for example, the first receiving condition may be a threshold set for attribute information of the first IO request queue, if the first receiving condition is satisfied, it indicates that the number of IO requests currently required to be processed by the virtual machine issuing the target IO request and the corresponding data amount do not occupy too much performance of the storage device, and do not occupy performance of the storage device with other virtual machines, and if the first receiving condition is not satisfied, it indicates that the number of IO requests currently required to be processed by the virtual machine issuing the target IO request or the corresponding data amount may occupy too much performance of the storage device, and may occupy performance of the storage device with other virtual machines.
The performance of the storage device can be measured by IOPS (Input/Output Operations Per Second, number of processing read/write requests Per Second) and BPS (bits Per Second, data transmission amount Per Second). The IOPS also includes a write IOPS (the number of write requests processed per second) and a read IOPS (the number of read requests processed per second), and the BPS also includes a write BPS (the amount of data written per second) and a read BPS (the amount of data read per second). Generally, the IOPS and BPS corresponding to each storage device are stable. Therefore, the performance of the storage device can be allocated to each virtual machine by limiting the number of read requests, the number of write requests, the total number of read requests and write requests (i.e., the number of IO requests) issued to the storage device by the virtual machine in unit time, and the sum of the data amount to be read of the read requests, the data amount to be written of the write requests, the data amount to be read of the read requests and the data amount to be written of the write requests (i.e., the data amount to be read and written corresponding to the IO requests).
Optionally, since the target IO request may be a read request or a write request, the first receiving conditions corresponding to the two requests may be different, and the corresponding processing is as follows:
when the target IO request is a read request, if the number of the read requests in the first IO request queue is smaller than a first number threshold, the data quantity to be read of the read requests in the first IO request queue is smaller than a first data quantity threshold, the sum of the number of the read requests and the number of the write requests in the first IO request queue is smaller than a third number threshold, and the sum of the data quantity to be read of the read requests and the data quantity to be written of the write requests in the first IO request queue is smaller than a third data quantity threshold, determining that the first IO request queue meets the condition of receiving the target IO request; and if the number of the read requests in the first IO request queue is greater than or equal to a first number threshold, or the data amount to be read of the read requests in the first IO request queue is greater than or equal to a first data amount threshold, or the sum of the number of the read requests and the number of the write requests in the first IO request queue is greater than or equal to a third number threshold, or the sum of the data amount to be read of the read requests and the data amount to be written of the write requests in the first IO request queue is greater than or equal to a third data amount threshold, determining that the first IO request queue does not meet the condition for receiving the target IO requests.
In implementation, a technician may set a value corresponding to the attribute information of the IO request queue, so as to limit performance of the virtual machine using the storage device. A technician may preset a first number threshold corresponding to the number of read requests in a queue processed by a target IO corresponding to a target virtual machine, a first data amount threshold corresponding to the amount of data to be read corresponding to all read requests, a third number threshold corresponding to the sum of the numbers of read requests and write requests, and a third data amount threshold corresponding to the sum of the amount of data to be read of the read requests and the amount of data to be written of the write requests. The first receiving condition for receiving the read requests corresponding to the target IO request queue may be that the number of read requests in the first IO request queue is less than a first number threshold, the amount of data to be read of all read requests is less than a first data amount threshold, the sum of the number of read requests and the number of write requests in the first IO request queue is less than a third number threshold, and the sum of the amount of data to be read of the read requests and the amount of data to be written of the write requests in the first IO request queue is less than a third data amount threshold. Therefore, when the received target IO request is a read request, if the queue processed by the first IO satisfies the first receiving condition, the target IO request may be added to the first IO request queue, and if the queue processed by the first IO does not satisfy the first receiving condition, it may be determined that the first IO request queue may not receive the target IO request temporarily.
When the target IO request is a write request, if the number of the write requests in the first IO request queue is smaller than a second number threshold, the data quantity to be written of the write requests in the first IO request queue is smaller than a second data quantity threshold, the sum of the number of the read requests and the number of the write requests in the first IO request queue is smaller than a third number threshold, and the sum of the data quantity to be read of the read requests and the data quantity to be written of the write requests in the first IO request queue is smaller than a third data quantity threshold, determining that the first IO request queue meets the condition of receiving the target IO request; and if the number of the write requests in the first IO request queue is larger than or equal to a second number threshold, or the data volume to be written of the write requests in the first IO request queue is larger than or equal to a second data volume threshold, or the sum of the number of the read requests and the number of the write requests in the first IO request queue is larger than or equal to a third number threshold, or the sum of the data volume to be read of the read requests and the data volume to be written of the write requests in the first IO request queue is larger than or equal to a third data volume threshold, determining that the first IO request queue does not meet the condition for receiving the target IO requests.
In implementation, the technician may further preset a second number threshold corresponding to the number of write requests in the queue processed by the target IO corresponding to the target virtual machine, where all the write requests correspond to a second data amount threshold corresponding to the data amount to be written. The first receiving condition that the target IO request queue receives the write requests may be that the number of write requests in the first IO request queue is less than a second number threshold, and the write-read data amount of all the write requests is less than a second data amount threshold, and the sum of the number of read requests and the number of write requests in the first IO request queue is less than a third number threshold, and the sum of the data amount to be read of the read requests and the data amount to be written of the write requests in the first IO request queue is less than a third data amount threshold. Therefore, when the received target IO request is a write request, if the queue of the first IO processing simultaneously satisfies the first receiving condition, the target IO request may be added to the first IO request queue, and if the queue of the first IO processing does not satisfy the first receiving condition, it is determined that the first IO request queue may not receive the target IO request temporarily.
It should be noted that, if the first IO request queue satisfies the first receiving condition, the following step 204 may be executed, and if the first IO request queue does not satisfy the first receiving condition, the following step 205 may be executed.
And step 204, if the first IO request queue meets the first receiving condition, adding the target IO request into the first IO request queue for processing.
In implementation, if the first IO request queue meets the first receiving condition, the current system time and the target IO request may be correspondingly added to the first IO request queue, the processing time corresponding to the IO request in the IO request processing queue corresponding to each logical partition is polled according to a polling mechanism in the SPDK and according to a fixed polling cycle, and if the processing time corresponding to the IO request is earlier than the current system time, the corresponding IO request may be issued to the storage device, and the corresponding read-write processing is completed.
Step 205, if the first IO request queue does not satisfy the first receiving condition, determining whether the second IO request queue satisfies a second receiving condition for receiving the target IO request based on attribute information of the second IO request queue corresponding to the public logical partition, and if the second IO request queue satisfies the second receiving condition, adding the target IO request into the second IO request queue for processing.
And the public logic partition is a logic partition which is not allocated with a virtual machine currently. A technician may divide the storage in the server into multiple logical partitions through the SPDK and may then assign one or more logical partitions to each virtual machine. Wherein the remaining unallocated logical partitions may be treated as a common logical partition. For example, a technician divides a storage device into 10 logical partitions, logical partition a, logical partition B, and logical partition J, wherein logical partitions a through F are already assigned to corresponding virtual machines, and logical partitions G through J are common logical partitions. A technician may set a receiving condition for the IO request queue corresponding to each logical partition, which is the performance of allocating storage devices for each allocated virtual machine. Correspondingly, the performance of the corresponding storage device may also be allocated to the common logical partition, and the performance of the storage device allocated to the common logical partition may be determined according to the performance of the storage device and the performance that has been allocated to each virtual machine. For example, the IOPS corresponding to the SSD is 100000, the write IOPS is 50000, and the read IOPS is 50000; the BPS is 100MB/s, the write BPS is 50MB/s, and the read BPS is 50 MB/s. Correspondingly, 10000 IOPS can be allocated to each logic partition, 5000 is written in the IOPS, and 5000 is read out from the IOPS; the BPS is 10MB/s, the write BPS is 5MB/s, and the read BPS is 5 MB/s. If 7 logical partitions have been allocated to the virtual machine, the sum of the performances corresponding to the remaining three logical partitions is the performance corresponding to the common logical partition. The receiving conditions of the corresponding IO request queue may then be set according to the performance allocated by each logical partition. It should be noted that the distribution of the SSD performance may be divided equally according to the number of logical partitions, or may be set by a technician according to an actual situation.
Similarly, a corresponding IO request processing queue (i.e., a second IO processing queue) may be set for the common logical partition, and correspondingly, a corresponding second receiving condition may also be set for the second IO request queue. If the first IO request queue does not meet the first receiving condition, it indicates that the virtual machine issuing the target IO request has occupied the performance of the storage device allocated to the virtual machine. It may then be determined whether a second IO request processing queue corresponding to the common logical partition satisfies a second receiving condition for receiving the target IO request. And if the second IO request processing queue is met, adding the target IO request into the second IO request queue for processing. The current system time and the target IO request can be correspondingly added into the second IO request queue, the processing time corresponding to the IO request in the IO request processing queue corresponding to each logical partition is polled according to a polling mechanism in the SPDK and a fixed polling period, and if the processing time corresponding to the IO request is earlier than the current system time, the corresponding IO request can be issued to the storage device, and the corresponding read-write processing is completed.
In implementation, if the first IO request queue does not satisfy the first receiving condition, attribute information of a second IO request queue corresponding to the public logical partition may be acquired, whether the second IO request queue satisfies the second receiving condition for receiving the target IO request is determined according to the attribute information of the second IO request queue corresponding to the public logical partition, and if the second IO request queue does not satisfy the second receiving condition for receiving the target IO request, the target IO request may be added to the second IO request queue for processing.
Optionally, since the target IO request may be a read request or a write request, the second receiving conditions corresponding to the two requests may be different, and the corresponding processing is as follows:
when the target IO request is a read request, if the number of the read requests in the second IO request queue is smaller than a fourth number threshold, the data quantity to be read of the read requests in the second IO request queue is smaller than a fourth data quantity threshold, the sum of the number of the read requests and the number of the write requests in the second IO request queue is smaller than a sixth number threshold, and the sum of the data quantity to be read of the read requests and the data quantity to be written of the write requests in the second IO request queue is smaller than the sixth data quantity threshold, determining that the second IO request queue meets a second receiving condition for receiving the target IO request; and if the number of the read requests in the second IO request queue is greater than or equal to a fourth number threshold, or the data amount to be read of the read requests in the second IO request queue is greater than or equal to a fourth data amount threshold, or the sum of the number of the read requests and the number of the write requests in the second IO request queue is greater than or equal to a sixth number threshold, or the sum of the data amount to be read of the read requests and the data amount to be written of the write requests in the second IO request queue is greater than or equal to a sixth data amount threshold, determining that the second IO request queue does not meet a second receiving condition for receiving the target IO request.
In implementation, a technician may preset a fourth number threshold corresponding to the number of read requests in a queue of the second IO process corresponding to the common logical partition, a fourth data amount threshold corresponding to the amount of data to be read corresponding to all read requests, a sixth number threshold corresponding to the sum of the numbers of read requests and write requests, and a sixth data amount threshold corresponding to the sum of the amount of data to be read of the read requests and the amount of data to be written of the write requests. The first receiving condition of the second IO request queue for receiving the read requests may be that the number of read requests in the second IO request queue is less than a fourth number threshold, and the amount of data to be read of all read requests is less than the fourth data amount threshold, and the sum of the number of read requests and the number of write requests in the first IO request queue is less than a sixth number threshold, and the sum of the amount of data to be read of the read requests and the amount of data to be written of the write requests in the first IO request queue is less than a sixth data amount threshold. Therefore, if the target IO request is a read request, and the corresponding first IO processing queue does not satisfy the first receiving condition, but the second IO processing queue satisfies the second receiving condition, the target IO request may be added to the second IO request queue, and if the second IO processing queue does not satisfy the second receiving condition, it may be determined that the second IO request queue may not receive the target IO request temporarily.
When the target IO request is a write request, if the number of the write requests in the second IO request queue is smaller than a fifth number threshold, the data quantity to be written of the write requests in the second IO request queue is smaller than a fifth data quantity threshold, the sum of the number of the read requests and the number of the write requests in the second IO request queue is smaller than a sixth number threshold, and the sum of the data quantity to be read of the read requests and the data quantity to be written of the write requests in the second IO request queue is smaller than a sixth data quantity threshold, determining that the second IO request queue meets a second receiving condition for receiving the target IO request; and if the number of the write requests in the second IO request queue is greater than or equal to a fifth number threshold, or the data amount to be written of the write requests in the second IO request queue is greater than or equal to a fifth data amount threshold, or the sum of the number of the read requests and the number of the write requests in the second IO request queue is greater than or equal to a sixth number threshold, or the sum of the data amount to be read of the read requests and the data amount to be written of the write requests in the second IO request queue is greater than or equal to a sixth data amount threshold, determining that the second IO request queue does not meet a second receiving condition for receiving the target IO request.
In implementation, a technician may further preset a fifth number threshold corresponding to the number of write requests in a queue of the second IO process corresponding to the common logical partition, where all the write requests correspond to the fifth data amount threshold corresponding to the data amount to be written. The second receiving condition for the second IO request queue to receive the write requests may be that the number of write requests in the second IO request queue is less than a fifth number threshold, and the write-read data amount of all the write requests is less than the fifth data amount threshold, and the sum of the numbers of read requests and write requests in the second IO request queue is less than a sixth number threshold, and the sum of the data amount to be read of the read requests and the data amount to be written of the write requests in the first IO request queue is less than a sixth data amount threshold. Therefore, when the received target IO request is a write request, if the first IO processing queue does not satisfy the first receiving condition but the second IO processing queue satisfies the second receiving condition, the target IO request may be added to the second IO request queue, and if the second IO processing queue does not satisfy the second receiving condition, it is determined that the second IO request queue cannot receive the target IO request temporarily.
In the embodiment of the application, an IO processing queue is set for a logical partition corresponding to each virtual machine, and a receiving condition of a target IO request is set for the IO processing queue according to attribute information of the IO processing queue, and if a first IO request queue corresponding to the target IO request does not meet the corresponding receiving condition, the target IO request can be added into a second IO request queue corresponding to a common logical partition to process the target IO request, so that the storage performance of the storage device can be effectively utilized, the IO request sent by the virtual machine to the storage device is limited, and therefore the possibility that each virtual machine occupies the storage performance of the storage device can be reduced.
Fig. 3 is a flowchart of a method for processing an IO request according to an embodiment of the present application, where the method may be applied to determine an IO request queue for receiving a target IO request again in a first IO request queue and a second IO request queue when a corresponding first IO request queue does not satisfy a first receiving condition and a second IO request queue does not satisfy a second receiving condition after the target IO request is received, and the method includes the following steps:
step 301, determining a queue for receiving a target IO request from a first IO request queue and a second IO request queue based on attribute information of the first IO request queue and attribute information of the second IO request queue;
in implementation, if the first IO request queue does not satisfy the first receiving condition and the second IO request queue does not satisfy the second receiving condition, it is indicated that the number of IO requests corresponding to the current target logical partition and the common logical partition or the amount of data to be processed corresponding to the IO requests is large, and the performance of the storage device allocated by a technician is already occupied, so that the target IO request cannot be processed immediately at present, and the target IO request cannot be processed until the IO request in the first IO request queue or the second IO request queue is processed after part of the IO requests is processed. The waiting time duration required to be processed can be respectively determined through the attribute information of the first IO request queue and the second IO request queue. And then determining the IO request queue with shorter corresponding waiting time as the IO request queue for receiving the target IO request.
Optionally, the determining of the queue receiving the target IO request may determine a first time to be processed of the target IO request based on attribute information of the first IO request queue, determine a second time to be processed of the target IO request based on attribute information of the second IO request queue, determine the queue receiving the target IO request from the first IO request queue if the first time to be processed is less than the second time to be processed, and determine the queue receiving the target IO request from the second IO request queue if the first time to be processed is greater than the second time to be processed.
In implementation, it may be determined that, if the target IO request is added to the first IO request queue, the corresponding first time to be processed, that is, the time expected to be issued to the storage device after the IO request is added to the first IO request queue. The first moment to be processed can be obtained by calculating attribute information of the first IO request queue, that is, the number of current IO requests in the first IO request queue, the data volume to be read and written corresponding to the IO requests, and the preset processing speed. And determining a corresponding second to-be-processed time, namely a time expected to be issued to the storage device after the target IO request is added into the second IO request queue, if the target IO request is added into the second IO request queue. The second to-be-processed time can be obtained by calculating attribute information of the second IO request queue, that is, the number of the current IO requests in the second IO request queue, the data volume to be read and written corresponding to the IO requests, and the preset processing speed. And then determining an IO processing queue corresponding to the processing time which is earlier in time as a queue for receiving the target IO request.
When the IO request is a write request and the IO request is a read request, the corresponding modes of the first time to be processed and the second time to be processed are different, and the corresponding processing is as follows:
when the target IO request is a write request, determining a first to-be-processed time length of the target IO request based on the number of write requests in a first IO request queue and a first preset processing speed, determining a second to-be-processed time length of the target IO request based on the to-be-written data amount of all write requests in the first IO request queue and a second preset processing speed, determining a third to-be-processed time length of the target IO request based on the number of read requests and write requests in the first IO request queue and a third preset processing speed, and determining a fourth to-be-processed time length of the target IO request based on the sum of the to-be-read data amount of all read requests and the to-be-written data amount of all write requests in the first IO request queue and a fourth preset processing speed; determining the longest time length of the first time length to be processed, the second time length to be processed, the third time length to be processed and the fourth time length to be processed as the time length to be processed corresponding to the target IO request, and adding the time length to be processed corresponding to the target IO request to the current system time to obtain the first time to be processed of the target IO request.
The performance of the storage device can be measured by IOPS (Input/Output Operations Per Second, number of processing read and write requests Per Second) and BPS (bits Per Second, data transfer amount Per Second). The IOPS also includes a write IOPS (the number of write requests processed per second) and a read IOPS (the number of read requests processed per second), and the BPS also includes a write BPS (the amount of data written per second) and a read BPS (the amount of data read per second). Therefore, after the technician divides the storage device, such as the SSD, into a plurality of logical units, the technician can set the IOPS, BPS, write IOPS, write BPS, read IOPS, and read BPS corresponding to each logical partition according to the IOPS, BPS, write IOPS, write BPS, read IOPS, and read BPS corresponding to the SSD. The method comprises the steps of calculating the time length for completing the processing of IO requests in an IO request processing queue corresponding to a logical partition, wherein the time length is calculated according to the attribute information of the IO request processing queue corresponding to the logical partition, namely the number of read requests, the number of write requests, the data amount to be read of the read requests, the data amount to be written of the write requests, the IOPS, the write BPS, the read IOPS and the read BPS corresponding to the logical partition.
In an implementation, the first preset processing speed may be a write IOPS corresponding to the target logical partition, the second preset processing speed may be a write BPS corresponding to the target logical partition, and the third preset processing speed may be an IOPS corresponding to the target logical partition. The fourth preset processing speed may be a BPS corresponding to the target logical partition. Therefore, the time length required by the target logical partition to finish processing all the write requests in the first IO request queue corresponding to the processing speed of the write request quantity can be calculated according to the quantity of the write requests in the first IO request queue and the first preset processing speed, and the time length is the first time length to be processed of the target IO request. And calculating the time length required by the target logic partition for completing the processing of all the write requests in the first IO request queue corresponding to the processing speed of the write data volume according to the data volume to be written of all the write requests in the first IO request queue and the second preset processing speed, wherein the time length is the second time length to be processed of the target IO request. And calculating the time length required by the target logic partition for completing the processing of all the read requests and the write requests in the first IO request queue corresponding to the total processing speed of the read requests and the write requests according to the number of the read requests and the write requests in the first IO request queue and a third preset processing speed, wherein the time length is the third waiting time length of the target IO request. And calculating the time length required by the target logic partition to finish processing all the read requests and the write requests in the first IO request queue corresponding to the total processing speed of the data volume to be read and the data volume to be written according to the sum of the data volume to be read of all the read requests and the data volume to be written of all the write requests in the first IO request queue and the fourth preset processing speed, wherein the time length is the fourth time length to be processed of the target IO request. After the first to-be-processed time length, the second to-be-processed time length, the third to-be-processed time length and the fourth to-be-processed time length are obtained, the to-be-processed time length with the longest corresponding time length can be determined as the to-be-processed time length corresponding to the target IO request, and then the corresponding to-be-processed time length is added to the current system time to obtain the first to-be-processed time of the target IO request.
Correspondingly, when the target IO request is a write request, a processing manner for calculating a second to-be-processed time of the target IO request is as follows:
determining a seventh waiting time length of the target IO request based on the number of the write requests in the second IO request queue and a seventh preset processing speed, determining an eighth waiting time length of the target IO request based on the data quantity to be written of all the write requests in the second IO request queue and an eighth preset processing speed, determining a ninth waiting time length of the target IO request based on the number of the read requests and the write requests in the second IO request queue and a ninth preset processing speed, and determining a tenth waiting time length of the target IO request based on the sum of the data quantity to be read of all the read requests and the data quantity to be written of all the write requests in the second IO request queue and a tenth preset processing speed; determining the longest duration of the seventh waiting duration, the eighth waiting duration, the ninth waiting duration and the tenth waiting duration as the waiting duration corresponding to the target IO request, and adding the waiting duration corresponding to the target IO request to the current system time to obtain a second waiting time of the target IO request.
In an implementation, the seventh preset processing speed may be a write IOPS corresponding to the common logical partition, the eighth preset processing speed may be a write BPS corresponding to the common logical partition, and the ninth preset processing speed may be an IOPS corresponding to the common logical partition. The tenth preset processing speed may be a BPS corresponding to the common logical partition. Therefore, the time length required by the public logic partition to finish processing all the write requests in the second IO request queue according to the processing speed corresponding to the number of the write requests can be calculated according to the number of the write requests in the second IO request queue and the seventh preset processing speed, and the time length is the seventh waiting time length of the target IO request. And calculating the time length required by the public logic partition to finish processing all the write requests in the second IO request queue corresponding to the processing speed of the write data volume according to the data volume to be written of all the write requests in the second IO request queue and the eighth preset processing speed, wherein the time length is the eighth time length to be processed of the target IO request. And calculating the time length required by the public logic partition to finish processing all the read requests and the write requests in the second IO request queue corresponding to the total processing speed of the read requests and the write requests according to the number of the read requests and the write requests in the second IO request queue and the ninth preset processing speed, wherein the time length is the ninth waiting time length of the target IO request. And calculating the time length required by the public logic partition to finish processing all the read requests and the write requests in the second IO request queue corresponding to the total processing speed of the data volume to be read and the data volume to be written according to the sum of the data volume to be read of all the read requests and the data volume to be written of all the write requests in the second IO request queue and the tenth preset processing speed, wherein the time length is the tenth waiting time length of the target IO request. After the seventh waiting time, the eighth waiting time, the ninth waiting time, and the tenth waiting time are obtained, the waiting time with the longest corresponding time may be determined as the waiting time corresponding to the target IO request, and then the second waiting time of the target IO request is obtained by adding the corresponding waiting time to the current system time.
When the target IO request is a write request, determining a fifth to-be-processed time length of the target IO request based on the number of read requests in the first IO request queue and a fifth preset processing speed, determining a sixth to-be-processed time length of the target IO request based on the to-be-read data amount and the sixth preset processing speed of all read requests in the first IO request queue, determining a third to-be-processed time length of the target IO request based on the number of read requests and write requests in the first IO request queue and a third preset processing speed, and determining a fourth to-be-processed time length of the target IO request based on the sum of the to-be-read data amount and the to-be-written data amount of all write requests in the first IO request queue and the fourth preset processing speed; determining the longest time length of the third to-be-processed time length, the fourth to-be-processed time length, the fifth to-be-processed time length and the sixth to-be-processed time length as the to-be-processed time length corresponding to the target IO request, and adding the to-be-processed time length corresponding to the target IO request to the current system time to obtain the first to-be-processed time of the target IO request.
In an implementation, the fifth preset processing speed may be a read IOPS corresponding to the target logical partition, the sixth preset processing speed may be a read BPS corresponding to the target logical partition, and the third preset processing speed may be an IOPS corresponding to the target logical partition. The fourth preset processing speed may be a BPS corresponding to the target logical partition.
Therefore, the time length required by the target logical partition to finish processing all the read requests in the first IO request queue corresponding to the processing speed of the number of read requests can be calculated according to the number of read requests in the first IO request queue and the fifth preset processing speed, and the time length is the fifth waiting time length of the target IO request. And calculating the time length required by the target logic partition for completing the processing of all the read requests in the first IO request queue corresponding to the processing speed of the read data volume according to the data volume to be read of all the read requests in the first IO request queue and the sixth preset processing speed, wherein the time length is the sixth time length to be processed of the target IO request. And calculating the time length required by the target logic partition for completing the processing of all the read requests and the write requests in the first IO request queue corresponding to the total processing speed of the read requests and the write requests according to the number of the read requests and the write requests in the first IO request queue and a third preset processing speed, wherein the time length is the third waiting time length of the target IO request. And calculating the time length required by the target logic partition to finish processing all the read requests and the write requests in the first IO request queue corresponding to the total processing speed of the data volume to be read and the data volume to be written according to the sum of the data volume to be read of all the read requests and the data volume to be written of all the write requests in the first IO request queue and the fourth preset processing speed, wherein the time length is the fourth time length to be processed of the target IO request. After the fifth to-be-processed time length, the sixth to-be-processed time length, the third to-be-processed time length and the fourth to-be-processed time length are obtained, the to-be-processed time length with the longest corresponding time length can be determined as the to-be-processed time length corresponding to the target IO request, and then the corresponding to-be-processed time length is added to the current system time to obtain the first to-be-processed time of the target IO request.
Correspondingly, when the target IO request is a read request, the processing manner for calculating the second to-be-processed time of the target IO request is as follows:
determining eleventh to-be-processed time length of the target IO request based on the number of the read requests in the second IO request queue and an eleventh preset processing speed, determining twelfth to-be-processed time length of the target IO request based on the to-be-read data amount and the twelfth preset processing speed of all the read requests in the second IO request queue, determining ninth to-be-processed time length of the target IO request based on the number of the read requests and the write requests in the second IO request queue and a ninth preset processing speed, and determining tenth to-be-processed time length of the target IO request based on the sum of the to-be-read data amount and the to-be-written data amount of all the write requests in the second IO request queue and a tenth preset processing speed; and determining the longest duration of the ninth to-be-processed duration, the tenth to-be-processed duration, the eleventh to-be-processed duration and the twelfth to-be-processed duration as the to-be-processed duration corresponding to the target IO request, and adding the to-be-processed duration corresponding to the target IO request to the current system time to obtain a second to-be-processed moment of the target IO request.
In an implementation, the eleventh preset processing speed may be a read IOPS corresponding to the common logical partition, the twelfth preset processing speed may be a read BPS corresponding to the common logical partition, and the ninth preset processing speed may be an IOPS corresponding to the common logical partition. The tenth preset processing speed may be a BPS corresponding to the common logical partition. Therefore, the time length required by the public logic partition to finish processing all write requests in the second IO request queue corresponding to the processing speed of the number of the requests for the degree can be calculated according to the number of the read requests in the second IO request queue and the eleventh preset processing speed, and the time length is the eleventh waiting time length of the target IO request. And calculating the time length required by the public logic partition for completing the processing of all the read requests in the second IO request queue corresponding to the processing speed of the read data volume according to the data volume to be read of all the read requests in the second IO request queue and the twelfth preset processing speed, wherein the time length is the twelfth time length to be processed of the target IO request. And calculating the time length required by the public logic partition to finish processing all the read requests and the write requests in the second IO request queue corresponding to the total processing speed of the read requests and the write requests according to the number of the read requests and the write requests in the second IO request queue and the ninth preset processing speed, wherein the time length is the ninth waiting time length of the target IO request. And calculating the time length required by the public logic partition to finish processing all the read requests and the write requests in the second IO request queue corresponding to the total processing speed of the data volume to be read and the data volume to be written according to the sum of the data volume to be read of all the read requests and the data volume to be written of all the write requests in the second IO request queue and the tenth preset processing speed, wherein the time length is the tenth waiting time length of the target IO request. After the eleventh to-be-processed time length, the twelfth to-be-processed time length, the ninth to-be-processed time length, and the tenth to-be-processed time length are obtained, the to-be-processed time length with the longest corresponding time length may be determined as the to-be-processed time length corresponding to the target IO request, and then the corresponding to-be-processed time length is added to the current system time to obtain a second to-be-processed time of the target IO request.
Optionally, the logical partition corresponds to a processing priority, that is, a target IO request sent by a virtual machine corresponding to the logical partition may be preferentially processed in a second IO request queue corresponding to the public logical partition, and then a manner of determining a corresponding second to-be-processed time is different from the above;
when the target IO request is a write request, determining a second to-be-processed time of the target IO request based on the attribute information of the second IO request queue as follows: determining the processing priority of the target logical partition according to the identification of the target logical partition carried in the target IO request; determining the target position of the target IO request in the second IO request queue according to the processing priority of the target logical partition; determining a thirteenth waiting time length of the target IO request based on the number of the write requests in front of the target position in the second IO request queue and a seventh preset processing speed, determining a fourteenth waiting time length of the target IO request based on the data volume to be written of the write requests in front of the target position in the second IO request queue and an eighth preset processing speed, determining a fifteenth waiting time length of the target IO request based on the number of the read requests and the write requests in front of the target position in the second IO request queue and the ninth preset processing speed, and determining a sixteenth waiting time length of the target IO request based on the sum of the data volume to be read of the read requests and the data volume to be written of the write requests in front of the target position in the second IO request queue and the tenth preset processing speed; determining the longest time length of the thirteenth waiting time length, the fourteenth waiting time length, the fifteenth waiting time length and the sixteenth waiting time length as the waiting time length corresponding to the target IO request, and adding the waiting time length corresponding to the target IO request with the current system time to obtain a second waiting time of the target IO request.
In implementation, a technician may pre-store a correspondence between the identifier of the logical partition and the priority, and may determine the processing priority of the target logical partition by using the identifier of the target logical partition carried in the target IO request and the correspondence between the identifier of the logical partition and the priority. And then determining the target position of the target IO request in a second IO request queue according to the processing priority of the target logical partition, wherein the priority corresponding to the IO request before the target position in the queue may be greater than or equal to the priority corresponding to the identifier of the logical partition. Therefore, the IO requests with high corresponding priority can be processed first, and the IO requests with low corresponding priority can be processed later. After the target position of the target IO request in the second IO request queue is determined, the thirteenth waiting time corresponding to the target IO request is calculated according to the number of the write requests in the second IO request queue before the target position and the seventh preset processing speed, calculating a fourteenth waiting time corresponding to the target IO request according to the waiting data amount of the write request before the target position in the second IO request queue and the eighth preset processing speed, calculating a fifteenth to-be-processed time length corresponding to the target IO request according to the number of the read requests and the write requests before the target position in the second IO request queue and a ninth preset processing speed, and calculating the sixteenth waiting time of the target IO request according to the sum of the data volume to be read of the read request and the data volume to be written of the write request before the target position in the second IO request queue and the tenth preset processing speed. After the thirteenth to-be-processed time length, the fourteenth to-be-processed time length, the fifteenth to-be-processed time length, and the sixteenth to-be-processed time length are obtained, the longest time length of the time lengths may be determined as the to-be-processed time length corresponding to the target IO request, and then the corresponding to-be-processed time length is added to the current system time to obtain a second to-be-processed time of the target IO request.
When the target IO request is a read request, determining a second to-be-processed time of the target IO request based on the attribute information of the second IO request queue as follows: determining the processing priority of the target logical partition according to the identification of the target logical partition carried in the target IO request; determining the target position of the target IO request in the second IO request queue according to the processing priority of the target logical partition; determining a seventeenth to-be-processed time length of the target IO request based on the number of read requests and an eleventh preset processing speed in front of the target position in the second IO request queue, determining an eighteenth to-be-processed time length of the target IO request based on the to-be-read data amount and a twelfth preset processing speed of the read requests and the twelfth preset processing speed in front of the target position in the second IO request queue, determining a fifteenth to-be-processed time length of the target IO request based on the number of the read requests and the write requests and the ninth preset processing speed in front of the target position in the second IO request queue, and determining a sixteenth to-be-processed time length of the target IO request based on the sum of the to-be-read data amount and the write data amount of the read requests and the tenth preset processing speed in front of the target position in the second IO request queue; determining the longest time length of the seventeenth to-be-processed time length, the eighteenth to-be-processed time length, the fifteenth to-be-processed time length and the sixteenth to-be-processed time length as the to-be-processed time length corresponding to the target IO request, and adding the to-be-processed time length corresponding to the target IO request to the current system time to obtain a second to-be-processed time of the target IO request.
In implementation, the processing priority of the target logical partition may be determined by the identifier of the target logical partition carried in the target IO request and the correspondence between the identifier of the logical partition and the priority. And then determining the target position of the target IO request in a second IO request queue according to the processing priority of the target logical partition, wherein the priority corresponding to the IO request before the target position in the queue may be greater than or equal to the priority corresponding to the identifier of the logical partition. Therefore, the IO requests with high corresponding priority can be processed first, and the IO requests with low corresponding priority can be processed later. After the target position of the target IO request in the second IO request queue is determined, the seventeenth waiting time corresponding to the target IO request is calculated according to the number of the write requests in the second IO request queue before the target position and the eleventh preset processing speed, calculating the eighteenth waiting time corresponding to the target IO request according to the data volume to be written of the write request before the target position in the second IO request queue and the twelfth preset processing speed, calculating a fifteenth to-be-processed time length corresponding to the target IO request according to the number of the read requests and the write requests before the target position in the second IO request queue and a ninth preset processing speed, and calculating the sixteenth waiting time of the target IO request according to the sum of the data volume to be read of the read request and the data volume to be written of the write request before the target position in the second IO request queue and the tenth preset processing speed. After the seventeenth to-be-processed time length, the eighteenth to-be-processed time length, the fifteenth to-be-processed time length and the sixteenth to-be-processed time length are obtained, the longest time length in the time lengths can be determined as the to-be-processed time length corresponding to the target IO request, and then the corresponding to-be-processed time length is added to the current system time to obtain a second to-be-processed time of the target IO request.
When the target position of the target IO request in the second IO request queue is determined, a first IO request with a processing priority higher than or equal to that of the target IO request may be determined in the IO requests of the second IO request queue, a first position of the first IO request in the second IO request queue is determined, and a position behind the first position in the second IO request queue is determined as the target position.
Step 302, if the first IO request queue is determined to be a queue for receiving a target IO request, adding the target IO request into the first IO request queue for processing.
If, in step 201, the first to-be-processed time is earlier than the second to-be-processed time, for example, the first processing time is 10:00:01, and the first processing time is 10:00:05, the first IO request queue may be determined to be a queue for receiving the target IO request, that is, the target IO request may be added to the first IO request queue for processing, and the corresponding processing is as follows: adding a target IO request and a first moment to be processed into a first IO request queue; and when the system time reaches the first time to be processed, processing the target IO request.
In implementation, if it is determined that the first IO request queue is a queue for receiving a target IO request, the first to-be-processed time and the target IO request may be correspondingly added to the first IO request queue, the processing time corresponding to the IO request in the IO request processing queue corresponding to each logical partition is polled according to a polling mechanism in the SPDK and according to a fixed polling cycle, and if the processing time corresponding to the IO request is later than the current system time, the corresponding IO request may be issued to the storage device, and the corresponding read-write processing is completed.
Step 303, if it is determined that the second IO request queue is a queue for receiving the target IO request, adding the target IO request into the second IO request queue for processing.
If the second to-be-processed time is earlier than the first to-be-processed time in step 201, the second IO request queue is determined to be a queue for receiving the target IO request, that is, the target IO request can be added to the second IO request queue for processing, and the corresponding processing is as follows: adding the target IO request and the second to-be-processed time into a second IO request queue; and when the system time reaches the second to-be-processed time, processing the target IO request.
In implementation, if it is determined that the second IO request queue is a queue for receiving a target IO request, the second to-be-processed time and the target IO request may be correspondingly added to the second IO request queue, the processing time corresponding to the IO request in the IO request processing queue corresponding to each logical partition is polled according to a polling mechanism in the SPDK and according to a fixed polling cycle, and if the processing time corresponding to the IO request is later than the current system time, the corresponding IO request may be issued to the storage device, and the corresponding read-write processing is completed.
Optionally, if the logical partition corresponds to the priority, and after the second IO request queue determines the queue receiving the target IO request, the target IO request and the second to-be-processed time may be added to the target position of the second IO request queue; and updating the to-be-processed time corresponding to each IO request after the target position in the second IO request queue, and processing the target IO request when the system time reaches the second to-be-processed time.
In implementation, if it is determined that the second IO request queue is a queue for receiving a target IO request and the target logical partition corresponds to a priority, after the corresponding target location is determined, the corresponding second to-be-processed time and the target IO request are added to the target location of the second IO request queue. Polling the corresponding processing time of the IO request in the IO request processing queue corresponding to each logic partition according to a polling mechanism in the SPDK and a fixed polling period, and if the processing time corresponding to the IO request is later than the current system time, issuing the corresponding IO request to the storage device to complete the corresponding read-write processing. In addition, since the target IO request is a target position that is added to the second IO request queue, the to-be-processed time corresponding to the IO request after the target position needs to be updated, and the updating method is consistent with the method for determining the second to-be-processed time corresponding to the target IO request, and is not described herein again.
In the embodiment of the application, an IO processing queue is set for a logical partition corresponding to each virtual machine, and a receiving condition of a target IO request is set for the IO processing queue according to attribute information of the IO processing queue, and if a first IO request queue corresponding to the target IO request does not meet the corresponding receiving condition, the target IO request can be added into a second IO request queue corresponding to a common logical partition to process the target IO request, so that the storage performance of the storage device can be effectively utilized, the IO request sent by the virtual machine to the storage device is limited, and therefore the possibility that each virtual machine occupies the storage performance of the storage device can be reduced.
All the above optional technical solutions may be combined arbitrarily to form the optional embodiments of the present disclosure, and are not described herein again.
Fig. 4 is an apparatus for processing an IO request according to an embodiment, where the apparatus may be a server or a terminal in the above embodiment, and the apparatus includes:
a receiving module 410, configured to receive a target IO request sent by a target virtual machine, where the target IO request carries an identifier of a target logical partition corresponding to the target virtual machine;
an obtaining module 420, configured to obtain attribute information of a first IO request queue corresponding to the target logical partition based on the identifier;
a determining module 430, configured to determine, based on the attribute information of the first IO request queue, whether the first IO request queue meets a first receiving condition for receiving the target IO request;
a processing module 440, configured to add the target IO request to the first IO request queue for processing if the first IO request queue meets the first receiving condition;
the determining module 430 is configured to determine, if the first IO request queue does not satisfy the first receiving condition, whether a second IO request queue satisfies a second receiving condition for receiving the target IO request based on attribute information of the second IO request queue corresponding to a common logical partition;
the processing module 440 is configured to add the target IO request into the second IO request queue for processing if the second IO request queue meets the second receiving condition, where the common logical partition is a logical partition to which a virtual machine is not currently allocated.
Optionally, the attribute information includes the number of read requests, the number of write requests, the amount of data to be read of the read requests, and the amount of data to be written of the write requests.
Optionally, the target IO request is a read request, and the determining module 430 is configured to:
if the number of the read requests in the first IO request queue is smaller than the first number threshold, the data amount to be read of the read requests in the first IO request queue is smaller than the first data amount threshold, the sum of the number of the read requests and the number of the write requests in the first IO request queue is smaller than the third number threshold, and the sum of the data amount to be read of the read requests and the data amount to be written of the write requests in the first IO request queue is smaller than the third data amount threshold, determining that the first IO request queue meets the condition of receiving the target IO request;
and if the number of the read requests in the first IO request queue is greater than or equal to the second number threshold, or the data volume to be read of the read requests in the first IO request queue is greater than or equal to the first data volume threshold, or the sum of the number of the read requests and the number of the write requests in the first IO request queue is greater than or equal to the third number threshold, or the sum of the data volume to be read of the read requests and the data volume to be written of the write requests in the first IO request queue is greater than or equal to the third data volume threshold, determining that the first IO request queue does not satisfy the condition for receiving the target IO request.
Optionally, the target IO request is a write request, and the determining module 430 is configured to:
if the number of the write requests in the first IO request queue is smaller than the second number threshold, the data quantity to be written of the write requests in the first IO request queue is smaller than the second data quantity threshold, the sum of the numbers of the read requests and the write requests in the first IO request queue is smaller than the third number threshold, and the sum of the data quantity to be read of the read requests and the data quantity to be written of the write requests in the first IO request queue is smaller than the third data quantity threshold, determining that the first IO request queue meets the condition for receiving the target IO request;
and if the number of the write requests in the first IO request queue is greater than or equal to the second number threshold, or the data volume to be written of the write requests in the first IO request queue is greater than or equal to the second data volume threshold, or the sum of the numbers of the read requests and the write requests in the first IO request queue is greater than or equal to the third number threshold, or the sum of the data volume to be read of the read requests and the data volume to be written of the write requests in the first IO request queue is greater than or equal to the third data volume threshold, determining that the first IO request queue does not satisfy the condition for receiving the target IO request.
Optionally, the target IO request is a read request, and the determining module 430 is configured to:
if the number of the read requests in the second IO request queue is smaller than the fourth number threshold, the data amount to be read of the read requests in the second IO request queue is smaller than the fourth data amount threshold, the sum of the number of the read requests and the number of the write requests in the second IO request queue is smaller than the sixth number threshold, and the sum of the data amount to be read of the read requests and the data amount to be written of the write requests in the second IO request queue is smaller than the sixth data amount threshold, determining that the second IO request queue meets a second receiving condition for receiving the target IO request;
and if the number of the read requests in the second IO request queue is greater than or equal to the fourth number threshold, or the data amount to be read of the read requests in the second IO request queue is greater than or equal to the fourth data amount threshold, or the sum of the number of the read requests and the number of the write requests in the second IO request queue is greater than or equal to the sixth number threshold, or the sum of the data amount to be read of the read requests and the data amount to be written of the write requests in the second IO request queue is greater than or equal to the sixth data amount threshold, determining that the second IO request queue does not satisfy a second receiving condition for receiving the target IO request.
Optionally, the target IO request is a write request, and the determining module 430 is configured to:
if the number of the write requests in the second IO request queue is smaller than the fifth number threshold, the data amount to be written of the write requests in the second IO request queue is smaller than the fifth data amount threshold, the sum of the number of the read requests and the number of the write requests in the second IO request queue is smaller than the sixth number threshold, and the sum of the data amount to be read of the read requests and the data amount to be written of the write requests in the second IO request queue is smaller than the sixth data amount threshold, determining that the second IO request queue meets a second receiving condition for receiving the target IO request;
and if the number of the write requests in the second IO request queue is greater than or equal to the fifth number threshold, or the amount of data to be written of the write requests in the second IO request queue is greater than or equal to the fifth data amount threshold, or the sum of the number of the read requests and the number of the write requests in the second IO request queue is greater than or equal to the sixth number threshold, or the sum of the amount of data to be read of the read requests and the amount of data to be written of the write requests in the second IO request queue is greater than or equal to the sixth data amount threshold, determining that the second IO request queue does not satisfy a second receiving condition for receiving the target IO request.
Optionally, the determining module 430 is further configured to:
if the first IO request queue does not meet the first receiving condition and the second IO request queue does not meet the second receiving condition, determining a queue for receiving the target IO request from the first IO request queue and the second IO request queue based on the attribute information of the first IO request queue and the attribute information of the second IO request queue;
and if the first IO request queue is determined to be the queue for receiving the target IO request, adding the target IO request into the first IO request queue for processing, and if the second IO request queue is determined to be the queue for receiving the target IO request, adding the target IO request into the second IO request queue for processing.
Optionally, the determining module 430 is configured to:
determining a first time to be processed of the target IO request based on the attribute information of the first IO request queue, determining a second time to be processed of the target IO request based on the attribute information of the second IO request queue, determining the first IO request queue to receive the queue of the target IO request if the first time to be processed is smaller than the second time to be processed, and determining the second IO request queue to receive the queue of the target IO request if the first time to be processed is larger than the second time to be processed.
Optionally, the target IO request is a write request, and the determining module is configured to:
determining a first to-be-processed time length of a target IO request based on the number of write requests in the first IO request queue and a first preset processing speed, determining a second to-be-processed time length of the target IO request based on the to-be-written data amounts of all write requests in the first IO request queue and a second preset processing speed, determining a third to-be-processed time length of the target IO request based on the number of read requests and write requests in the first IO request queue and a third preset processing speed, and determining a fourth to-be-processed time length of the target IO request based on the sum of the to-be-read data amounts of all read requests and the to-be-written data amounts of all write requests in the first IO request queue and a fourth preset processing speed;
determining the longest time length of the first time length to be processed, the second time length to be processed, the third time length to be processed and the fourth time length to be processed as the time length to be processed corresponding to the target IO request, and adding the current system time to the time length to be processed corresponding to the target IO request to obtain the first time length to be processed of the target IO request.
Optionally, the target IO request is a read request, and the determining module is configured to:
determining a fifth to-be-processed time length of a target IO request based on the number of read requests in the first IO request queue and a fifth preset processing speed, determining a sixth to-be-processed time length of the target IO request based on the data amounts to be read of all the read requests in the first IO request queue and the sixth preset processing speed, determining a third to-be-processed time length of the target IO request based on the number of the read requests and the write requests in the first IO request queue and the third preset processing speed, and determining a fourth to-be-processed time length of the target IO request based on the sum of the data amounts to be read of all the read requests and the data amounts to be written of all the write requests in the first IO request queue and the fourth preset processing speed;
determining the longest time length of the third to-be-processed time length, the fourth to-be-processed time length, the fifth to-be-processed time length and the sixth to-be-processed time length as the to-be-processed time length corresponding to the target IO request, and adding the to-be-processed time length corresponding to the target IO request to the current system time to obtain the first to-be-processed time of the target IO request.
Optionally, the target IO request is a write request, and the determining module 430 is configured to:
determining a seventh waiting time of the target IO request based on the number of the write requests in the second IO request queue and a seventh preset processing speed, determining an eighth waiting time of the target IO request based on the data volumes to be written of all the write requests in the second IO request queue and the eighth preset processing speed, determining a ninth waiting time of the target IO request based on the number of the read requests and the write requests in the second IO request queue and the ninth preset processing speed, and determining a tenth waiting time of the target IO request based on the sum of the data volumes to be read of all the read requests and the data volumes to be written of all the write requests in the second IO request queue and the tenth preset processing speed;
determining the longest duration of the seventh to-be-processed duration, the eighth to-be-processed duration, the ninth to-be-processed duration and the tenth to-be-processed duration as the to-be-processed duration corresponding to the target IO request, and adding the to-be-processed duration corresponding to the target IO request to the current system time to obtain a second to-be-processed time of the target IO request.
Optionally, the target IO request is a read request, and the determining module 430 is configured to:
determining eleventh to-be-processed time length of a target IO request based on the number of read requests in the second IO request queue and an eleventh preset processing speed, determining twelfth to-be-processed time length of the target IO request based on the to-be-read data amount and the twelfth preset processing speed of all read requests in the second IO request queue, determining ninth to-be-processed time length of the target IO request based on the number of read requests and write requests in the second IO request queue and a ninth preset processing speed, and determining tenth to-be-processed time length of the target IO request based on the sum of the to-be-read data amount and the to-be-written data amount of all write requests in the second IO request queue and the tenth preset processing speed;
determining the longest duration of the ninth to-be-processed duration, the tenth to-be-processed duration, the eleventh to-be-processed duration and the twelfth to-be-processed duration as the to-be-processed duration corresponding to the target IO request, and adding the to-be-processed duration corresponding to the target IO request to the current system time to obtain a second to-be-processed time of the target IO request.
Optionally, the processing module 440 is configured to:
adding the target IO request and the first moment to be processed into the first IO request queue;
when the system time reaches a first time to be processed, processing the target IO request;
the processing module 440 is configured to:
adding the target IO request and the second to-be-processed time into the second IO request queue;
and when the system time reaches a second to-be-processed time, processing the target IO request.
Optionally, the logical partition corresponds to a processing priority, the target IO request is a write request, and the determining module 430 is configured to:
determining the processing priority of the target logical partition according to the identifier of the target logical partition carried in the target IO request;
determining a target position of the target IO request in the second IO request queue according to the processing priority of the target logical partition;
determining a thirteenth waiting time length of a target IO request based on the number of write requests in the second IO request queue before the target position and a seventh preset processing speed, determining a fourteenth waiting time length of the target IO request based on the data amount to be written of the write requests in the second IO request queue before the target position and an eighth preset processing speed, determining a fifteenth waiting time length of the target IO request based on the number of read requests and write requests in the second IO request queue before the target position and a ninth preset processing speed, and determining a sixteenth waiting time length of the target IO request based on the sum of the data amount to be read of the read requests and the data amount to be written of the write requests in the second IO request queue before the target position and a tenth preset processing speed;
determining the longest duration of the thirteenth to-be-processed duration, the fourteenth to-be-processed duration, the fifteenth to-be-processed duration and the sixteenth to-be-processed duration as the to-be-processed duration corresponding to the target IO request, and adding the to-be-processed duration corresponding to the target IO request to the current system time to obtain a second to-be-processed time of the target IO request.
Optionally, the logical partition corresponds to a processing priority, the target IO request is a read request, and the determining module 430 is configured to:
determining the processing priority of the target logical partition according to the identifier of the target logical partition carried in the target IO request;
determining a target position of the target IO request in the second IO request queue according to the processing priority of the target logical partition;
determining a seventeenth waiting time of a target IO request based on the number of read requests and an eleventh preset processing speed in the second IO request queue before the target position, determining an eighteenth waiting time of the target IO request based on the amount of data to be read of the read requests and the twelfth preset processing speed in the second IO request queue before the target position, determining a fifteenth waiting time of the target IO request based on the number of the read requests and the write requests in the second IO request queue before the target position and the ninth preset processing speed, and determining a sixteenth waiting time of the target IO request based on the sum of the amount of data to be read of the read requests and the amount of data to be written of the write requests in the second IO request queue before the target position and the tenth preset processing speed;
determining the longest time length of the seventeenth waiting time length, the eighteenth waiting time length, the nineteenth waiting time length and the twentieth waiting time length as the waiting time length corresponding to the target IO request, and adding the waiting time length corresponding to the target IO request to the current system time to obtain the second waiting time of the target IO request.
Optionally, the determining module 430 is configured to:
determining a first IO request with a processing priority higher than or equal to that of a target IO request in IO requests of a second IO request queue, determining a first position of the first IO request in the second IO request queue, and determining a position behind the first position in the second IO request queue as the target position.
Optionally, the apparatus further includes an update module, configured to:
adding the target IO request and the second to-be-processed time to a target position of the second IO request queue;
and updating the to-be-processed time corresponding to each IO request after the target position in the second IO request queue.
And when the system time reaches a second to-be-processed time, processing the target IO request.
It should be noted that: in the device for processing an IO request according to the foregoing embodiment, when the IO request is processed, only the division of each functional module is illustrated, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the device for processing the IO request and the method for processing the IO request provided in the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Fig. 5 is a schematic structural diagram of a computer device 500, which may be a terminal or a server in the foregoing embodiments, and may have a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 501 and one or more memories 502, where the memory 502 stores at least one instruction, and the at least one instruction is loaded and executed by the processors 501 to implement the methods provided by the foregoing method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input/output interface, so as to perform input/output, and the server may also include other components for implementing the functions of the device, which are not described herein again.
In an exemplary embodiment, a computer-readable storage medium, such as a memory, including instructions executable by a processor in a terminal to perform the method of processing an IO request in the above embodiments is also provided. The computer readable storage medium may be non-transitory. For example, the computer-readable storage medium may be a ROM (Read-Only Memory), a RAM (Random Access Memory), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (11)

1. A method of processing IO requests, the method comprising:
receiving a target IO request sent by a target virtual machine, wherein the target IO request carries an identifier of a target logical partition corresponding to the target virtual machine;
acquiring attribute information of a first IO request queue corresponding to the target logical partition based on the identifier;
determining whether the first IO request queue meets a first receiving condition for receiving the target IO request or not based on the attribute information of the first IO request queue;
if the first IO request queue meets the first receiving condition, adding the target IO request into the first IO request queue for processing;
and if the first IO request queue does not meet the first receiving condition, determining whether a second IO request queue meets a second receiving condition for receiving the target IO request or not based on attribute information of the second IO request queue corresponding to a public logical partition, and if the second IO request queue meets the second receiving condition, adding the target IO request into the second IO request queue for processing, wherein the public logical partition is a logical partition which is not distributed with a virtual machine currently.
2. The method of claim 1, wherein the attribute information includes a number of read requests, a number of write requests, an amount of data to be read for the read requests, and an amount of data to be written for the write requests.
3. The method of claim 2, wherein the target IO request is a read request, and the determining whether the first IO request queue satisfies a first receiving condition for receiving the target IO request based on the attribute information of the first IO request queue comprises:
if the number of the read requests in the first IO request queue is smaller than the first number threshold, the data amount to be read of the read requests in the first IO request queue is smaller than the first data amount threshold, the sum of the number of the read requests and the number of the write requests in the first IO request queue is smaller than the third number threshold, and the sum of the data amount to be read of the read requests and the data amount to be written of the write requests in the first IO request queue is smaller than the third data amount threshold, determining that the first IO request queue meets the condition of receiving the target IO request;
and if the number of the read requests in the first IO request queue is greater than or equal to the second number threshold, or the data volume to be read of the read requests in the first IO request queue is greater than or equal to the first data volume threshold, or the sum of the number of the read requests and the number of the write requests in the first IO request queue is greater than or equal to the third number threshold, or the sum of the data volume to be read of the read requests and the data volume to be written of the write requests in the first IO request queue is greater than or equal to the third data volume threshold, determining that the first IO request queue does not satisfy the condition for receiving the target IO request.
4. The method of claim 2, wherein the target IO request is a write request, and the determining whether the first IO request queue satisfies a condition for receiving the target IO request based on the attribute information of the first request queue comprises:
if the number of the write requests in the first IO request queue is smaller than the second number threshold, the data quantity to be written of the write requests in the first IO request queue is smaller than the second data quantity threshold, the sum of the numbers of the read requests and the write requests in the first IO request queue is smaller than the third number threshold, and the sum of the data quantity to be read of the read requests and the data quantity to be written of the write requests in the first IO request queue is smaller than the third data quantity threshold, determining that the first IO request queue meets the condition for receiving the target IO request;
and if the number of the write requests in the first IO request queue is greater than or equal to the second number threshold, or the data volume to be written of the write requests in the first IO request queue is greater than or equal to the second data volume threshold, or the sum of the numbers of the read requests and the write requests in the first IO request queue is greater than or equal to the third number threshold, or the sum of the data volume to be read of the read requests and the data volume to be written of the write requests in the first IO request queue is greater than or equal to the third data volume threshold, determining that the first IO request queue does not satisfy the condition for receiving the target IO request.
5. The method according to claim 2, wherein the determining whether the second IO request queue satisfies a second receiving condition for receiving the target IO request based on attribute information of the second IO request queue corresponding to the common logical partition includes:
if the number of the read requests in the second IO request queue is smaller than the fourth number threshold, the data amount to be read of the read requests in the second IO request queue is smaller than the fourth data amount threshold, the sum of the number of the read requests and the number of the write requests in the second IO request queue is smaller than the sixth number threshold, and the sum of the data amount to be read of the read requests and the data amount to be written of the write requests in the second IO request queue is smaller than the sixth data amount threshold, determining that the second IO request queue meets a second receiving condition for receiving the target IO request;
and if the number of the read requests in the second IO request queue is greater than or equal to the fourth number threshold, or the data amount to be read of the read requests in the second IO request queue is greater than or equal to the fourth data amount threshold, or the sum of the number of the read requests and the number of the write requests in the second IO request queue is greater than or equal to the sixth number threshold, or the sum of the data amount to be read of the read requests and the data amount to be written of the write requests in the second IO request queue is greater than or equal to the sixth data amount threshold, determining that the second IO request queue does not satisfy a second receiving condition for receiving the target IO request.
6. The method according to claim 2, wherein the determining whether the second IO request queue satisfies a second receiving condition for receiving the target IO request based on attribute information of the second IO request queue corresponding to the common logical partition includes:
if the number of the write requests in the second IO request queue is smaller than the fifth number threshold, the data amount to be written of the write requests in the second IO request queue is smaller than the fifth data amount threshold, the sum of the number of the read requests and the number of the write requests in the second IO request queue is smaller than the sixth number threshold, and the sum of the data amount to be read of the read requests and the data amount to be written of the write requests in the second IO request queue is smaller than the sixth data amount threshold, determining that the second IO request queue meets a second receiving condition for receiving the target IO request;
and if the number of the write requests in the second IO request queue is greater than or equal to the fifth number threshold, or the amount of data to be written of the write requests in the second IO request queue is greater than or equal to the fifth data amount threshold, or the sum of the number of the read requests and the number of the write requests in the second IO request queue is greater than or equal to the sixth number threshold, or the sum of the amount of data to be read of the read requests and the amount of data to be written of the write requests in the second IO request queue is greater than or equal to the sixth data amount threshold, determining that the second IO request queue does not satisfy a second receiving condition for receiving the target IO request.
7. The method of claim 2, further comprising:
if the first IO request queue does not meet the first receiving condition and the second IO request queue does not meet the second receiving condition, determining a queue for receiving the target IO request from the first IO request queue and the second IO request queue based on the attribute information of the first IO request queue and the attribute information of the second IO request queue;
and if the first IO request queue is determined to be the queue for receiving the target IO request, adding the target IO request into the first IO request queue for processing, and if the second IO request queue is determined to be the queue for receiving the target IO request, adding the target IO request into the second IO request queue for processing.
8. The method of claim 7, wherein determining, in the first IO request queue and the second IO request queue, a queue to receive the target IO request based on the attribute information of the first IO request queue and the attribute information of the second IO request queue comprises:
determining a first time to be processed of the target IO request based on the attribute information of the first IO request queue, determining a second time to be processed of the target IO request based on the attribute information of the second IO request queue, determining the first IO request queue to receive the queue of the target IO request if the first time to be processed is smaller than the second time to be processed, and determining the second IO request queue to receive the queue of the target IO request if the first time to be processed is larger than the second time to be processed.
9. An apparatus for processing an IO request, the apparatus comprising:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a target IO request sent by a target virtual machine, and the target IO request carries an identifier of a target logical partition corresponding to the target virtual machine;
the obtaining module is used for obtaining attribute information of a first IO request queue corresponding to the target logical partition based on the identifier;
a determining module, configured to determine, based on attribute information of the first IO request queue, whether the first IO request queue meets a first receiving condition for receiving the target IO request;
the processing module is used for adding the target IO request into the first IO request queue for processing if the first IO request queue meets the first receiving condition;
the determining module is configured to determine whether the second IO request queue satisfies a second receiving condition for receiving the target IO request based on attribute information of the second IO request queue corresponding to a common logical partition if the first IO request queue does not satisfy the first receiving condition;
and the processing module is configured to add the target IO request into the second IO request queue for processing if the second IO request queue meets the second receiving condition, where the common logical partition is a logical partition to which a virtual machine is not currently allocated.
10. A computer device comprising a processor and a memory, wherein at least one instruction is stored in the memory, and is loaded and executed by the processor to implement the operations performed by the method for processing IO requests according to any one of claims 1 to 8.
11. A computer-readable storage medium having stored therein at least one instruction which is loaded and executed by a processor to perform operations performed by a method of processing an IO request according to any one of claims 1 to 8.
CN202010691259.0A 2020-07-17 2020-07-17 Method, device, equipment and storage medium for processing IO request Active CN111831397B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010691259.0A CN111831397B (en) 2020-07-17 2020-07-17 Method, device, equipment and storage medium for processing IO request

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010691259.0A CN111831397B (en) 2020-07-17 2020-07-17 Method, device, equipment and storage medium for processing IO request

Publications (2)

Publication Number Publication Date
CN111831397A true CN111831397A (en) 2020-10-27
CN111831397B CN111831397B (en) 2024-02-20

Family

ID=72923422

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010691259.0A Active CN111831397B (en) 2020-07-17 2020-07-17 Method, device, equipment and storage medium for processing IO request

Country Status (1)

Country Link
CN (1) CN111831397B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150169341A1 (en) * 2013-12-16 2015-06-18 Vmware, Inc. Virtual machine data store queue allocation
CN104750547A (en) * 2013-12-31 2015-07-01 华为技术有限公司 Input-output (IO) request processing method and device of virtual machines
US20180321879A1 (en) * 2015-12-31 2018-11-08 Huawei Technologies Co., Ltd. Method and Apparatus for Processing Read/Write Request in Physical Machine

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150169341A1 (en) * 2013-12-16 2015-06-18 Vmware, Inc. Virtual machine data store queue allocation
CN104750547A (en) * 2013-12-31 2015-07-01 华为技术有限公司 Input-output (IO) request processing method and device of virtual machines
US20180321879A1 (en) * 2015-12-31 2018-11-08 Huawei Technologies Co., Ltd. Method and Apparatus for Processing Read/Write Request in Physical Machine

Also Published As

Publication number Publication date
CN111831397B (en) 2024-02-20

Similar Documents

Publication Publication Date Title
CN107690622B9 (en) Method, equipment and system for realizing hardware acceleration processing
US20220179560A1 (en) Distributed storage system and data processing method
US8307053B1 (en) Partitioned packet processing in a multiprocessor environment
US20170286149A1 (en) Method for Managing Memory of Virtual Machine, Physical Host, PCIE Device and Configuration Method Thereof, and Migration Management Device
CN108900626B (en) Data storage method, device and system in cloud environment
US11861196B2 (en) Resource allocation method, storage device, and storage system
KR20180089273A (en) Method and apparatus for implementing out-of-order resource allocation
CN110119304B (en) Interrupt processing method and device and server
US11940915B2 (en) Cache allocation method and device, storage medium, and electronic device
JP6974510B2 (en) Methods, devices, devices and media for processing data
US9697047B2 (en) Cooperation of hoarding memory allocators in a multi-process system
CN116382581A (en) Method, system, equipment and storage medium for accelerating execution of NVMe protocol
CN113438184B (en) Network card queue management method and device and electronic equipment
CN112148467A (en) Dynamic allocation of computing resources
CN116089477B (en) Distributed training method and system
CN110162395A (en) A kind of method and device of Memory Allocation
CN111367472A (en) Virtualization method and device
CN111831397B (en) Method, device, equipment and storage medium for processing IO request
CN114726657A (en) Method and device for interrupt management and data receiving and sending management and intelligent network card
CN113778688A (en) Memory management system, memory management method, and memory management device
CN112799820A (en) Data processing method, data processing apparatus, electronic device, storage medium, and program product
CN113010453A (en) Memory management method, system, equipment and readable storage medium
CN114281516A (en) Resource allocation method and device based on NUMA attribute
CN116483740B (en) Memory data migration method and device, storage medium and electronic device
JP7467593B2 (en) Resource allocation method, storage device, and storage system - Patents.com

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
GR01 Patent grant
GR01 Patent grant