CN101408853B - Apparatus and method for scheduling virtual machine - Google Patents

Apparatus and method for scheduling virtual machine Download PDF

Info

Publication number
CN101408853B
CN101408853B CN2008102249403A CN200810224940A CN101408853B CN 101408853 B CN101408853 B CN 101408853B CN 2008102249403 A CN2008102249403 A CN 2008102249403A CN 200810224940 A CN200810224940 A CN 200810224940A CN 101408853 B CN101408853 B CN 101408853B
Authority
CN
China
Prior art keywords
virtual processor
scheduling
virtual
virtual machine
processor
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.)
Active
Application number
CN2008102249403A
Other languages
Chinese (zh)
Other versions
CN101408853A (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.)
Jilin Zhongke Fangde Software Co ltd
Original Assignee
Institute of Computing Technology of CAS
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 Institute of Computing Technology of CAS filed Critical Institute of Computing Technology of CAS
Priority to CN2008102249403A priority Critical patent/CN101408853B/en
Publication of CN101408853A publication Critical patent/CN101408853A/en
Application granted granted Critical
Publication of CN101408853B publication Critical patent/CN101408853B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention relates to a method and a device for dispatching a virtual machine. The method includes arranging a virtual processor in a runnable queue from a high dispatching priority to a low one and the steps as well: step 1, adding an I/O intensive virtual processor to a detection window, distributing initial resource quotas to the virtual processor; step 2, dispatching the virtual processors in the runnable queue in sequence, if the dispatched virtual processor is not in the detection window, operating the virtual processor, after that, dispatching the next virtual processor in the runnable queue, otherwise, determining whether the virtual processor is to be operated according to the current remaining resource quotas of the virtual processor, after the operation, updating the remaining resource quotas of the virtual processor and dispatching the next virtual processor in the runnable queue. The invention can ensure CPU intensive application, periodical I/O application and I/O intensive application as well as the equity of occupying processor resources and I/O resources.

Description

A kind of device and method of scheduling virtual machine
Technical field
The present invention relates to virtual field, relate in particular to a kind of device and method of scheduling virtual machine.
Background technology
Virtual feasible different services can non-interferingly be incorporated on the same physical machine, make full use of system resource.When service assembly, usually each service is placed in the independent virtual machines.Therefore, needs guarantee justice and the efficient between the virtual machine.Justice is meant the virtual machine on the same physical node, should share physical resource with the quota of user's appointment, does not disturb mutually; Efficient is meant the throughput that improves total system as far as possible.
In dummy machine system, scheduler is the device of the VCPU (virtual processor) that is used for scheduling virtual machine.When system start-up, the quantity of the VCPU that the VCPU of each virtual machine comprises according to virtual machine under it obtains corresponding credit worthiness.When VCPU remained credit worthiness in addition, this VCPU was in the UNDER state; When the credit worthiness of VCPU ran out, this VCPU was in the OVER state; When VCPU carried out the I/O processing, this VCPU was in the BOOST state.The VCPU of each operation that is scheduled moves 30ms at most, and the VCPU for the operation that is scheduled deducts 100 every 10 milliseconds of values with the credit worthiness of this VCPU.When the credit worthiness summation of VCPU in the system less than 0 the time, be that each VCPU distributes credit worthiness again by scheduler.
The dispatching method of scheduler as shown in Figure 1.But scheduler will have task dispatching VCPU to be scheduled by the scheduling priority arrangement in operation queue.Determine the dispatching priority of VCPU by the residing state of VCPU, order from high to low is BOOST state, UNDER state, OVER state, but the tail of the queue of operation queue is the idle running VCPU of system.In Fig. 1, virtual processor A, B, H are in the BOOST state, and virtual processor C, D, E are in the UNDER state, and virtual processor F is in the OVER state, and virtual processor G is idle running VCPU.The virtual processor H that has moved that is scheduled is inserted into after all VCPU of its equal state.
Scheduler of the prior art can guarantee between the VCPU equitable proportion shared processing device resource according to credit worthiness, but does not consider the fairness of I/O resource sharing.For example, the operation Apache webserver on two virtual machine A on the same physical machine and B, and give A the value of the credit worthiness identical with B.If virtual machine B goes up the service thread of the service thread of Apache's server far more than virtual machine A, or the load on the virtual machine B is much larger than virtual machine A, and then the network bandwidth that obtains of virtual machine B is higher than virtual machine A far away.This means that virtual machine B " has stolen " the subnetwork processing power of virtual machine A.It is relatively poor and unpredictable that the unfairness of this I/O resource sharing can cause the I/O performance to be isolated, and makes Intel Virtualization Technology can not be applicable to that performance depends on the application program of I/O fairness.
Summary of the invention
For addressing the above problem, the invention provides a kind of device and method of scheduling virtual machine, can improve the fairness that takies resource between the virtual machine.
The invention discloses a kind of method of scheduling virtual machine, but be arranged in the operation queue, comprising by the virtual processor of dispatching priority order from high to low with virtual machine to be scheduled:
Step 1 joins detection window with the virtual processor of I/O intensity, is described virtual processor distributing initial resource quota;
Step 2, but virtual processor in the described operation queue dispatched in order, if the virtual processor that is scheduled is not in described detection window, move described virtual processor, but next virtual processor in the described operation queue of scheduling after operation is finished, otherwise, next step carried out;
Step 3, the resource quota of the described virtual processor current residual of foundation determines whether to move described virtual processor, upgrades the surplus resources quota of described virtual processor after operation is finished, but next virtual processor in the described operation queue of scheduling.
Described resource quota corresponding tables is shown the I/O credit worthiness.
Described step 3 further is:
Step 31, if the current I/O credit worthiness of described virtual processor is greater than 0, then determine the described virtual processor of operation, after operation is finished, the I/O credit worthiness of described virtual processor is deducted the described I/O processing quantity of finishing in service, but and dispatch next virtual processor in the described operation queue, otherwise, but next virtual processor in the described operation queue of scheduling.
Also comprise between described step 2 and the described step 3:
Step 41 judges whether the virtual processor number that comprises in the described detection window is 1, if, move described virtual processor, but after operation is finished, dispatch next virtual processor in the described operation queue, otherwise, described step 3 carried out.
Described step 2 and described step 41 also comprise:
Step 51 judges whether the virtual machine under the described virtual processor belongs to the territory that drives territory or franchise virtual machine place, if, then move described virtual processor, but next virtual processor in the described operation queue of scheduling after operation is finished, otherwise, described step 41 carried out.
Described I/O credit worthiness with described virtual processor deducts and also comprises after the described I/O that finishes in service handles quantity:
Step 61, the I/O credit worthiness of all virtual processors in described detection window increase the I/O credit worthiness of all virtual processors in the described detection window all less than 0 o'clock by described initial resource quota.
In the described step 1 virtual processor of I/O intensity being joined detection window further is:
Step 71 is added up the I/O that finishes when described virtual processor moves and is handled quantity accounts for the number of times of described virtual processor operation greater than the number of times of preset value ratio;
Step 72, when described ratio greater than 1/2 the time, described virtual processor is joined detection window.
Described step 71 further is:
Step 81 is safeguarded a history window corresponding to each virtual processor, and the length of each described history window is identical;
Step 82, if the I/O that the operation of described virtual processor the time is finished handles quantity greater than preset value, then the correspondence position with described history window is 1, otherwise, be 0 with the correspondence position of described history window;
Step 83, divided by described history window length, the gained merchant is described ratio with 1 number in the described history window.
Described step 71 further is:
Step 91 is safeguarded a history window corresponding to each virtual processor, and the length of each described history window is identical;
Step 92, if the I/O that the operation of described virtual processor the time is finished the network equipment or block device handles quantity greater than preset value, then the correspondence position with described history window is 1, otherwise, be 0 with the correspondence position of described history window;
Step 93, divided by described history window length, the gained merchant is described ratio with 1 number in the described history window.
For the network equipment, described I/O handles the quantity of quantity for the network packet of transmission and reception.
For block device, it is the quantity of the disk block of read and write that described I/O handles quantity.
The invention also discloses a kind of device of scheduling virtual machine, but be used for by dispatching priority order from high to low the virtual processor of virtual machine to be scheduled being arranged in operation queue, described device comprises:
The detection window module is used for the virtual processor of I/O intensity is joined detection window, is described virtual processor distributing initial resource quota;
The scheduling judge module, but be used for dispatching in order the virtual processor of described operation queue, if the virtual processor that is scheduled is not in described detection window, move described virtual processor, but next virtual processor in the described operation queue of scheduling after operation is finished, otherwise, start dispatching control module;
Described dispatching control module comprises resource quota judge module,
Described dispatching control module starts described resource quota judge module when starting;
Described resource quota judge module, be used for determining whether to move described virtual processor according to the resource quota of described virtual processor current residual, after finishing, operation upgrades the surplus resources quota of described virtual processor, but next virtual processor in the described operation queue of scheduling.
Described resource quota corresponding tables is shown the I/O credit worthiness.
Described resource quota judge module, be further used in the current I/O credit worthiness of described virtual processor greater than 0 o'clock, determine the described virtual processor of operation, after operation is finished, the I/O credit worthiness of described virtual processor is deducted the described I/O processing quantity of finishing in service, but and dispatch next virtual processor in the described operation queue, the I/O credit worthiness current at described virtual processor is not more than at 0 o'clock, but the scheduling described operation queue in next virtual processor.
Described dispatching control module also comprises the quantity judge module,
When described dispatching control module starts, start described quantity judge module, start described resource quota judge module by described quantity judge module;
Described quantity judge module is used for judging whether the virtual processor number that described detection window comprises is 1, if move described virtual processor, but after operation is finished, dispatch next virtual processor in the described operation queue, otherwise, start described resource quota judge module.
Territory judge module under described dispatching control module also comprises,
When described dispatching control module starts, start described affiliated territory judge module, start described quantity judge module by territory judge module under described;
The territory judge module is used to judge whether the virtual machine under the described virtual processor belongs to the territory that drives territory or franchise virtual machine place under described, if, then move described virtual processor, but next virtual processor in the described operation queue of scheduling after operation is finished, otherwise, start described quantity judge module.
Described resource quota judge module also is used for after the I/O credit worthiness with described virtual processor deducts the described I/O processing quantity of finishing in service, the I/O credit worthiness of all virtual processors in described detection window increases the I/O credit worthiness of all virtual processors in the described detection window all less than 0 o'clock by described initial resource quota.
Described detection window module is further used for adding up the I/O that finishes when described virtual processor moves and handles quantity accounts for the number of times of described virtual processor operation greater than the number of times of preset value ratio when the virtual processor with the I/O intensity joins detection window, and at described ratio greater than 1/2 o'clock, described virtual processor is joined detection window.
The I/O that described detection window module is finished when the operation of the described virtual processor of statistics handles when quantity accounts for the ratio of number of times of described virtual processor operation greater than the number of times of preset value and is further used for safeguarding a history window corresponding to each virtual processor that the length of each described history window is identical; If the I/O that finishes during the operation of described virtual processor handles quantity greater than preset value, then the correspondence position with described history window is 1, otherwise, be 0 with the correspondence position of described history window; Divided by described history window length, the gained merchant is described ratio with 1 number in the described history window.
The I/O that described detection window module is finished when the operation of the described virtual processor of statistics handles when quantity accounts for the ratio of number of times of described virtual processor operation greater than the number of times of preset value and is further used for safeguarding a history window corresponding to each virtual processor that the length of each described history window is identical; If the I/O that finishes during the operation of described virtual processor the network equipment or block device handles quantity greater than preset value, then the correspondence position with described history window is 1, otherwise, be 0 with the correspondence position of described history window; Divided by described history window length, the gained merchant is described ratio with 1 number in the described history window.
Description of drawings
For the network equipment, described I/O handles the quantity of quantity for the network packet of transmission and reception.
For block device, it is the quantity of the disk block of read and write that described I/O handles quantity.
Beneficial effect of the present invention is, by detection window and I/O credit worthiness the intensive VCPU of I/O being taken processor resource controls, thereby guarantee that CPU intensive applications, preiodic type I/O use and the I/O intensive applications, take the fairness of processor resource and I/O resource.
Fig. 1 is the synoptic diagram of the scheduler method of work of prior art;
Fig. 2 is the method flow diagram of scheduling virtual machine of the present invention;
Fig. 3 is the method flow diagram that adds VCPU among the present invention to detection window;
Embodiment
Fig. 4 is the method flow diagram of among the present invention the VCPU in detection window being dispatched;
Fig. 5 is the synoptic diagram of the method for work of embodiments of the invention;
Fig. 6 is the structure drawing of device of scheduling virtual machine of the present invention.
Below in conjunction with accompanying drawing, the present invention is described in further detail.
The present invention increases detection window and I/O credit worthiness on the basis of existing technology.The I/O credit worthiness is used for representing the resource quota of the VCPU of detection window.
The resource quota is specified by the user, and the value of I/O credit worthiness is directly proportional with this resource quota, thereby guarantee to adopt the present invention, and the I/O processing power that the VCPU of each virtual machine is obtained is consistent with the resource quota of user's appointment.
But after adopting scheme in the prior art to be arranged in the virtual processor of virtual machine to be scheduled in the operation queue by dispatching priority order from high to low, execution in step as shown in Figure 2.
Step S201 joins detection window with the VCPU of I/O intensity, is that this VCPU distributes initial I/O credit worthiness.
Step S202, but the VCPU of scheduling in the operation queue in order judge the VCPU that is scheduled whether not in described detection window, if, execution in step S203, otherwise, execution in step S204.
Step S203 moves this VCPU, but dispatches next VCPU in the described operation queue after operation is finished.
Step S204 dispatches this VCPU according to the I/O credit worthiness of this VCPU, but the next VCPU in the scheduling operation queue after finishing.
Use in the system and can be divided into three kinds: CPU intensity, periodicity I/O type and I/O intensity, corresponding to application, VCPU also is divided into above-mentioned three kinds.Owing to have only the I/O intensive applications can be, thereby only need limit the I/O processing power that the I/O intensive applications obtains, guarantee that simultaneously it can be owing to the existence of other two kinds of application, and be not scheduled the I/O of system resource build-up of pressure.
The intensive VCPU of I/O is that load over half all is the VCPU of I/O operation.
The embodiment that among the described step S201 VCPU of I/O intensity is joined detection window as shown in Figure 3.
Step S301 safeguards a history window corresponding to each VCPU, and the length of each history window is identical.
Step S302, if the I/O that the VCPU operation time is finished handles quantity greater than preset value, then the correspondence position with its corresponding historical window is 1, otherwise, be 0 with the correspondence position of its corresponding historical window.
Step S303 counts io-degree with 1 number in the history window, and divided by this history window length, the gained merchant is a ratio with io-degree.
Step S304, when described ratio greater than 1/2 the time, the VCPU that determines this ratio correspondence is the I/O intensity, and this VCPU is joined in the detection window.
Adopt said method can distinguish described three class VCPU.The value of the io-degree of the intensive VCPU of CPU is generally 0; The value of the io-degree of the VCPU of preiodic type I/O is usually less than half of history window length; The value of the io-degree of the VCPU of I/O intensity is greater than half of history window length, and is less than or equal to the length of history window.
Use preset value in the above-mentioned algorithm, in order to prevent interference.Because in the operating system of non-franchise virtual machine, include demons, network guard program especially.When this virtual machine during without any load, described demons periodically carry out the I/O operation, are not any CPU then and handle, and dally.Thereby part of V CPU may be waken up, and carries out above-mentioned I/O operation, continues idle running then.
If only consider the number of times of VCPU with the selected operation of BOOST state, handle quantity and ignore the I/O that carries out selected operation back, then because constantly the adding up of 1 number in the history window of the described VCPU that dallies, and can't distinguish intensive VCPU of I/O and the described VCPU that dallies.For these reasons, preset value is 3 or 4 in the present embodiment.
The embodiment of described step S204 as shown in Figure 4.
Whether step S401 judges the current I/O credit worthiness of VCPU greater than 0, if, execution in step S402 then, otherwise, execution in step S403.
Step S402, determine operation VCPU, after operation is finished, the I/O credit worthiness of this VCPU is deducted this I/O processing quantity of finishing in service, the I/O credit worthiness of all VCPU in detection window is all less than 0 o'clock, increase the I/O credit worthiness of all VCPU in the detection window by the initial resource quota, but and dispatch next VCPU in the described operation queue.
Step S403, but next VCPU in the scheduling operation queue.
In said method, but if having only the VCPU of a virtual machine on the operation queue, and its I/O credit worthiness is less than 0, and the value that also has the I/O credit worthiness in the detection window is greater than 0 VCPU, but because this VCPU is waiting for the I/O incident, but not on operation queue, therefore, but the value of the I/O credit worthiness of the VCPU of virtual machine can not be increased on the operation queue.But the VCPU of virtual machine is not moved on the operation queue at this moment, but next VCPU in the described operation queue of scheduling, and this VCPU is the idle running VCPU of system.
In another embodiment, when in the I/O detection window, having only a VCPU, because do not have other VCPU and its competition I/O resource in the system this moment, so this VCPU is not limited.Concrete grammar is to increase step 411 before described step S401, judges whether the VCPU number that comprises in the described detection window is 1, if, move this VCPU, but the next VCPU after operation is finished in the scheduling operation queue, otherwise, described step S401 carried out.
In another embodiment, the CPU of franchise virtual machine is taken the I/O resource do not limit, drive territory and D0 territory, the D0 territory is the territory at franchise virtual machine place.The more I/O privileges of virtual machine.Concrete grammar is to increase step 421 before step 411, judges whether the virtual machine under the VCPU belongs to driving territory or D0 territory, if, then move this VCPU, but after operation is finished, dispatch the next VCPU in the operation queue, otherwise, described step 411 carried out.
A plurality of I/O equipment are arranged in dummy machine system.Some of them belong to exclusive equipment, for example keyboard and mouse, and this kind equipment must be specific to certain virtual machine, perhaps switches between virtual machine with very big time granularity; Do not do control for this kind equipment sharing between virtual machine.Wherein some equipment belongs to spooling devices, printer for example, and their shared granularity is greater than traditional shared device, and only guarantees could to carry out new task under the situation that previous task is finished; Therefore the justice that does not need to guarantee this kind equipment is shared.The present invention controls the block device and the network equipment in the dummy machine system, and both are collectively referred to as nucleus equipment.
In an embodiment, the embodiment that among the described step S201 VCPU of I/O intensity is joined detection window is as follows.
Step 311 is safeguarded a history window corresponding to each VCPU, and the length of each history window is identical.
Step 312, if the I/O that the VCPU operation time is finished nucleus equipment handles quantity greater than preset value, then the correspondence position with its corresponding historical window is 1, otherwise, be 0 with the correspondence position of its corresponding historical window.
Step 313 is counted io-degree with 1 number in the history window, and divided by this history window length, the gained merchant is a ratio with io-degree.
Step 314, when described ratio greater than 1/2 the time, the VCPU that determines this ratio correspondence is the I/O intensity, and this VCPU is joined in the detection window.
Credit worthiness of the prior art is corresponding with the CPU processing time that each virtual machine obtains, and the I/O credit worthiness among the present invention is corresponding with finishing I/O processing quantity.For the network equipment, I/O handles quantity for sending and receive the quantity of network packet; For block device, it is the disk block number of read and write that I/O handles quantity.
In the dummy machine system, there all have a pair of front-end and back-end to drive for each kind equipment to be corresponding with it, handles quantity with the I/O that finishes in statistics VCPU operational process last time, and it is passed to scheduler from virtual machine.
A specific embodiment of the present invention as shown in Figure 5.
During system start-up, the VCPU number of pressing each virtual machine is that the VCPU of this virtual machine distributes the CPU credit worthiness.According to method in the prior art, but VCPU to be scheduled is arranged on the operation queue by dispatching priority order from high to low.From team's head of operation queue, but the traversal scheduling has the VCPU in the operation queue.If the VCPU that is scheduled then directly selects it to move, after having moved, dispatch next VCPU not in detection window.If the VCPU that is scheduled is in the detection window, whether then judge its I/O greater than 0, if then select its operation; Otherwise, but the next VCPU on the scheduling operation queue.
The VCPU of each selected operation moves 30ms at most.If the selected operation of certain VCPU, then after 10 milliseconds, the value of its CPU credit worthiness is deducted 100.When the CPU credit worthiness summation of the VCPU of total system virtual machine less than 0 the time, be that the VCPU of each virtual machine distributes the CPU credit worthiness again.If the VCPU that is scheduled is in the detection window, then after its operation, the I/O that finishes when its I/O credit worthiness value is deducted its this operation handles quantity.
For the VCPU of virtual machine, if 1 number of its history window is then taken out it smaller or equal to half of history window length from detection window; Otherwise, it is added detection window.When VCPU enters the I/O detection window, distribute certain initial I/O credit worthiness for it by the resource quota.If the value of the I/O credit worthiness of all VCPU is all less than 0 in the I/O detection window, then increase the I/O credit worthiness value of all VCPU in the detection window, so that the VCPU that gets clogged can continue operation.
The device of scheduling virtual machine of the present invention, be used for but the VCPU of virtual machine to be scheduled being arranged in operation queue by dispatching priority order from high to low, structure comprises as shown in Figure 6: detection window module 601, scheduling judge module 602, dispatching control module 603.
Detection window module 601 is used for the VCPU of I/O intensity is joined detection window, is VCPU distributing initial resource quota.
Resource quota corresponding tables is shown the I/O credit worthiness.
The I/O that finishes when detection window module 601 is further used for adding up the VCPU operation when the virtual processor with the I/O intensity joins detection window handles quantity accounts for the number of times of this VCPU operation greater than the number of times of preset value ratio, and at ratio greater than 1/2 o'clock, this VCPU is joined detection window.
In an embodiment, the I/O that detection window module 601 time is finished in statistics VCPU operation handles when quantity accounts for the ratio of number of times of VCPU operation greater than the number of times of preset value and is further used for safeguarding a history window corresponding to each VCPU that the length of each history window is identical; If the I/O that the VCPU operation time is finished handles quantity greater than preset value, then the correspondence position with history window is 1, otherwise, be 0 with the correspondence position of history window; Divided by history window length, the gained merchant is a ratio with 1 number in the history window.
In another embodiment, the I/O that detection window module 601 time is finished in statistics VCPU operation handles when quantity accounts for the ratio of number of times of VCPU operation greater than the number of times of preset value and is further used for safeguarding a history window corresponding to each VCPU that the length of each history window is identical; If the I/O that the VCPU operation time is finished the network equipment or block device handles quantity greater than preset value, then the correspondence position with history window is 1, otherwise, be 0 with the correspondence position of history window; Divided by history window length, the gained merchant is a ratio with 1 number in the history window.For the network equipment, I/O handles the quantity of quantity for the network packet of transmission and reception.For block device, it is the quantity of the disk block of read and write that I/O handles quantity.
Dispatch judge module 602, but be used for dispatching in order the VCPU of operation queue,, but dispatch next VCPU in the operation queue after operation is finished if the VCPU that is scheduled not in detection window, moves VCPU, otherwise, dispatching control module 603 started;
Dispatching control module 603 comprises: affiliated territory judge module 631, quantity judge module 632, resource quota judge module 633.
Affiliated territory judge module 631 is used to judge whether the virtual machine under the VCPU belongs to driving territory or D0 territory, if, then move VCPU, but after operation is finished, dispatch next VCPU in the operation queue, otherwise, quantity judge module 632 started.
Quantity judge module 632 is used for judging whether the VCPU number that detection window comprises is 1, if, operation VCPU, but after finishing, operation dispatches next VCPU in the operation queue, otherwise, start resource quota judge module 633.
Resource quota judge module 633, be used in the current I/O credit worthiness of VCPU greater than 0 o'clock, determine operation VCPU, after operation is finished, the I/O credit worthiness of VCPU is deducted the I/O processing quantity of finishing in service, but and next VCPU in the scheduling operation queue, the I/O credit worthiness current at VCPU is not more than at 0 o'clock, but the scheduling operation queue in next VCPU.
Resource quota judge module 633 also is used for after the I/O credit worthiness with VCPU deducts the I/O processing quantity of finishing in service, the I/O credit worthiness of all VCPU in detection window increases the I/O credit worthiness of all VCPU in the described detection window all less than 0 o'clock by the initial resource quota.
Those skilled in the art can also carry out various modifications to above content under the condition that does not break away from the definite the spirit and scope of the present invention of claims.Therefore scope of the present invention is not limited in above explanation, but determine by the scope of claims.

Claims (22)

1. the method for a scheduling virtual machine, but be arranged in the operation queue by the virtual processor of dispatching priority order from high to low virtual machine to be scheduled, it is characterized in that, comprising:
Step 1 joins detection window with the virtual processor of I/O intensity, is described virtual processor distributing initial resource quota;
Step 2, but virtual processor in the described operation queue dispatched in order, if the virtual processor that is scheduled is not in described detection window, move described virtual processor, but next virtual processor in the described operation queue of scheduling after operation is finished, otherwise, next step carried out;
Step 3, the resource quota of the described virtual processor current residual of foundation determines whether to move described virtual processor, upgrades the surplus resources quota of described virtual processor after operation is finished, but next virtual processor in the described operation queue of scheduling.
2. the method for scheduling virtual machine according to claim 1 is characterized in that described resource quota corresponding tables is shown the I/O credit worthiness.
3. as the method for scheduling virtual machine as described in the claim 2, it is characterized in that described step 3 further is:
Step 31, if the current I/O credit worthiness of described virtual processor is greater than 0, then determine the described virtual processor of operation, after operation is finished, the I/O credit worthiness of described virtual processor is deducted the described I/O processing quantity of finishing in service, but and dispatch next virtual processor in the described operation queue, otherwise, but next virtual processor in the described operation queue of scheduling.
4. as the method for scheduling virtual machine as described in the claim 3, it is characterized in that, also comprise between described step 2 and the described step 3:
Step 41 judges whether the virtual processor number that comprises in the described detection window is 1, if, move described virtual processor, but after operation is finished, dispatch next virtual processor in the described operation queue, otherwise, described step 3 carried out.
5. as the method for scheduling virtual machine as described in the claim 4, it is characterized in that described step 2 and described step 41 also comprise:
Step 51 judges whether the virtual machine under the described virtual processor belongs to the territory that drives territory or franchise virtual machine place, if, then move described virtual processor, but next virtual processor in the described operation queue of scheduling after operation is finished, otherwise, described step 41 carried out.
6. as the method for scheduling virtual machine as described in the claim 3, it is characterized in that described I/O credit worthiness with described virtual processor deducts and also comprises after the described I/O that finishes in service handles quantity:
Step 61, the I/O credit worthiness of all virtual processors in described detection window increase the I/O credit worthiness of all virtual processors in the described detection window all less than 0 o'clock by described initial resource quota.
7. the method for scheduling virtual machine according to claim 1 is characterized in that, in the described step 1 virtual processor of I/O intensity is joined detection window further to be:
Step 71 is added up the I/O that finishes when described virtual processor moves and is handled quantity accounts for the number of times of described virtual processor operation greater than the number of times of preset value ratio;
Step 72, when described ratio greater than 1/2 the time, described virtual processor is joined detection window.
8. as the method for scheduling virtual machine as described in the claim 7, it is characterized in that described step 71 further is:
Step 81 is safeguarded a history window corresponding to each virtual processor, and the length of each described history window is identical;
Step 82, if the I/O that the operation of described virtual processor the time is finished handles quantity greater than preset value, then the correspondence position with described history window is 1, otherwise, be 0 with the correspondence position of described history window;
Step 83, divided by described history window length, the gained merchant is described ratio with 1 number in the described history window.
9. as the method for scheduling virtual machine as described in the claim 7, it is characterized in that,
Described step 71 further is:
Step 91 is safeguarded a history window corresponding to each virtual processor, and the length of each described history window is identical;
Step 92, if the I/O that the operation of described virtual processor the time is finished the network equipment or block device handles quantity greater than preset value, then the correspondence position with described history window is 1, otherwise, be 0 with the correspondence position of described history window;
Step 93, divided by described history window length, the gained merchant is described ratio with 1 number in the described history window.
10. the method for scheduling virtual machine described in claim 9 is characterized in that,
For the network equipment, described I/O handles the quantity of quantity for the network packet of transmission and reception.
11. the method for scheduling virtual machine is characterized in that described in claim 9,
For block device, it is the quantity of the disk block of read and write that described I/O handles quantity.
12. the device of a scheduling virtual machine, but be used for the virtual processor of virtual machine to be scheduled being arranged in operation queue by dispatching priority order from high to low, it is characterized in that described device comprises:
The detection window module is used for the virtual processor of I/O intensity is joined detection window, is described virtual processor distributing initial resource quota;
The scheduling judge module, but be used for dispatching in order the virtual processor of described operation queue, if the virtual processor that is scheduled is not in described detection window, move described virtual processor, but next virtual processor in the described operation queue of scheduling after operation is finished, otherwise, start dispatching control module;
Described dispatching control module comprises resource quota judge module,
Described dispatching control module starts described resource quota judge module when starting;
Described resource quota judge module, be used for determining whether to move described virtual processor according to the resource quota of described virtual processor current residual, after finishing, operation upgrades the surplus resources quota of described virtual processor, but next virtual processor in the described operation queue of scheduling.
13. the device as scheduling virtual machine as described in the claim 12 is characterized in that described resource quota corresponding tables is shown the I/O credit worthiness.
14. device as scheduling virtual machine as described in the claim 13, it is characterized in that, described resource quota judge module, be further used in the current I/O credit worthiness of described virtual processor greater than 0 o'clock, determine the described virtual processor of operation, after operation is finished, the I/O credit worthiness of described virtual processor is deducted the described I/O processing quantity of finishing in service, but and dispatch next virtual processor in the described operation queue, the I/O credit worthiness current at described virtual processor is not more than at 0 o'clock, but next virtual processor in the described operation queue of scheduling.
15. the device as scheduling virtual machine as described in the claim 14 is characterized in that,
Described dispatching control module also comprises the quantity judge module,
When described dispatching control module starts, start described quantity judge module, start described resource quota judge module by described quantity judge module;
Described quantity judge module is used for judging whether the virtual processor number that described detection window comprises is 1, if move described virtual processor, but after operation is finished, dispatch next virtual processor in the described operation queue, otherwise, start described resource quota judge module.
16. the device as scheduling virtual machine as described in the claim 15 is characterized in that,
Territory judge module under described dispatching control module also comprises,
When described dispatching control module starts, start described affiliated territory judge module, start described quantity judge module by territory judge module under described;
The territory judge module is used to judge whether the virtual machine under the described virtual processor belongs to the territory that drives territory or franchise virtual machine place under described, if, then move described virtual processor, but next virtual processor in the described operation queue of scheduling after operation is finished, otherwise, start described quantity judge module.
17. the device as scheduling virtual machine as described in the claim 14 is characterized in that,
Described resource quota judge module also is used for after the I/O credit worthiness with described virtual processor deducts the described I/O processing quantity of finishing in service, the I/O credit worthiness of all virtual processors in described detection window increases the I/O credit worthiness of all virtual processors in the described detection window all less than 0 o'clock by described initial resource quota.
18. the device as scheduling virtual machine as described in the claim 12 is characterized in that,
Described detection window module is further used for adding up the I/O that finishes when described virtual processor moves and handles quantity accounts for the number of times of described virtual processor operation greater than the number of times of preset value ratio when the virtual processor with the I/O intensity joins detection window, and at described ratio greater than 1/2 o'clock, described virtual processor is joined detection window.
19. device as scheduling virtual machine as described in the claim 18, it is characterized in that, the I/O that described detection window module is finished when the operation of the described virtual processor of statistics handles when quantity accounts for the ratio of number of times of described virtual processor operation greater than the number of times of preset value and is further used for safeguarding a history window corresponding to each virtual processor that the length of each described history window is identical; If the I/O that finishes during the operation of described virtual processor handles quantity greater than preset value, then the correspondence position with described history window is 1, otherwise, be 0 with the correspondence position of described history window; Divided by described history window length, the gained merchant is described ratio with 1 number in the described history window.
20. device as scheduling virtual machine as described in the claim 18, it is characterized in that, the I/O that described detection window module is finished when the operation of the described virtual processor of statistics handles when quantity accounts for the ratio of number of times of described virtual processor operation greater than the number of times of preset value and is further used for safeguarding a history window corresponding to each virtual processor that the length of each described history window is identical; If the I/O that finishes during the operation of described virtual processor the network equipment or block device handles quantity greater than preset value, then the correspondence position with described history window is 1, otherwise, be 0 with the correspondence position of described history window; Divided by described history window length, the gained merchant is described ratio with 1 number in the described history window.
21. the device of scheduling virtual machine is characterized in that described in claim 19,
For the network equipment, described I/O handles the quantity of quantity for the network packet of transmission and reception.
22. the device of scheduling virtual machine is characterized in that described in claim 19,
For block device, it is the quantity of the disk block of read and write that described I/O handles quantity.
CN2008102249403A 2008-10-27 2008-10-27 Apparatus and method for scheduling virtual machine Active CN101408853B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008102249403A CN101408853B (en) 2008-10-27 2008-10-27 Apparatus and method for scheduling virtual machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008102249403A CN101408853B (en) 2008-10-27 2008-10-27 Apparatus and method for scheduling virtual machine

Publications (2)

Publication Number Publication Date
CN101408853A CN101408853A (en) 2009-04-15
CN101408853B true CN101408853B (en) 2010-10-13

Family

ID=40571874

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008102249403A Active CN101408853B (en) 2008-10-27 2008-10-27 Apparatus and method for scheduling virtual machine

Country Status (1)

Country Link
CN (1) CN101408853B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103064746A (en) * 2013-01-23 2013-04-24 上海交通大学 Processor resource accurate distributing method for predictive scheduling based on current credit

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101719082B (en) * 2009-12-24 2013-01-02 中国科学院计算技术研究所 Method and system for dispatching application requests in virtual calculation platform
CN102110217B (en) * 2009-12-28 2013-07-24 北京安码科技有限公司 Method for automatic repairing through virtual machine station rotation
CN103294494B (en) * 2012-02-29 2018-07-03 中兴通讯股份有限公司 A kind of method and system of virtual system automatically dispose
CN103049332B (en) * 2012-12-06 2015-05-20 华中科技大学 Virtual CPU scheduling method
CN103870313B (en) * 2012-12-17 2017-02-08 中国移动通信集团公司 Virtual machine task scheduling method and system
CN103106112A (en) * 2013-02-05 2013-05-15 浪潮(北京)电子信息产业有限公司 Method and device based on maximum load and used for load balancing scheduling
CN103744808B (en) * 2013-12-31 2017-12-26 百度在线网络技术(北京)有限公司 A kind of method and apparatus for being used to control I/O to ask
CN108255572A (en) * 2016-12-29 2018-07-06 华为技术有限公司 A kind of VCPU switching methods and physical host
CN107479945B (en) * 2017-08-15 2021-06-22 爱普(福建)科技有限公司 Virtual machine resource scheduling method and device
CN110197314A (en) * 2018-02-27 2019-09-03 北京京东尚科信息技术有限公司 A kind of dispatching method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103064746A (en) * 2013-01-23 2013-04-24 上海交通大学 Processor resource accurate distributing method for predictive scheduling based on current credit
CN103064746B (en) * 2013-01-23 2015-08-12 上海交通大学 The accurate distribution method of processor resource of forecast dispatching is carried out based on current credit

Also Published As

Publication number Publication date
CN101408853A (en) 2009-04-15

Similar Documents

Publication Publication Date Title
CN101408853B (en) Apparatus and method for scheduling virtual machine
CN102890643B (en) Resource scheduling system based on immediate feedback of application effect under display card virtualization
CN101354661B (en) System and method to optimize OS scheduling decisions for power savings based on temporal characteristics of the scheduled entity and system workload
US9535736B2 (en) Providing service quality levels through CPU scheduling
CN102103516B (en) Virtual-CPU based frequency and voltage scaling
CN101473307B (en) Method, system, and apparatus for scheduling computer micro-jobs to execute at non-disruptive times
CN101694633A (en) Equipment, method and system for dispatching of computer operation
CN104252390B (en) Resource regulating method, device and system
CN108701059A (en) Multi-tenant resource allocation methods and system
Tumanov et al. alsched: Algebraic scheduling of mixed workloads in heterogeneous clouds
US8645592B2 (en) Balancing usage of hardware devices among clients
CN102521055B (en) Virtual machine resource allocating method and virtual machine resource allocating system
CN105579959A (en) Virtualization of hardware accelerator
JP2010267009A (en) License management system, license management method and computer program
CN103064746A (en) Processor resource accurate distributing method for predictive scheduling based on current credit
CN106557369A (en) A kind of management method and system of multithreading
US20130198758A1 (en) Task distribution method and apparatus for multi-core system
CN102404140A (en) Control method, device and system of distributed servers
CN109240795A (en) A kind of resource regulating method of the cloud computing resources pool model suitable for super fusion IT infrastructure
CN102708006A (en) Processing optimization load adjustment
JP4348639B2 (en) Multiprocessor system and workload management method
CN102662636A (en) Two-layer virtual machines-based concurrent job scheduling method
CN114721818A (en) Kubernetes cluster-based GPU time-sharing method and system
CN106383747A (en) Method and device for scheduling computing resources
KR101330609B1 (en) Method For Scheduling of Mobile Multi-Core Virtualization System To Guarantee Real Time Process

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230726

Address after: Room 1108, 11th Floor, Zone A, No. 2499 Weishan Road, High tech Development Zone, Changchun City, Jilin Province, 130000

Patentee after: Jilin Zhongke Fangde Software Co.,Ltd.

Address before: 100080 No. 6 South Road, Zhongguancun Academy of Sciences, Beijing, Haidian District

Patentee before: Institute of Computing Technology, Chinese Academy of Sciences