CN103870313B - Virtual machine task scheduling method and system - Google Patents
Virtual machine task scheduling method and system Download PDFInfo
- Publication number
- CN103870313B CN103870313B CN201210547958.3A CN201210547958A CN103870313B CN 103870313 B CN103870313 B CN 103870313B CN 201210547958 A CN201210547958 A CN 201210547958A CN 103870313 B CN103870313 B CN 103870313B
- Authority
- CN
- China
- Prior art keywords
- task
- robot arm
- virtual robot
- current task
- described current
- 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
Links
Landscapes
- Stored Programmes (AREA)
- Numerical Control (AREA)
Abstract
The invention discloses a virtual machine task scheduling method and system. The method includes the steps: detecting whether a current task belongs to a virtual machine set or not; processing the current task when the current task belongs to the virtual machine set; selecting a next task according to a default algorithm when the current task does not belong to the virtual machine set. Existence of a virtual machine can be perceived when the task is scheduled, the task belonging to the virtual machine set is preferentially selected, the priority of the virtual machine is equivalently improved, and performances of the virtual machine are improved.
Description
Technical field
The present invention relates to business support technical field, more particularly, to a kind of virtual machine method for scheduling task and system.
Background technology
Task scheduling is distributed data base system, the important component part of cloud computing system and operating system nucleus,
Directly affect the efficiency of whole system.
At present, the most popular scheduler in operating system is complete fair scheduler(CompletelyFair
Scheduler, CFS), according to complete fair principle, by abstract for all of task for scheduling entity(Schedule
Entity), each scheduling entity correspond to one or more tasks, do not repartition interactive task, therefore, all of task all by
Unification is treated.The core concept of CFS is around virtual machine clock (VirtualClock) and launches, virtual runtime(Virtual
Run-time)It is task scheduling and the unique metric standard of Runtime, when dispatching every time, all can select Virtual
The minimum task of Run-time is running.In addition, CFS has abandoned original priority query, as shown in figure 1, by task to set
Form tissue, a node on the corresponding tree of each task, Virtual Run-time is as the key assignments of node(Key-
Value), the minimum node of Key-Value task as next time to be scheduled.
Under completely fair principle, in system, all task acquiescences have identical weight naturally it is also possible to pass through one
A little methods change the weight of task, such as nice etc., but this situation is more rare, and during the establishment of task, default-weight is phase
With, especially system task.
At present, virtual machine the most popular(Kernel Virtual Machine, KVM)Realize general principle be:Will
Each Virtual CPU(VCPU)It is embodied as a CPU task and the corresponding I/O task executing I/O operation(Process).Cause
This, the scheduling dispatched exactly to the multiple tasks representing virtual machine to virtual machine.CFS is according to the control based on Virtual File System
Processed group of fair scheduling strategies are by each Virtual Machine(VM)It is divided into an independent group, multiple represent virtual machine
Group be scheduling together with other tasks in system.As shown in Fig. 2 according to the grouping strategy of CFS, organizing 1 and comprise 2
Business, group 2 comprises 3 tasks, and group 3 comprises 6 tasks.
Intel Virtualization Technology is one of key technology that cloud computing system is related to.Cloud computing system is generally by substantial amounts of virtual machine
Constitute, the performance of virtual machine directly determines the performance of cloud computing system, and in cloud computing system, the scheduling of virtual machine is direct
Determine the performance of virtual machine and the height of resource utilization in cloud computing system, and then directly influence cloud computing system
The height of profit margin, therefore, how to optimize virtual machine in cloud computing system scheduling strategy be improve cloud computing system performance with
The key of profit margin.
Figure it is seen that operating system does not have special treating to the task of representing virtual machine at present, that is, will not area
Point current task is virtual machine task or other common tasks, and therefore, computing capability needed for virtual machine and various resource are not
Can be given preferential treatment to from operating system level, in order to there is higher priority than common task or obtain more resources, can only
Carry out patching up the performance improving virtual machine to try one's best in application program aspect.According to current CFS scheduling strategy, Fig. 2
Dispatching sequence's tree construction of middle task is as shown in figure 3, the order of digitized representation task scheduling, the i.e. Key-Value of task.
Before analyzing this scheduling topological structure, first do hypothesis below:
(1)T1 ~ t12 represents 12 tasks, is not completely self-contained between task;
(2)T1, t2, t4 belong to same VM;
(3)T5, t6, t7, t8, t9 and t11 belong to another one VM;
(4)There is affiliation between t10 and t12;
(5)T3 and other tasks do not have any relation, are completely independent.
According to the scheduling strategy of CFS acquiescence, what CFS saw is only 12 independent tasks, between perception is less than task
Relation, therefore, CFS can according to tree tissue draw following schedule sequences:
t1->t2->t3->t4->t5->t6->t7->t8->t9->t10->t11->t12
Before the pluses and minuses of the schedule sequences of analysis acquiescence, introduce a context-sensitive parameter of measurement:Uncorrelated
Context switching times(ICSC, Incorrelate Context Switch Count), represent completely self-contained two tasks
Between switching number of times.
According to acquiescence CFS scheduling strategy, the ICSC=6 of the schedule sequences shown in Fig. 3, specially:t2->T3, t3->
T4, t4->T5, t9->T10, t10->T11, t11->t12.
Although the scheduling strategy of CFS acquiescence embodies justice, ignore the relation between task, major embodiment completely
For:Belong to the task of same virtual robot arm, task characteristic similarity is high, such as shared address space, intertask communication is frequent, journey
Sequence principle of locality is substantially etc..It is obvious that similarity of tasks is low between group or between independent task, therefore, it is not desired to inter-related task
Between context switching and the task of feature similarity between context compare, it will substantially reduce the hit rate of cache.
It is known that the hit rate of cache is one of key factor of impact systematic function, so, the scheduling strategy of CFS acquiescence is often
Due to the switching between frequently uncorrelated task, significantly reduce the performance of whole system.
Analyzed based on above, find that existing CFS scheduling strategy mainly has the disadvantage that:
1st, common task is put on an equal footing with the task of representing virtual machine it is impossible to maximize the performance of virtual machine.
2nd, perception, less than the relation between task, leads to the switching between substantial amounts of uncorrelated task, greatly reduces
The hit rate of cache, have impact on the overall performance of system.
3rd, because cloud computing system has substantial amounts of virtual machine to constitute, therefore, the CFS scheduling strategy of acquiescence is not suitable for cloud very much
Computing system.
Content of the invention
The technical problem relatively low in order to solve virtual machine performance in prior art, the present invention proposes a kind of virtual machine task and adjusts
Degree method and system.
One aspect of the present invention, provides a kind of virtual machine method for scheduling task, including:Whether detection current task belongs to
Virtual robot arm;When described current task belongs to virtual robot arm, process described current task;When described current task is not belonging to void
When intending unit, according to the algorithms selection next task of acquiescence.
The method also includes:Other tasks dispatched in the affiliated virtual robot arm of described current task are processed, until time
Go through the task of completely individual virtual robot arm.
The method also includes:When described current task belongs to virtual robot arm, detect whether described current task is interviewed
Asked;When described current task is accessed, exit described virtual robot arm, according to the algorithms selection next task of acquiescence;
When described current task is not visited, it is the mark that described current task setting has been accessed.
Another aspect of the present invention, provides a kind of virtual machine task scheduling system, including:Detection means, for detecting
Whether current task belongs to virtual robot arm;Dispatching device, for when described current task belongs to virtual robot arm, priority scheduling institute
State current task to be processed;When described current task is not belonging to virtual robot arm, appoint according to the algorithms selection of acquiescence is next
Business.
Wherein, dispatching device, other tasks being additionally operable in the affiliated virtual robot arm of current task described in priority scheduling are carried out
Process, until traveling through the task of completely individual virtual robot arm.
This system also includes arranging device.Described detection means, is additionally operable to when described current task belongs to virtual robot arm,
Detect whether described current task is accessed;Described dispatching device, for being accessed when described current task, exits
Described virtual robot arm, according to the algorithms selection next task of acquiescence;Described setting device, for not having when described current task
It is accessed, be the mark that described current task setting has been accessed.
The virtual machine method for scheduling task of the present invention and system, in task scheduling, can perceive the presence of virtual machine,
Thus prioritizing selection belongs to the task of virtual robot arm in task choosing, be equivalent to the priority that improve virtual machine, Jin Erti
The high performance of virtual machine.
In addition, the task of the same virtual machine of priority scheduling is so that continuously adjust between representing the multiple tasks of same virtual machine
Degree, improves the priority of virtual machine indirectly, greatly reduces the number of times of the context switching between uncorrelated task, improves
The hit rate of cache, and then improve the performance of whole system.
Further, by access flag(access)Limit the run time of virtual robot arm, will not produce due to certain
Individual virtual robot arm unrestrictedly runs and leads to the situation of other tasks " being died of hunger ", reduces most possibly based on virtual machine sense
The impact to system fairness and response time for the scheduling strategy known.
Brief description
Fig. 1 is the RBTree organization chart of task in CFS;
Fig. 2 is the packet configuration figure to task for the fair scheduling strategies based on virtual file control group;
Fig. 3 is the topology diagram of the CFS scheduling strategy task scheduling sequential tree of acquiescence;
Fig. 4 is the schematic flow sheet of virtual machine method for scheduling task embodiment of the present invention;
Fig. 5 is the topology diagram of the task scheduling sequential tree of scheduling strategy of the present invention;
Fig. 6 is the schematic flow sheet of another embodiment of virtual machine method for scheduling task of the present invention;
Fig. 7 is the structural representation of virtual machine task scheduling system embodiment of the present invention.
Specific embodiment
Below in conjunction with accompanying drawing, the present invention is described in detail.
As shown in figure 4, the idiographic flow of virtual machine method for scheduling task embodiment of the present invention is as follows:
Step 402, selects a task;
Step 404, judges whether current task belongs to virtual robot arm, if it is, execution step 406, if not, executing step
Rapid 410;
Step 406, is processed to this current task;
Step 408, other tasks in the scheduling affiliated virtual robot arm of current task are processed, until traversal completely individual void
Intend the task of unit;
Step 410, selects next task, such as CFS dispatching algorithm according to default algorithm.
Specifically, the present invention, in task data, increases the related data field of description virtual robot arm scheduling:Virtual robot arm is retouched
State symbol(Virtual Group Description, abbreviation VGP)With virtual robot arm institutional framework descriptor(Virtual Group
Organization Description, abbreviation VGOD).
Wherein VGP is used for indicating which virtual robot arm is task belong to, and for example, when VGP place field is space-time, representing should
Task is not belonging to virtual machine task;If VGP place field has value then it represents that this task belongs to virtual machine task.VGP can set
It is set to the descriptor of virtual robot arm group leader's task it is also possible to be set to point to the pointer of virtual robot arm group leader's task, can basis
Different systems is flexibly realized.
VGOD describes to belong to the organizational form of the task in same virtual robot arm, equally can be according to specific system
And flexibly realize, such as can be implemented as annular chain meter it is also possible to be embodied as array.
Increase the banner word of virtual robot arm perception in creating of task, such as CLONE_VM_GROUP, for leading in interface
Know the task that current creating of the task of system is belonging in some virtual robot arm, need to complete during task creation
The initialization of VGP and VGOD.
Specifically initial method is:VGP is assigned the task descriptor of father's task of establishment task, according to difference
Implementation method, in the institutional framework of the virtual robot arm task new creating of task being added to VGOD description.
Increase the overall controlling switch of the group scheduling strategy of virtual robot arm perception, for opening according to obstructed application scenarios
Or close the group scheduling strategy perceiving based on virtual robot arm, if defining, CONFIG_VM_GROUP is grand to mean that unlatching is based on
The group scheduling strategy of virtual machine aware, otherwise then it represents that being not turned on.
As shown in 5, the annular list that wherein dotted line is constituted represents virtual robot arm, and the direction of arrow represents in virtual robot arm
Dispatching sequence.Group scheduling strategy based on virtual machine aware, before choosing next task and running, all goes to judge current task
Whether belong to some virtual robot arm, if it is, other in the preferential same virtual robot arm of selection according to dotted line chained list
Business, until traversal completely individual virtual robot arm;Otherwise, to select task according to the CFS scheduling strategy of acquiescence.
It is changed into according to the group scheduling strategy task scheduling sequence based on virtual machine aware:
t1->t2->t4->t3->t5->t7->t9->t11->t8->t6->t10->t12
Switching between uncorrelated task:t4->T3, t3->T5, t6->T10, i.e. ICSC=3.
Can be seen that between uncorrelated task the number of times of switching from above-mentioned schedule sequences from being changed into 3 times for original 6 times, greatly
Reduce greatly between uncorrelated task the number of times of switching, and then the hit rate of cache can be greatly improved, finally realize whole system
The lifting of performance.
In the present embodiment, on the basis of the CFS scheduling strategy of acquiescence, increase the group scheduling strategy of virtual machine aware, be
System, in task scheduling, can perceive the presence of virtual machine, thus prioritizing selection belongs to virtual robot arm in task choosing
Task, is equivalent to the priority that improve virtual machine, and then improves the performance of virtual machine.
In addition, the task of the same virtual machine of priority scheduling is so that continuously adjust between representing the multiple tasks of same virtual machine
Degree, improves the priority of virtual machine indirectly, greatly reduces the number of times of the context switching between uncorrelated task, improves
The hit rate of cache, and then improve the performance of whole system.
According to the group scheduling strategy based on virtual machine aware, once have selected certain task in virtual robot arm, it will excellent
First select other tasks in this virtual robot arm, then, unless the task in current virtual unit is all run and completed, otherwise, that is,
Make the presence task also higher than task priority in current virtual unit, also cannot timely respond to, this not only can reduce entirely
The response time of system, also greatly destroy the fairness of CFS.
Based on the group scheduling algorithm of virtual machine aware, CFS fairness is broken due to introducing in order to minimally reduces
Bad, realize the compromise between performance and fairness, by increasing access flag access in task descriptor, for marking
Whether knowledge task is accessed in virtual robot arm, if all tasks are all accessed in current virtual unit, jumps out this
Virtual robot arm, the dispatching algorithm according to acquiescence selects next task.
As shown in fig. 6, the idiographic flow of another embodiment of virtual machine method for scheduling task of the present invention is as follows:
Step 602, after selection task, judges whether current task belongs to certain virtual robot arm, if it is, execution step 604,
If it is not, execution step 608;
Step 604, whether this task is accessed, if it is, execution step 608, if not, execution step 606;
Step 606, setting mark current task has been accessed for indicating in this virtual robot arm(access=1);
Step 608, selects next task according to default algorithm.
After selection task from virtual group, first determine whether the access flag of this task, if be accessed(access
=1), illustrate that the task in this virtual robot arm has been accessed once, just exit this virtual robot arm, the scheduling according to acquiescence is calculated
Method selects next task.
The Implementation of pseudocode of the present embodiment dispatching method is as follows:
In the present embodiment, on the one hand, by uncorrelated task context is reduced to the priority scheduling of virtual robot arm task
The number of times of switching(ICSC), improve the performance of system on the whole;On the other hand, by access flag(access)Limit
The run time of virtual robot arm, will not produce due to unrestricted operation of certain virtual robot arm and lead to other tasks " being died of hunger "
Situation, reduces the impact to system fairness and response time of scheduling strategy based on virtual machine aware most possibly.
Based on same inventive concept, the present invention also provides a kind of virtual machine task scheduling system embodiment, as shown in fig. 7,
This system embodiment includes:Detection means 71 and dispatching device 72.Wherein, whether detection means detection current task belongs to virtual
Unit;When current task belongs to virtual robot arm, priority scheduling current task is processed dispatching device;When current task does not belong to
When virtual robot arm, according to the algorithms selection next task of acquiescence.
Other tasks in the dispatching device also affiliated virtual robot arm of priority scheduling current task are processed, until having traveled through
The task of whole virtual robot arm.
Preferably, this system also includes arranging device 73.When current task belongs to virtual robot arm, detection means detection is worked as
Whether front task is accessed.When current task is accessed, exit virtual robot arm, dispatching device is according to the algorithm of acquiescence
Select next task.When current task is not visited, the mark that setting device has been accessed for current task setting.
It should be noted that:Only in order to illustrate rather than restriction, the present invention is also not limited to above-mentioned above example
Citing,, without departing from the technical scheme of the spirit and scope of the present invention and its improvement, it all should cover the right in the present invention for all
In claimed range.
Claims (6)
1. a kind of virtual machine method for scheduling task is it is characterised in that include:
Whether detection current task belongs to virtual robot arm;
When described current task belongs to virtual robot arm, process described current task;When described current task is not belonging to virtual machine
During group, according to the algorithms selection next task of acquiescence;
When described current task belongs to virtual robot arm, detect whether described current task is accessed;
When described current task is accessed, exit described virtual robot arm, according to the algorithms selection next task of acquiescence;
When described current task is not visited, it is the mark that described current task setting has been accessed.
2. method according to claim 1 is it is characterised in that also include:
Other tasks dispatched in the affiliated virtual robot arm of described current task are processed, until traversal completely individual virtual robot arm
Task.
3. method according to claim 1 and 2 is it is characterised in that whether detection current task belongs to virtual robot arm and include:
Detect in the task data of described current task, whether to comprise virtual robot arm statement symbol.
4. method according to claim 3 is it is characterised in that for the task of belonging to virtual robot arm, in its task data
Also include the virtual robot arm institutional framework descriptor of the institutional framework for describing virtual robot arm task.
5. a kind of virtual machine task scheduling system is it is characterised in that include:
Detection means, for detecting whether current task belongs to virtual robot arm;
Dispatching device, for when described current task belongs to virtual robot arm, current task described in priority scheduling is processed;When
When described current task is not belonging to virtual robot arm, according to the algorithms selection next task of acquiescence;
Wherein, described virtual machine task scheduling system also includes arranging device,
Described detection means, is additionally operable to when described current task belongs to virtual robot arm, detect described current task whether by
Accessed;
Described dispatching device, for being accessed when described current task, exits described virtual robot arm, according to the algorithm of acquiescence
Select next task;
Described setting device, for when described current task not visited, be that the setting of described current task is accessed
Mark.
6. system according to claim 5, it is characterised in that described dispatching device, is additionally operable to current described in priority scheduling
Other tasks in the affiliated virtual robot arm of task are processed, until traveling through the task of completely individual virtual robot arm.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210547958.3A CN103870313B (en) | 2012-12-17 | 2012-12-17 | Virtual machine task scheduling method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210547958.3A CN103870313B (en) | 2012-12-17 | 2012-12-17 | Virtual machine task scheduling method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103870313A CN103870313A (en) | 2014-06-18 |
CN103870313B true CN103870313B (en) | 2017-02-08 |
Family
ID=50908880
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210547958.3A Active CN103870313B (en) | 2012-12-17 | 2012-12-17 | Virtual machine task scheduling method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103870313B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9069594B1 (en) | 2012-12-27 | 2015-06-30 | Emc Corporation | Burst buffer appliance comprising multiple virtual machines |
CN105814864B (en) * | 2014-11-21 | 2019-06-07 | 华为技术有限公司 | A kind of input and output I/O request processing method and file server |
CN105550040B (en) * | 2015-12-29 | 2019-06-14 | 四川中电启明星信息技术有限公司 | CPU resources of virtual machine preservation algorithm based on KVM platform |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101008903A (en) * | 2006-01-23 | 2007-08-01 | 联想(北京)有限公司 | Virtual machine system and device access method thereof |
CN101408853A (en) * | 2008-10-27 | 2009-04-15 | 中国科学院计算技术研究所 | Apparatus and method for scheduling virtual machine |
CN101727351A (en) * | 2009-12-14 | 2010-06-09 | 北京航空航天大学 | Multicore platform-orientated asymmetrical dispatcher for monitor of virtual machine and dispatching method thereof |
CN101894047A (en) * | 2010-06-24 | 2010-11-24 | 北京航空航天大学 | Kernel virtual machine scheduling policy-based implementation method |
CN102012835A (en) * | 2010-12-22 | 2011-04-13 | 北京航空航天大学 | Virtual central processing unit (CPU) scheduling method capable of supporting software real-time application |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101773166B1 (en) * | 2011-02-21 | 2017-08-30 | 삼성전자주식회사 | Apparatus and method for control of virtual machine schedule time |
-
2012
- 2012-12-17 CN CN201210547958.3A patent/CN103870313B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101008903A (en) * | 2006-01-23 | 2007-08-01 | 联想(北京)有限公司 | Virtual machine system and device access method thereof |
CN101408853A (en) * | 2008-10-27 | 2009-04-15 | 中国科学院计算技术研究所 | Apparatus and method for scheduling virtual machine |
CN101727351A (en) * | 2009-12-14 | 2010-06-09 | 北京航空航天大学 | Multicore platform-orientated asymmetrical dispatcher for monitor of virtual machine and dispatching method thereof |
CN101894047A (en) * | 2010-06-24 | 2010-11-24 | 北京航空航天大学 | Kernel virtual machine scheduling policy-based implementation method |
CN102012835A (en) * | 2010-12-22 | 2011-04-13 | 北京航空航天大学 | Virtual central processing unit (CPU) scheduling method capable of supporting software real-time application |
Also Published As
Publication number | Publication date |
---|---|
CN103870313A (en) | 2014-06-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111813554A (en) | Task scheduling processing method and device, electronic equipment and storage medium | |
US9846589B2 (en) | Virtual machine placement optimization with generalized organizational scenarios | |
CN102902573B (en) | Task processing method and device based on shared resources | |
EP3285170A1 (en) | Application profiling job management system, program, and method | |
US8661023B1 (en) | Optimizing search query logic to speed retrieval | |
EP3092567B1 (en) | System and method for isolating i/o execution via compiler and os support | |
US10157155B2 (en) | Operating system-managed interrupt steering in multiprocessor systems | |
US20130198758A1 (en) | Task distribution method and apparatus for multi-core system | |
US9141677B2 (en) | Apparatus and method for arranging query | |
US20160110645A1 (en) | System and method for dynamically updating event configuration rule for processing complex event | |
KR101916294B1 (en) | Technologies for cloud data center analytics | |
CN108427602B (en) | Distributed computing task cooperative scheduling method and device | |
CN103870313B (en) | Virtual machine task scheduling method and system | |
CN106407231A (en) | A data multi-thread export method and system | |
Hu et al. | Improved heuristic job scheduling method to enhance throughput for big data analytics | |
US10489416B2 (en) | Optimizing and managing execution of hybrid flows | |
US11522834B2 (en) | Autotuning a virtual firewall | |
Phan et al. | Energy-driven straggler mitigation in MapReduce | |
Wang et al. | A model driven approach towards improving the performance of apache spark applications | |
Hu et al. | Research of scheduling strategy on OpenStack | |
US7536674B2 (en) | Method and system for configuring network processing software to exploit packet flow data locality | |
Deshmukh et al. | Avoiding slow running nodes in distributed systems | |
CN108228323A (en) | Hadoop method for scheduling task and device based on data locality | |
US20140215473A1 (en) | Objectives of operations executing across environments | |
WO2017085454A1 (en) | Fuzzy caching mechanism for thread execution layouts |
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 |