CN108121601A - A kind of application resource dispatching device and method based on weight - Google Patents

A kind of application resource dispatching device and method based on weight Download PDF

Info

Publication number
CN108121601A
CN108121601A CN201711091758.0A CN201711091758A CN108121601A CN 108121601 A CN108121601 A CN 108121601A CN 201711091758 A CN201711091758 A CN 201711091758A CN 108121601 A CN108121601 A CN 108121601A
Authority
CN
China
Prior art keywords
read
write operation
write
threshold
resource
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
CN201711091758.0A
Other languages
Chinese (zh)
Other versions
CN108121601B (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.)
Shanghai Getty Electric Technology Co Ltd
Original Assignee
Shanghai Getty Electric 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 Shanghai Getty Electric Technology Co Ltd filed Critical Shanghai Getty Electric Technology Co Ltd
Priority to CN201711091758.0A priority Critical patent/CN108121601B/en
Publication of CN108121601A publication Critical patent/CN108121601A/en
Application granted granted Critical
Publication of CN108121601B publication Critical patent/CN108121601B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5013Request control
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5022Workload threshold

Abstract

The present invention discloses a kind of application resource dispatching device and method based on weight, belongs to big data application processing technology field.The resource scheduling device of the present invention includes application request receiving module, resources module, process acquisition module, scheduling of resource module and recycling module, resources module is used to obtain the load characteristic of I/O application requests, and the read-write operation threshold value of I/O application loads is calculated, process acquisition module obtains the n-th process read-write operation value (n >=1) for obtaining the processed read-write operation numerical value of process n;Scheduling of resource module carries out the scheduling of resource of process for the read-write operation threshold value according to the I/O application loads and the n-th process read-write operation value obtained.Processed read-write operation value determines to need the weight and resource of distributing to each process by comparing the read-write operation threshold value of different I/O application loads and the process that obtains for dispatching device of the present invention and method, application load is made to ask efficient and rational processing, improves disk resource utilization rate.

Description

Application resource scheduling device and method based on weight
Technical Field
The invention relates to a weight-based application resource scheduling device and method, and belongs to the technical field of big data application processing.
Background
Generally, as a data center bears a large number of cloud computing applications, the performance of the data center not only affects the performance of the applications and the user experience, but also greatly affects the application service capability of the data center. For various applications of a data center, one of the most common applications is access to a large number of random small files, such as e-commerce transactions, social media applications, and the like, and such applications are characterized by large access volume, high concurrency, generation of a large number of random I/O to the data center, and mostly small file transmission. For example, the user pictures in Facebook, the commodity pictures in the e-commerce application such as Taobao, etc. are mostly small files of dozens of KB. Moreover, on a physical machine with multiple virtual machines running concurrently, most of storage I/O requests generated by the virtual machines are random disk read-write requests, and a two-layer mapping mechanism of the virtual disks is added, so that a large number of sequential read-write requests can be converted into random read-write requests more easily. Therefore, the storage I/O generated by the virtual machine operation is mostly random read-write I/O. The virtual machines of the cloud computing data center for bearing various applications are generally defined by users, and the characteristics of the resources are not specially processed, so that limited disk resources cannot be fully utilized when a specific application accesses the data center. Therefore, how to reasonably schedule the disk I/O resources according to the characteristics of the applications accessing the cloud data center and the I/O load characteristics of the applications is an urgent subject to be researched and effectively improves the use efficiency of the resources and the performance of the data center.
Disclosure of Invention
The invention aims to provide an application resource scheduling device and device based on weight, which comprises an application request receiving module, a resource prediction module, a process acquisition module, a resource scheduling module and a recovery module, and is simple in structure.
The technical scheme provided by the invention is as follows:
in one aspect, the present invention provides a device for scheduling application resources based on weight, including:
the application request receiving module is used for receiving an I/O application request;
the resource prediction module is used for acquiring the load characteristics of the I/O application request and calculating the read-write operation threshold of the I/O application load, wherein the read-write operation threshold comprises a read operation upper limit threshold, a read operation lower limit threshold, a write operation upper limit threshold and a write operation lower limit threshold;
the process acquisition module is used for acquiring the read-write operation value processed by the process n to obtain the read-write operation value (n is more than or equal to 1) of the nth process, wherein the read-write operation value comprises a read operation value and a write operation value;
the resource scheduling module is used for scheduling the resources of the process according to the read-write operation threshold of the I/O application load and the acquired read-write operation value of the nth process;
and the recovery module is used for recovering the resources distributed to the process.
According to an embodiment of the present invention, the resource prediction module includes:
the device comprises a first acquisition unit, a second acquisition unit and a third acquisition unit, wherein the first acquisition unit is used for acquiring load characteristics of an I/O application request, and the load characteristics comprise the size of a data block, the number of concurrent processes, the depth of a queue, the read-write proportion and the cache hit rate;
a first determining unit, configured to determine to obtain a first maximum IOPS for read-write operation according to the size of the data block max1
A second determining unit, configured to determine, according to the number of concurrent processes, the queue depth, and a maximum value IOPS of the first read-write operation max1 Determining a second maximum IOPS for read and write operations max2
A lower threshold determining unit for determining the second maximum IOPS according to the read-write ratio and the second read-write operation max2 Determining a lower threshold IPS for read operations lower And a write lower threshold OPS lower
An upper threshold determination unit for IPS according to the cache hit rate and read operation lower threshold lower And a write lower threshold OPS lower Determining an upper threshold IPS for read operations upper And upper threshold OPS for write operations upper
According to another embodiment of the present invention, the data block size and the first maximum value IOPS for read and write operations max1 The relationship between them is:
IOPS max1 =a×e -cx +b×e -dx
where x is the data block size, a, b, c and d are coefficients, a =6.4 x 10 4 ,c=9356,b=1.1*10 4 ,d=0.091。
According to another embodiment of the present invention, when the number of concurrent processes is x1, the queue depth increases linearly from 1, and the second maximum value IOPS for read-write operations max2 The maximum IOPS of the second read-write operation increases along with the increase of the queue depth when the queue depth is increased to more than 3 max2 Keeping unchanged, the number of the concurrent processes and the second maximum value IOPS of the read-write operation max2 The relationship between them is:
IOPS max2 =IOPS max1 ×e c1 +b1×e d1
wherein c1, b1 and d1 are coefficients, and x1 is the number of concurrent processesb1=6.202×10 18
According to another embodiment of the present invention, the read-write ratio, second maximum value of read-write operations IOPS max2 And the read operation lower thresholdValue IPS lower And a write lower threshold OPS lower The relationship between them is:
when the read-write ratio R =1:1,
when the read-write ratio R is less than 1:9 or R is more than 9:1,
when the read-write ratio is more than 1:9 and less than 1:1 or more than 1:1 and less than R and less than 9:1, the read operation lower limit threshold IPS lower And a write lower threshold OPS lower The linear variation is within the following range,
according to another embodiment of the present invention, the cache hit rate and the lower threshold IPS of the read operation lower And a write lower threshold OPS lower And the read operation upper threshold IPS upper And upper threshold OPS for write operation upper The relationship between them is:
IPS upper =IPS lower ×(1+H)
OPS upper =OPS lower ×(1+H)
where H is the cache hit rate.
According to another embodiment of the present invention, the resource scheduling module includes:
the grouping unit is used for grouping the processes according to the nth process read-write operation value and the read-write operation threshold of the I/O application load;
and the distribution unit is used for redistributing the weight and the resources of the grouped processes.
According to another embodiment of the present invention, when the read-write operation value of the nth process is smaller than the read-write operation lower limit threshold of the I/O application load, the nth process is classified into a first group, and the weight and the resource are allocated to the nth process according to a first weight allocation formula and a first resource allocation formula;
when the read-write operation value of the nth process is larger than the read-write operation lower limit threshold of the I/O application load and smaller than the read-write operation upper limit threshold of the I/O application load, the nth process is classified into a second group, and the weight and the resource are distributed to the nth process according to the first weight distribution formula and the first resource distribution formula;
and when the read-write operation value of the nth process is larger than the read-write operation upper limit threshold of the I/O application load, dividing the nth process into a third group, and distributing the weight and the resource to the nth process according to the second weight distribution formula and the first resource distribution formula.
According to another embodiment of the present invention, the first weight distribution formula is:
wherein n is a process number, wr Pn ,Ww Pn Weights for read and write operations, cr, respectively, of process n Pn ,Cw Pn For the read and write operation values that process n has completed,
the second weight distribution formula is:
the first resource allocation formula is:
Rr Pn =Wr Pn ×IPS upper
Rw Pn =Ww Pn ×OPS upper
wherein, rr Pn ,Rw Pn And respectively allocating the disk resources for the read operation and the write operation of the process n.
On the other hand, the invention also provides a method for scheduling application resources based on weight, which comprises the following steps:
step 100: receiving the I/O application request;
step 101: acquiring load characteristics of the I/O application request, and calculating a read-write operation threshold of the I/O application load;
step 102: judging whether a process exists currently, if so, turning to a step 103, otherwise, turning to a step 108;
step 103: acquiring the read-write operation value processed by the process n to obtain the read-write operation value of the nth process (n is more than or equal to 1);
step 104: comparing read and write operation thresholds (IOPS) of the I/O application load upper 、IOPS lower ) And the obtained read-write operation value Crw of the nth process Pn When Crw is Pn <IOPS lower Then, go to step 105; when IOPS lower <Crw Pn <IOPS upper If yes, go to step 106; when Crw is Pn >IOPS upper If yes, go to step 107;
step 105: dividing the nth process into a first group, distributing weights and resources to the nth process according to the first weight distribution formula and the first resource distribution formula, and returning to the step 102 after the distribution is finished;
step 106: the nth process is divided into a second sub-group, the weight distribution and the resource distribution of the nth process are finished according to the first weight distribution formula and the first resource distribution formula, and the step 102 is returned;
step 107: dividing the nth process into a third group, distributing the weight to the nth process according to the second weight distribution formula and the first resource distribution formula, completing the resource distribution, and returning to the step 102;
step 108: and recovering the distributed process resources.
The invention has the following beneficial effects:
the application resource scheduling device based on the weight comprises an application request receiving module, a resource prediction module, a process acquisition module, a resource scheduling module and a recovery module, and is simple in structure. The resource scheduling device of the embodiment of the invention obtains the load characteristics of the I/O application request through the resource prediction module, calculates the read-write operation threshold of the I/O application load by utilizing the relation between the complex characteristics obtained by experiments and the IOPS, obtains the read-write operation value which is processed by the nth process through the process obtaining module, performs the resource scheduling of the process according to the read-write operation threshold of the I/O application load and the obtained read-write operation value of the nth process through the resource scheduling module, allocates corresponding weight and resources, and recovers the allocated resources through the recovery module after the process is processed. The application resource scheduling device based on the weight determines the read-write operation threshold value of each I/O application load by analyzing different I/O application loads, acquires the read-write operation values processed by all processes on line, and obtains the weight and the resource which need to be distributed to each process by comparison, so that the application load request is efficiently and reasonably processed, and the limited disk resource is fully utilized.
The application resource scheduling method based on the weight obtains the read-write operation threshold of the I/O application load by obtaining the load characteristics of the I/O application request, obtains the read-write operation numerical value processed by the process n, divides different processes into three groups according to the read-write operation threshold of the I/O application load and the obtained process read-write operation numerical value, and distributes the three groups according to different weights and resource distribution principles, so that the application load request is efficiently and reasonably processed, and the utilization rate of disk resources is greatly improved.
Drawings
FIG. 1 is a schematic structural diagram of an embodiment of a weight-based application resource scheduling apparatus according to the present invention;
FIG. 2 is a schematic diagram illustrating an embodiment of a resource prediction module of a weight-based application resource scheduling apparatus according to the present invention;
FIG. 3 is a schematic structural diagram of a resource scheduling module of the apparatus for weight-based application resource scheduling according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating an embodiment of a method for weight-based application resource scheduling according to the present invention;
FIG. 5 shows the results of a multiple-run simultaneous experiment according to an embodiment of the present invention;
fig. 6 shows the results of a multi-process random handover experiment according to an embodiment of the present invention.
Detailed Description
In order to make the technical problems, technical solutions and advantages of the present invention more apparent, the following detailed description is given with reference to the accompanying drawings and specific embodiments.
In one aspect, as shown in fig. 1, an embodiment of the present invention provides a device for scheduling application resources based on weights, including:
an application request receiving module 10, configured to receive an I/O application request;
the resource prediction module 20 is configured to obtain load characteristics of the I/O application request, and calculate a read-write operation threshold of the I/O application load, where the read-write operation threshold includes a read operation upper limit threshold, a read operation lower limit threshold, a write operation upper limit threshold, and a write operation lower limit threshold;
a process obtaining module 30, configured to obtain a read-write operation value processed by a process n to obtain an nth process read-write operation value (n is greater than or equal to 1), where the nth process read-write operation value includes a read operation value and a write operation value;
the resource scheduling module 40 is configured to perform resource scheduling on the processes according to the read-write operation threshold of the I/O application load and the acquired nth process read-write operation value;
and a reclamation module 50 for reclaiming the resources allocated to the process.
For a conventional hard disk, a large amount of time spent on head seek results in good continuous read and write performance of the disk, while random read and write performance is relatively poor. The I/O processing speed of the random access disk does not depend on the size of data and the arrangement of the data in the disk, but depends more on the number of I/O requests that can be processed by the disk system in unit time, generally in seconds, that is, the IOPS of the disk. Therefore, the applications are weighted and resource allocated with IOPS as a main index.
The application resource scheduling device based on the weight comprises an application request receiving module, a resource predicting module, a process acquiring module, a resource scheduling module and a recycling module, and is simple in structure. The resource scheduling device of the embodiment of the invention obtains the load characteristics of the I/O application request through the resource prediction module, calculates the read-write operation threshold of the I/O application load by utilizing the relation between the complex characteristics obtained by experiments and the IOPS, obtains the read-write operation value which is processed by the nth process through the process obtaining module, performs the resource scheduling of the process according to the read-write operation threshold of the I/O application load and the obtained read-write operation value of the nth process through the resource scheduling module, allocates corresponding weight and resources, and recovers the allocated resources through the recovery module after the process is processed. The application resource scheduling device based on the weight determines the read-write operation threshold value of each I/O application load by analyzing different I/O application loads, acquires the read-write operation values processed by all processes on line, and obtains the weight and the resource which need to be distributed to each process by comparison, so that the application load request is efficiently and reasonably processed, the limited disk resource is fully utilized, and the utilization rate of the disk resource is greatly improved.
As an illustration, as shown in fig. 2, the resource prediction module 20 of the embodiment of the present invention includes:
a first obtaining unit 21, configured to obtain load characteristics of the I/O application request, where the load characteristics include a data block size, a number of concurrent processes, a queue depth, a read-write ratio, and a cache hit rate;
a first determining unit 22, configured to determine to obtain a first maximum IOPS of read-write operations according to the size of the data block max1
A second determining unit 23, configured to determine the number of concurrent processes, the queue depth, and the maximum IOPS of the first read/write operation max1 Determining a second maximum IOPS for read and write operations max2
A lower threshold determining unit 24 for determining a maximum IOPS according to the read-write ratio and the second read-write operation max2 Determining a lower threshold for read operations IPS lower And a write lower threshold OPS lower
An upper threshold determination unit 25 for determining an IPS according to a cache hit rate and a read lower threshold lower And a write lower threshold OPS lower Determining an upper threshold IPS for read operations upper And upper threshold OPS for write operation upper
In practical application, there are many factors affecting the IOPS, and there are system configuration, operating system, disk drive and other aspects in hardware, and the I/O load characteristics include cache hit rate, read-write ratio, number of concurrent processes, queue depth and data size. For a common operating system, a file system generally uses a block size of 8KB, and when a user accesses a disk under the condition of determining a hardware environment of a data center, the IOPS that the disk can provide, namely, queue depth, cache hit rate, read-write ratio, thread number and the like, is mainly judged from various aspects of I/O load characteristics.
The embodiment of the invention analyzes the IOPS of the system under different application load conditions by analyzing the actual influence of different I/O load conditions on the IOPS under typical random small file application and simulating the I/O load of the web application by using a fio standard test tool, and determines the load characteristics requested by the I/O application according to the I/O quantity and the application completion time of different application disks: the size of the data block, the number of concurrent processes, the depth of the queue, the read-write proportion and how the cache hit rate determines the read-write operation threshold of the I/O application request.
And simulating the I/O load by using a fio standard test tool, and verifying that the IOPS of the system is reduced along with the growth of the data block under the condition that the number of processes is a constant value and the depth of the queue is a constant value. The IOPS maximum also varies as the number of processes increases. Multiprocessing means parallel and efficient processing of I/O requests, but also similar to queue depth, the number of work threads needs to be set within a proper range to achieve the maximum efficiency improvement effect. Queue depth refers to the number of I/O requests waiting to be processed in the disk system, and this parameter determines how many I/O requests an application submits at a time. Theoretically, if the queue depth is larger, more I/O requests can be submitted by the application at one time, so that the I/O requests can be processed by the disk subsystem in parallel, and the processing efficiency is improved. However, high queue depth may result in disk subsystem overload, increased I/O response time, etc. The queue depth is generally set in applications so that the I/O response time does not exceed the disk timeout time. For each mechanical physical disk, if the depth of the IO queue corresponding to this disk exceeds 3, this disk basically represents that the hard disk starts resource shortage for processing IO requests.
As another illustration, the data block size and the first maximum IOPS for read and write operations of embodiments of the present invention max1 The relationship between them is:
IOPS max1 =a×e -cx +b×e -dx (1)
where x is the data block size, a, b, c and d are coefficients, a =6.4 x 10 4 ,c=9356,b=1.1*10 4 ,d=0.091。
The I/O request enters the disk system, and the maximum IOPS value which can be provided by the system is firstly determined according to the data block size of the current file system. A large number of experiments are carried out on a virtual machine of a cloudstack cloud platform with an operating system of Ubuntu 14.04.4 (64 bit), a processor of 2GHz x2, a memory of 2GB and 50GB disks, a network bandwidth of 150Mbps and a disk rotating speed of 7200/min, the relation between the size of the IOPS and the size of the data block is obtained, data fitting is carried out, regression analysis is carried out in data models such as a linear model, a polynomial model, an exponential model and a Gaussian model, residual values of the data block are respectively calculated, and the size presentation index distribution of the IOPS and the data block is obtained.
As another example, when the number of concurrent processes is x1, the queue depth increases linearly from 1, and the maximum IOPS of the second read-write operation is set to be the maximum value max2 The maximum IOPS of the second read-write operation increases along with the increase of the queue depth when the queue depth is increased to more than 3 max2 Keeping unchanged, the number of concurrent processes and the second maximum value IOPS of read-write operation max2 The relationship between them is:
IOPS max2 =IOPS max1 ×e c1 +b1×e d1 (2)
wherein c1, b1 and d1 are coefficients, and x1 is the number of concurrent processesb1=6.202×10 18 ,
The relationship between the IOPS and the number of the threads is obtained through a large number of experiments, data are fitted, regression analysis is carried out in data models such as a linear model, a polynomial model, an exponential model and a Gaussian model, residue values of the regression analysis are calculated respectively, and Gaussian distribution of the IOPS and the number of the threads is obtained.
As another illustration, the read-write ratio, second maximum value for read-write operations IOPS, of an embodiment of the present invention max2 And read operation lower threshold IPS lower And a write lower threshold OPS lower The relationship between them is:
when the read-write ratio R =1:1,
when the read-write ratio R <1:9 or R >9:1,
when the read-write ratio is 1:9<R&lt, 1:1 or 1:1<R&(lt, 9:1), read operation lower threshold IPS lower And a write lower threshold OPS lower The linear variation is within the following range,
a great deal of experiments are carried out on the queue depth and the IOPS, when the number of threads is 1, the queue depth is linearly increased from 1, the IOPS is increased, and when the queue depth is increased to 3 and above, the IOPS provided by the disk is basically maintained. Although an increase in queue depth may increase the IOPS provided by the system, the IOPS does not continue to increase because the range of processing of an I/O request submitted at one time exceeds the system.
Similarly, when the number of threads is 2, 4, and 8, the IOPS increases first as the depth of the queue increases. When the queue depth increases to a certain value, the IOPS does not change greatly any more, and the I/O response time increases linearly with the increase in the queue depth. When a large number of users access the server, the number of application processes is mostly greater than 1, so as the number of I/O requests submitted at one time increases, namely the depth of a queue increases, the IOPS that the system can provide is also related to the number of threads. Therefore, when an I/O load enters the disk system, the IOPS that the system can provide is iopsma max2, along with the determination of the system data block size, the number of processes and the queue depth.
When the read-write ratio changes, the relationship between the read-write ratio and the IOPSmax2 is firstly analyzed. When the read-write ratio is 1:1, the read-write IOPS provided by the disk is the highest, which is equivalent to one-half of IOPSmax2. When the ratio of read/write ratio is as low as 1:9 or 9:1, it is equivalent to one third of IOPSmax2, and other read/write ratios vary linearly within this range.
As another example, the cache hit rate and the lower threshold IPS for read operation of the embodiment of the present invention lower And a write lower threshold OPS lower And upper threshold IPS of read operation upper And upper threshold OPS for write operation upper The relationship between them is:
IPS upper =IPS lower ×(1+H) (9)
OPS upper =OPS lower ×(1+H) (10)
where H is the cache hit rate.
When an I/O request reaches a disk system, the I/O load characteristic of the disk system is obtained, and an IOPS provided by the system under the condition of not using a cache is obtained through a resource prediction module and is used as an IOPS lower threshold value, namely the IOPS lower . In the actual application access process, the IOPS is affected by the system cache. Cache hit rates depend on factors such as data distribution, cache size, data access type, and cache replacement algorithms. If there is a disk array, the higher the read cache hit rate, the more IOPS will be supported. When a large number of similar applications continuously access the server, the cache hit rate of the storage system of the server has small change
As another example, as shown in fig. 3, the resource scheduling module 40 of the embodiment of the present invention includes:
a grouping unit 41, configured to group the processes according to the nth process read-write operation value and the read-write operation threshold of the I/O application load;
and an allocating unit 42, configured to reallocate the weight and the resource of the grouped processes.
The resource scheduling module of the embodiment of the invention comprises a grouping unit and an allocation unit, firstly, processes are grouped by the grouping unit according to the read-write operation value of the nth process and the read-write operation threshold value of the I/O application load, then, the processes are weighted and resources are carried out according to different grouping conditions, for example, the processes with large I/O quantity are completed by giving higher weight to the processes with small I/O quantity, and the processes with large I/O quantity are allocated with more resources to enable the processes to be completed more quickly, and the processes which occupy more resources are limited to a certain extent, so that the purpose that the disk serves more users is realized.
As another example, when the read-write operation value of the nth process is smaller than the read-write operation lower limit threshold of the I/O application load, the embodiment of the present invention allocates the nth process into the first group, and allocates the weight and the resource to the nth process according to the first weight allocation formula and the first resource allocation formula;
when the read-write operation value of the nth process is larger than the read-write operation lower limit threshold value of the I/O application load and smaller than the read-write operation upper limit threshold value of the I/O application load, dividing the nth process into a second group, and distributing the weight and the resource to the nth process according to a first weight distribution formula and a first resource distribution formula;
and when the read-write operation value of the nth process is larger than the read-write operation upper limit threshold of the I/O application load, dividing the nth process into a third group, and distributing the weight and the resource to the nth process according to a second weight distribution formula and a first resource distribution formula.
The first weight distribution formula of the embodiment of the invention is as follows:
wherein n is a process number, wr Pn ,Ww Pn Weights for read and write operations, cr, respectively, of process n Pn ,Cw Pn For the read and write operation values that process n has completed,
the second weight distribution formula is:
the first resource allocation formula is:
Rr Pn =Wr Pn ×IPS upper (15)
Rw Pn =Ww Pn ×OPSupper (16)
wherein, rr Pn ,Rw Pn And respectively allocating the disk resources for the read operation and the write operation of the process n.
Based on the comparison, different processes are assigned to three groups, the weights of the processes given to the three groups are different, where the processes read and write operands (1) < (2) < (3), so the weight (1) > (2) > (3):
(1) I/O operands do not exceed the IOPS lower threshold IOPS lower Is assigned to the first group, and the process weight is reassigned according to the formula (11) and the formula (12);
(2) I/O operands exceed the lower threshold IOPSlower and the upper threshold IOP Supper Is assigned to the second group, and the process weight is reassigned according to the formula (11) and the formula (12);
(3) I/O operand exceeding upper threshold IOPS upper Is assigned to the third group, and weights are assigned according to formula (13) and formula (14);
equations (11) and (12) apply to the first two groups of the three groups, and the two groups determine that the process weight of the (1) group is greater than that of the (2) group due to the difference of the number of the process completion read-write operands. In equations (11) and (12), the number of read and write operations that a process has completed is compared with the corresponding upper threshold, the more the completion is, the larger the ratio is, the ratio is always smaller than 1, and 1 minus the ratio is used as the read and write weight of the process, so that the larger the completion is, the smaller the weight is.
(13) And equation (14) represents a third group, and when the number of completed processes exceeds the set upper threshold, the number of completed processes minus the upper threshold is used as a weight reference. This ratio is also less than 1 as demonstrated by a number of experiments. Subtracting the ratio from 1 to be used as the read-write weight of the progress, wherein the weight is smaller when the read-write operation completion number of the progress is larger.
On the other hand, as shown in fig. 4, an embodiment of the present invention further provides a method for scheduling application resources based on weights, including:
step 100: receiving an I/O application request;
step 101: acquiring load characteristics of the I/O application request, and calculating a read-write operation threshold of the I/O application load;
step 102: judging whether a process exists currently, if so, turning to a step 103, otherwise, turning to a step 108;
step 103: acquiring the read-write operation value processed by the process n to obtain the read-write operation value of the nth process (n is more than or equal to 1);
step 104: comparing the read-write operation threshold (IOPSupper, IOPSlower) of the I/O application load with the obtained read-write operation value CrwPn of the nth process, and turning to the step 105 when the CrwPn is less than the IOPSlower; when IOPSlower < CrwPn < IOPSupper, go to step 106; when CrwPn > IOPSupper, go to step 107;
step 105: dividing the nth process into a first group, distributing the weight and the resource to the nth process according to a first weight distribution formula and a first resource distribution formula, returning to the step 102 after the distribution is finished;
step 106: dividing the nth process into a second group, distributing the weight to the nth process according to the first weight distribution formula and the first resource distribution formula, completing the resource distribution, and returning to the step 102;
step 107: dividing the nth process into a third group, distributing the weight to the nth process according to the second weight distribution formula and the first resource distribution formula, completing the resource distribution, and returning to the step 102;
step 108: and recovering the allocated process resources.
The application resource scheduling method based on the weight obtains the read-write operation threshold of the I/O application load by obtaining the load characteristics of the I/O application request, obtains the read-write operation numerical value processed by the process n, divides different processes into three groups according to the read-write operation threshold of the I/O application load and the obtained process read-write operation numerical value, and distributes the three groups according to different weights and resource distribution principles, so that the application load request is efficiently and reasonably processed, the limited disk resources are fully utilized, and the utilization rate of the disk resources is greatly improved.
The following are further illustrated by experiments:
based on the CloudStack5.0 cloud computing platform, a small cloud computing system is built. The system comprises 1 Management server node Management,2 Host nodes Host and 1 Storage node Storage. The operating system of the Host node Host is Redhat server5.3 (64 bit), processor Inter I5 3470@3.60GHz, memory 8GB DDR3 and hard disk capacity 1TB. The experiment is operated on a virtual machine built on a Host node. The virtual machine operating system is Ubuntu 14.04.4 (64 bit), the processor is 2GHz x2, the memory is 2GB and 50GB magnetic disks, the network bandwidth is 150Mbps, and the rotating speed of the magnetic disks is 7200/min. The specific parameters are shown in the following table:
TABLE 1 Experimental Environment hardware parameters
The tool for realizing the strategy in the virtual machine is a systetatap kernel debugging tool, CGroup. The I/O load is generated by a fio standard test tool.
The load characteristics of the web application are as follows: the amount of data involved in reading, writing, and changing of each transaction is very small, and many users access the transaction at the same time, which requires a fast response from the database, and usually a transaction needs to be completed within a few seconds.
In order to verify the continuous effectiveness of the proposed weight and resource scheduling method for improving the disk processing efficiency when the web application accesses the disk, a fio standard test tool is used for generating random small file I/O requests with different read-write ratios, the effectiveness of the random small file I/O requests is verified according to the disk access data volume finished in different time, and a comparison experiment is carried out under a system default scheduling method. A large number of experiments are performed under a virtual machine, and the experiments are mainly divided into two groups.
Experiment one:
in order to simulate the application characteristics of multiple users of the web application accessing the server at the same time, 64 processes are generated simultaneously under the virtual machine, and the 64 processes continuously perform small file random access with the size of 8 KB. It is verified that the size of the I/O data processed by the system under the default policy and the weight assignment policy is large when the server is continuously accessed in different time periods of 10s,25s,50s,100s,200s,300s,400s and the like.
TABLE 2 results of multiple simultaneous experiments
As shown in fig. 5, which is the result of the experiment performed by the plurality of processes, the abscissa of fig. 5 represents six experiments of 25s,50s,100s,200s,300s, and 400 s. It can be seen that when multiple application processes run simultaneously for different times, the I/O data volume completed by the policy is improved compared with the default policy. Wherein, 25s is improved by 19.48%,50s is improved by 13.6%,100s is improved by 25.83%,200s is improved by 9.68%,300s is improved by 3.45%, and 400s is improved by 1.11%.
From the first experiment, it can be seen that when multiple application processes compete for disk resources, the proposed strategy improves the resource utilization rate of the system, thereby completing more data volumes. The efficiency improvement of the application type in a short time is more remarkable in terms of time, and the access characteristics of the type of the web application are more consistent.
Experiment two:
in order to be closer to the actual application scenario, experiment two verifies the effectiveness of the weight distribution strategy in the process of randomly increasing and decreasing processes.
The experimental method comprises the steps of obtaining a currently running process number through a ps command, then generating a random number in a shell script, taking a random number of the process numbers, and killing the processes, so that a pseudo-random number can be formed by the fio process number running every second, and a more real application scene can be simulated.
Firstly, running a random number of processes under the virtual machine, and then using a shell script to randomly kill n processes. Then, random processes are added after 10 seconds, and m processes are removed from kill in the same way; by analogy, a large number of processes for accessing disk IOs are generated within 200s, 100s, 50s and 20 s. Since the experimental process is a pseudo-random process, the comparative experiment is consistent with the above process and has reference value. Each set of experiments was repeated several times and finally averaged to prove its non-contingency. As shown in FIG. 6, the abscissa represents four sets of experiments 20s,50s,100s and 200s, respectively.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (10)

1. An apparatus for scheduling application resources based on weight, comprising:
the application request receiving module is used for receiving an I/O application request;
the resource prediction module is used for acquiring the load characteristics of the I/O application request and calculating the read-write operation threshold of the I/O application load, wherein the read-write operation threshold comprises a read operation upper limit threshold, a read operation lower limit threshold, a write operation upper limit threshold and a write operation lower limit threshold;
the process acquisition module is used for acquiring the read-write operation value processed by the process n to obtain the read-write operation value (n is more than or equal to 1) of the nth process, wherein the read-write operation value comprises a read operation value and a write operation value;
the resource scheduling module is used for scheduling the resources of the process according to the read-write operation threshold of the I/O application load and the acquired read-write operation value of the nth process;
and the recovery module is used for recovering the resources distributed to the process.
2. The apparatus of claim 1, wherein the resource prediction module comprises:
the device comprises a first acquisition unit, a second acquisition unit and a third acquisition unit, wherein the first acquisition unit is used for acquiring load characteristics of an I/O application request, and the load characteristics comprise the size of a data block, the number of concurrent processes, the depth of a queue, the read-write proportion and the cache hit rate;
a first determining unit, configured to determine to obtain a first maximum IOPS for read-write operation according to the size of the data block max1
A second determining unit, configured to determine, according to the number of concurrent processes, the queue depth, and a maximum value IOPS of the first read-write operation max1 Determining a second maximum IOPS for read and write operations max2
A lower threshold determining unit for determining the second maximum IOPS according to the read-write ratio and the second read-write operation max2 Determining a lower threshold for read operations IPS lower And a write lower threshold OPS lower
An upper threshold determination unit for determining IPS according to the cache hit rate and read operation lower threshold lower And a write lower threshold OPS lower Determining an upper threshold IPS for read operations upper And upper threshold OPS for write operation upper
3. The apparatus of claim 2, wherein the data block size and the first maximum IOPS for read and write operations max1 The relationship between them is:
IOPS max1 =a×e -cx +b×e -dx
where x is the data block size, a, b, c and d are coefficients, a =6.4*10 4 ,c=9356,b=1.1*10 4 ,d=0.091。
4. The apparatus according to claim 2, wherein when the number of concurrent processes is x1, the queue depth increases linearly from 1, and the second maximum IOPS for read-write operations starts when the number of concurrent processes is x1 max2 The maximum IOPS of the second read-write operation increases along with the increase of the queue depth when the queue depth is increased to more than 3 max2 Keeping unchanged, the number of the concurrent processes and the second maximum value IOPS of the read-write operation max2 The relationship between them is:
IOPS max2 =IOPS max1 ×e c1 +b1×e d1
wherein c1, b1 and d1 are coefficients, and x1 is the number of concurrent processes
5. The apparatus of claim 2, wherein the read-write ratio and the second maximum IOPS are defined as max2 And the read operation lower threshold IPS lower And a write lower threshold OPS lower The relationship between them is:
when the read-write ratio R =1:1,
when the read-write ratio R <1:9 or R >9:1,
when the read-write ratio 1:9<R&lt, 1:1 or 1:1<R&lt, 9:1, under the read operationThreshold-limited IPS lower And a write lower threshold OPS lower The linear variation is within the following range,
6. the apparatus of claim 2, wherein the cache hit rate and the lower threshold IPS are lower And a write lower threshold OPS lower And the read operation upper threshold IPS upper And upper threshold OPS for write operations upper The relationship between them is:
IPS upper =IPS lower ×(1+H)
OPS upper =OPS lower ×(1+H)
where H is the cache hit rate.
7. The apparatus of claim 1, wherein the resource scheduling module comprises:
the grouping unit is used for grouping the processes according to the nth process read-write operation value and the read-write operation threshold of the I/O application load;
and the distribution unit is used for redistributing the weight and the resources of the grouped processes.
8. The apparatus of claim 7, comprising: when the read-write operation value of the nth process is smaller than the read-write operation lower limit threshold of the I/O application load, dividing the nth process into a first group, and distributing the weight and the resource to the nth process according to a first weight distribution formula and a first resource distribution formula;
when the read-write operation value of the nth process is larger than the read-write operation lower limit threshold of the I/O application load and smaller than the read-write operation upper limit threshold of the I/O application load, the nth process is classified into a second group, and the weight and the resource are distributed to the nth process according to the first weight distribution formula and the first resource distribution formula;
and when the read-write operation value of the nth process is larger than the read-write operation upper limit threshold of the I/O application load, dividing the nth process into a third group, and distributing the weight and the resource to the nth process according to the second weight distribution formula and the first resource distribution formula.
9. The apparatus as claimed in claim 8, wherein the first weight allocation formula is:
wherein n is a process number, wr Pn ,Ww Pn Weights for read and write operations, cr, respectively, of process n Pn ,Cw Pn For the read and write operation values that process n has completed,
the second weight distribution formula is:
the first resource allocation formula is:
Rr Pn =W'r Pn ×IPS upper
Rw Pn =Ww Pn ×OPS upper
wherein, rr Pn ,Rw Pn And respectively allocating the disk resources for the read operation and the write operation of the process n.
10. A method for scheduling application resources based on weight is characterized by comprising the following steps:
step 100: receiving the I/O application request;
step 101: acquiring load characteristics of the I/O application request, and calculating a read-write operation threshold of the I/O application load;
step 102: judging whether a process exists currently, if so, turning to a step 103, otherwise, turning to a step 108;
step 103: acquiring the read-write operation value processed by the process n to obtain the read-write operation value of the nth process (n is more than or equal to 1);
step 104: comparing read and write operation thresholds (IOPS) of the I/O application load upper 、IOPS l o wer) And the obtained read-write operation value Crw of the nth process Pn When Crw is Pn <IOPS lower Then, go to step 105; when IOPS l o wer <Crw Pn <IOPS upper If yes, go to step 106; when Crw Pn >IOPS upper If yes, go to step 107;
step 105: dividing the nth process into a first group, distributing the weight and the resource to the nth process according to the first weight distribution formula and the first resource distribution formula, returning to the step 102 after the distribution is finished;
step 106: the nth process is divided into a second sub-group, the weight distribution and the resource distribution of the nth process are finished according to the first weight distribution formula and the first resource distribution formula, and the step 102 is returned;
step 107: dividing the nth process into a third group, distributing the weight to the nth process according to the second weight distribution formula and the first resource distribution formula, completing the resource distribution, and returning to the step 102;
step 108: and recovering the allocated process resources.
CN201711091758.0A 2017-11-08 2017-11-08 Application resource scheduling device and method based on weight Active CN108121601B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711091758.0A CN108121601B (en) 2017-11-08 2017-11-08 Application resource scheduling device and method based on weight

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711091758.0A CN108121601B (en) 2017-11-08 2017-11-08 Application resource scheduling device and method based on weight

Publications (2)

Publication Number Publication Date
CN108121601A true CN108121601A (en) 2018-06-05
CN108121601B CN108121601B (en) 2021-11-05

Family

ID=62228453

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711091758.0A Active CN108121601B (en) 2017-11-08 2017-11-08 Application resource scheduling device and method based on weight

Country Status (1)

Country Link
CN (1) CN108121601B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111367626A (en) * 2018-12-26 2020-07-03 北京奇虎科技有限公司 Processing method and device for disk reading and writing task
CN111367627A (en) * 2018-12-26 2020-07-03 北京奇虎科技有限公司 Processing method and device for disk reading and writing task
US20200320035A1 (en) * 2019-04-02 2020-10-08 Micro Focus Software Inc. Temporal difference learning, reinforcement learning approach to determine optimal number of threads to use for file copying
CN115002105A (en) * 2022-04-20 2022-09-02 上海赛连信息科技有限公司 Balanced distribution method and device based on disk rate and network rate
CN115269206A (en) * 2022-09-27 2022-11-01 湖南三湘银行股份有限公司 Data processing method and platform based on resource allocation

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102958166A (en) * 2011-08-29 2013-03-06 华为技术有限公司 Resource allocation method and resource management platform
CN103902474A (en) * 2014-04-11 2014-07-02 华中科技大学 Mixed storage system and method for supporting solid-state disk cache dynamic distribution
US20140244846A1 (en) * 2013-02-22 2014-08-28 Sony Corporation Information processing apparatus, resource control method, and program
CN105468494A (en) * 2015-11-19 2016-04-06 上海天玑数据技术有限公司 I/O intensive application identification method
CN106406976A (en) * 2016-07-21 2017-02-15 柏科数据技术(深圳)股份有限公司 Method and apparatus for identifying IO intensive application in cloud computing environment
CN107247627A (en) * 2017-06-22 2017-10-13 上海优刻得信息科技有限公司 Storage IO distribution method, storage IO distributor and server system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102958166A (en) * 2011-08-29 2013-03-06 华为技术有限公司 Resource allocation method and resource management platform
US20140244846A1 (en) * 2013-02-22 2014-08-28 Sony Corporation Information processing apparatus, resource control method, and program
CN103902474A (en) * 2014-04-11 2014-07-02 华中科技大学 Mixed storage system and method for supporting solid-state disk cache dynamic distribution
CN105468494A (en) * 2015-11-19 2016-04-06 上海天玑数据技术有限公司 I/O intensive application identification method
CN106406976A (en) * 2016-07-21 2017-02-15 柏科数据技术(深圳)股份有限公司 Method and apparatus for identifying IO intensive application in cloud computing environment
CN107247627A (en) * 2017-06-22 2017-10-13 上海优刻得信息科技有限公司 Storage IO distribution method, storage IO distributor and server system

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111367626A (en) * 2018-12-26 2020-07-03 北京奇虎科技有限公司 Processing method and device for disk reading and writing task
CN111367627A (en) * 2018-12-26 2020-07-03 北京奇虎科技有限公司 Processing method and device for disk reading and writing task
CN111367627B (en) * 2018-12-26 2024-02-13 三六零科技集团有限公司 Method and device for processing read-write disk task
US20200320035A1 (en) * 2019-04-02 2020-10-08 Micro Focus Software Inc. Temporal difference learning, reinforcement learning approach to determine optimal number of threads to use for file copying
CN115002105A (en) * 2022-04-20 2022-09-02 上海赛连信息科技有限公司 Balanced distribution method and device based on disk rate and network rate
CN115269206A (en) * 2022-09-27 2022-11-01 湖南三湘银行股份有限公司 Data processing method and platform based on resource allocation

Also Published As

Publication number Publication date
CN108121601B (en) 2021-11-05

Similar Documents

Publication Publication Date Title
CN108121601B (en) Application resource scheduling device and method based on weight
US11086523B2 (en) Automatic tiering of storage using dynamic grouping
US8793427B2 (en) Remote memory for virtual machines
US10152340B2 (en) Configuring cache for I/O operations of virtual machines
Srikantaiah et al. Energy aware consolidation for cloud computing
US9298512B2 (en) Client placement in a computer network system using dynamic weight assignments on resource utilization metrics
US9183151B2 (en) Thread cache allocation
CN107734052B (en) Load balancing container scheduling method facing component dependence
Tai et al. Improving flash resource utilization at minimal management cost in virtualized flash-based storage systems
Guo et al. Parallelism and garbage collection aware I/O scheduler with improved SSD performance
Han et al. Cashing in on the Cache in the Cloud
US7890314B2 (en) Method for modeling performance of embedded processors having combined cache and memory hierarchy
CN110308875A (en) Data read-write method, device, equipment and computer readable storage medium
CN109358809A (en) A kind of RAID data storage system and method
CN106534308A (en) Method and device for solving data block access hotspot problem in distributed storage system
Bhimani et al. FIOS: Feature based I/O stream identification for improving endurance of multi-stream SSDs
Tan et al. Effectiveness assessment of solid-state drive used in big data services
US20170185338A1 (en) Efficient method of combining parity groups for uniform load distribution and maximizing parallelization in parity de-clustered and sliced disk raid architecture
CN109766056A (en) A kind of storage array controllers IO array dispatching method and device
Jayakumar et al. A Holistic Approach for Performance Analysis of Embedded Storage Array
US10209749B2 (en) Workload allocation based on downstream thermal impacts
US20220382672A1 (en) Paging in thin-provisioned disaggregated memory
Muhammad-Bello et al. TCloud: a transparent framework for public cloud service comparison
US8966133B2 (en) Determining a mapping mode for a DMA data transfer
Pioli et al. An effort to characterise enhancements I/O of storage environments

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