CN103902364B - A kind of physical resource management method, apparatus and intelligent terminal - Google Patents
A kind of physical resource management method, apparatus and intelligent terminal Download PDFInfo
- Publication number
- CN103902364B CN103902364B CN201210571761.3A CN201210571761A CN103902364B CN 103902364 B CN103902364 B CN 103902364B CN 201210571761 A CN201210571761 A CN 201210571761A CN 103902364 B CN103902364 B CN 103902364B
- Authority
- CN
- China
- Prior art keywords
- task
- resource
- limiting value
- preset
- usage amount
- 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
Abstract
The embodiment of the invention discloses a kind of physical resource management method, apparatus and intelligent terminals, wherein the method includes:To the total resources usage amount of physical resource, the physical resource includes any one of memory source, central processor CPU resource, disk storage resource, network bandwidth resources for detection control group;When the total resources usage amount is more than preset first resource limiting value, the resource usage amount of the physical resource of included task in the control group is detected;The resource usage amount of the task is compared with for its preset Secondary resource limiting value, if comparison result meets interrupt condition, the task is interrupted, discharges the occupied resource of the task.Using the present invention, the interruption of physical resource can be neatly carried out, to carry out corresponding task isolation or remove to operate, is effectively improved the utilization rate of physical resource.
Description
Technical field
The present invention relates to physical resource management technical field more particularly to a kind of physical resource management method, apparatus and intelligence
It can terminal device.
Background technology
A group of planes (cluster) system is the set of the multiple physical machines independently calculated interconnected, these physical machines can
To be PC, work station or SMP (Symmetrical Multi-Processing, symmetric multi-processors) etc..A group of planes comes outside
Say it is a single system, it can provide high performance calculation process environment and fast and reliable service.
At present in the scheduling system of cluster resources, need to execute the resource allocation to different task task in each physical machine
And isolation.Task task before runtime, can according to its preset resource requirement to the system application physical resource of physical machine, with
Convenient for system it is that task task distributes physical resource appropriate to run task task, and the money therein to task task
Source isolation method includes then Linux container modes, and specific implementation is:
Limiting value is arranged to the physical resource of task task, when a certain task task in the process of running used in resource
When more than the limiting value, then task task can be removed immediately, and occupied such as memory, cpu resource can be released, or
Person can continue to run as a certain task task when used resource is more than the limiting value in the process of running, only work as physics
When the inadequate resources such as memory, the CPU of machine system, removal operation or the isolated operation to task task are just executed.
The problem of above two realization method, is:If used resource is more than pole to task task in the process of running
Limit value is removed, then may require that user when the limiting value of task task is arranged, needs to make according to task task in this way
Maximum memory amount is set, this is possible to cause the waste to physical resources such as memories;And another way is held
It easily causes Installed System Memory and exhausts OOM so that uncertainty increases when task task operations, and can influence task
The efficiency of task.
Invention content
Technical problem to be solved of the embodiment of the present invention is, provides a kind of physical resource management method, apparatus and intelligence
Energy terminal device, can neatly carry out the interruption of physical resource, to carry out corresponding task isolation or remove to operate.
In order to solve the above-mentioned technical problem, an embodiment of the present invention provides a kind of physical resource management methods, including:
To the total resources usage amount of physical resource, the physical resource includes memory source, centre for detection control group
Manage any one of device cpu resource, disk storage resource, network bandwidth resources;
When the total resources usage amount is more than preset first resource limiting value, detect included in the control group
The resource usage amount of the physical resource of task;
The resource usage amount of the task is compared with for its preset Secondary resource limiting value, if comparison result is full
Sufficient interrupt condition then interrupts the task, discharges the occupied resource of the task.
Wherein, the resource usage amount by the task is compared with for its preset Secondary resource limiting value, if
Comparison result meets interrupt condition, then interrupts the task, discharges the occupied resource of the task, including:
The resource usage amount of the task is compared with for its preset Secondary resource limiting value;
If the resource usage amount of the task is more than to be its preset Secondary resource limiting value, described appoint further is judged
The interrupt priority level of business;
If the interrupt priority level of the task is height, it is determined that the task meets preset interrupt condition, described in interruption
Task discharges the occupied resource of the task.
Wherein, judge the interrupt priority level of the task, including:Requirement according to the task to real-time, which determines, to be interrupted
Priority.
Wherein, the resource usage amount by the task is compared with for its preset Secondary resource limiting value, if
Comparison result meets interrupt condition, then interrupts the task, discharges the occupied resource of the task, including:
The resource usage amount of the task is compared with for its preset Secondary resource limiting value;
If it is its preset Secondary resource limiting value that the resource usage amount of the task, which is more than, described appoint further is judged
Whether the resource usage amount of business is more than the apllied resource of the task;
If more than, it is determined that the task meets preset interrupt condition, interrupts the task, discharges shared by the task
Resource.
Wherein, the resource usage amount by the task is compared with for its preset Secondary resource limiting value, if
Comparison result meets interrupt condition, then interrupts the task, discharges the occupied resource of the task, including:
The resource usage amount of the task is compared with for its preset Secondary resource limiting value;
If it is its preset Secondary resource limiting value that the resource usage amount of the task, which is more than, it is determined that the task is made
Resource is more than the Secondary resource limiting value amount of being more than;
If the task it is super excess of greater than preset more than threshold value or will be more than the ratio of amount and Secondary resource limiting value
Rate is more than preset rate threshold, then the determination task meets preset interrupt condition, interrupts the task, discharges institute
State the occupied resource of task.
Wherein, before the detection controls group to the total resources usage amount of physical resource, further include:
For the preset first resource limiting value of control group, and it is pre- for each task that the control group includes
Set Secondary resource limiting value, wherein the Secondary resource limiting value and be less than the first resource limiting value.
Correspondingly, the embodiment of the present invention additionally provides a kind of physical resource management device, including:
Detection module, the total resources usage amount for detecting control group to physical resource, and when the total resources use
When amount is more than preset first resource limiting value, the resource for detecting the physical resource of included task in the control group uses
Amount;The physical resource includes appointing in memory source, central processor CPU resource, disk storage resource, network bandwidth resources
It is a kind of;
Processing module, for comparing the resource usage amount of the task with for its preset Secondary resource limiting value
Compared with if comparison result meets interrupt condition, interrupting the task, discharge the occupied resource of the task.
Wherein, the processing module includes:
First comparing unit, for carrying out the resource usage amount of the task with for its preset Secondary resource limiting value
Compare;
First judging unit, if the resource usage amount for the task is more than to be its preset Secondary resource limiting value,
Then further judge the interrupt priority level of the task;
First processing units, if the interrupt priority level for the task is height, it is determined that the task meets preset
Interrupt condition interrupts the task, discharges the occupied resource of the task.
Wherein, the requirement determination that first judging unit is specifically used for according to the task to real-time is interrupted preferentially
Grade.
Wherein, the processing module includes:
Second comparing unit, for carrying out the resource usage amount of the task with for its preset Secondary resource limiting value
Compare;
Second judgment unit, if it is its preset Secondary resource limiting value that the resource usage amount for the task, which is more than,
Then further judge whether resource used in the task is more than the apllied resource of the task;
Second processing unit interrupts described appoint for meeting preset interrupt condition if more than, it is determined that the task
Business, discharges the occupied resource of the task.
Wherein, the processing module includes:
Third comparing unit, for carrying out the resource usage amount of the task with for its preset Secondary resource limiting value
Compare;
Third judging unit, if it is its preset Secondary resource limiting value that the resource usage amount for the task, which is more than,
Then determine that resource used in the task is more than the Secondary resource limiting value amount of being more than;
Third processing unit, if being more than threshold value or will be more than amount and the excess of greater than preset for the super of the task
The ratio of two resource limit values is more than preset rate threshold, then the determination task meets preset interrupt condition, in
The disconnected task, discharges the occupied resource of the task.
Wherein, further include:Preset module for being the preset first resource limiting value of control group, and is the control
The preset Secondary resource limiting value of each task that group processed includes, wherein the Secondary resource limiting value and be less than institute
State first resource limiting value.
Correspondingly, the embodiment of the present invention additionally provides a kind of intelligent terminal, including above-mentioned physical resource management dress
It sets.
Implement the embodiment of the present invention, has the advantages that:
By group in order to control, the first limiting value that its resource usage amount cannot exceed is set, and appointing under group in order to control
Business setting can have ready conditions the second limiting value exceeded, can more efficiently ensure it is certain to resource using undulate quantity it is larger or
Person user estimates that relatively low task being capable of normal operation to the resource usage amount of task, it is also ensured that system will not be because in order to control
The total resource usage amount of group is exceeded and leads to system resource nervous the problem of even collapsing, and is effectively improved physical resource profit
With rate.
Description of the drawings
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
Obtain other attached drawings according to these attached drawings.
Fig. 1 is a kind of flow diagram of physical resource management method of the embodiment of the present invention;
Fig. 2 is the one of which flow diagram of the judgement interrupt and the processing of the embodiment of the present invention;
Fig. 3 is the wherein another flow diagram of the judgement interrupt and the processing of the embodiment of the present invention;
Fig. 4 is wherein another flow diagram of the judgement interrupt and the processing of the embodiment of the present invention;
Fig. 5 is a kind of structure composition schematic diagram of physical resource management device of the embodiment of the present invention;
Fig. 6 is the structure composition schematic diagram of another physical resource management device of the embodiment of the present invention;
Fig. 7 is the one of which concrete structure schematic diagram of the processing module in Fig. 6;
Fig. 8 is wherein another concrete structure schematic diagram of the processing module in Fig. 6;
Fig. 9 is wherein another concrete mechanism schematic diagram of the processing module in Fig. 6.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art are obtained every other without creative efforts
Embodiment shall fall within the protection scope of the present invention.
Fig. 1 is referred to, is a kind of flow diagram of physical resource management method of the embodiment of the present invention;This method can be with
Applied in the cluster resources scheduling system of single physical machine or cloud computing platform, realize to including memory source, center
The scheduling of the physical resource of any one of processor cpu resource, disk storage resource, network bandwidth resources, specifically, described
Method includes:
S101:Detection control group to the total resources usage amount of physical resource, the physical resource include memory source, in
Any one of central processor cpu resource, disk storage resource, network bandwidth resources.
It includes one group of task task divided according to certain standard, object to control group cgroup (control group)
Any one task task can be added in the control group of existing standard in reason machine, can also be by a task task migration
To the control group cgroup of another respective standard.In the embodiment of the present invention to control group cgroup resources control first with
Entire control group cgroup is that first resource limiting value is arranged in unit, is then set to each task task under control group
Set the second limiting value.When the total resources usage amount of entirely control group is more than first resource limiting value, it is immediately performed corresponding
Interrupt operation is sentenced further according to the resource service condition for controlling each task task in group is corresponding to the progress of the second limiting value
It is disconnected, to be isolated or remove certain task task for meeting condition, when without being more than first resource limiting value, even if control race
Certain task task the second limiting values for being more than in group, then do not make to interrupt and judge, without being isolated or removal processing.
Before the S101, can also include:For the preset first resource limiting value of control group, and it is the control
The preset Secondary resource limiting value of each task that group processed includes, wherein the Secondary resource limiting value and be less than institute
State first resource limiting value.
S102:When the total resources usage amount is more than preset first resource limiting value, detect in the control group
The resource usage amount of the physical resource of included task.
Such as task manager may be used in the resource usage amount in total resources usage amount and S102 in the S101
Acquisition modes detect and obtain corresponding numerical value.
S103:The resource usage amount of the task is compared with for its preset Secondary resource limiting value, if comparing
As a result meet interrupt condition, then interrupt the task, discharge the occupied resource of the task.
When judging that a certain task task can be interrupted, the task can be directly removed, or using the side being temporarily isolating
The task is isolated in formula, in order to detect control group to the total resources usage amount of physical resource less than third limiting value
When, restore the task from isolated area, and continue to run with the task, the third limiting value is that user is rule of thumb arranged
A minimum angle value avoid the wasting of resources in order to make full use of physical resource.
In above-mentioned S102-S103, each task included in control group can be detected respectively simultaneously
And compare operation, behaviour can also be detected and compared to each task according to the sequence of the time of task start to process
Make.By the tasks interrupt therein for meeting interrupt condition in order to remove or be isolated in S103, and for being unsatisfactory for interrupting
The task of condition, then allow it to continue to execute.
Further specifically, refer to Fig. 2, be the embodiment of the present invention the judgement interrupt and processing wherein one
Kind method flow schematic diagram;The method of judgement and the processing of the terminal specifically includes:
S1011:The resource usage amount of the task is compared with for its preset Secondary resource limiting value.Including into
The comparison of line number value specifically may be used subtractive way and be compared.
S1012:If the resource usage amount of the task is more than to be its preset Secondary resource limiting value, further judge
The interrupt priority level of the task.
The interrupt priority level can carry out judgement determination according to the effect of the task, specifically can be according to the task pair
The requirement of real-time determines interrupt priority level, if higher to requirement of real-time, interrupt priority level is low, otherwise, for height.Example
Such as, if the task is the audio and video processing task about video conference, it may be determined that the real-time of audio and video processing task is wanted
Ask high, then its interrupt priority level is low, and for the document transmission processing task of some point-to-points, to requirement of real-time compared with
Low, interrupt priority level is then height, can be with priority interruption in order to removing or be isolated.
S1013:If the interrupt priority level of the task is height, it is determined that the task meets preset interrupt condition, in
The disconnected task, discharges the occupied resource of the task.
After the interruption, specifically can directly remove the task, discharge corresponding memory source, central processor CPU resource,
Disk storage resource, network bandwidth resources are medium.Or the task is isolated, first discharge corresponding memory source, central processing unit
Cpu resource, disk storage resource, network bandwidth resources are medium, then in control group to the total resources usage amount of physical resource
When relatively low, then the task restored from isolated area, to continue the task.
Fig. 3 is referred to again, is that the wherein another flow of the judgement interrupt and the processing of the embodiment of the present invention is shown
It is intended to;The method of judgement and the processing of the terminal specifically includes:
S1021:The resource usage amount of the task is compared with for its preset Secondary resource limiting value.Including into
The comparison of line number value specifically may be used subtractive way and be compared.
S1022:If it is its preset Secondary resource limiting value that the resource usage amount of the task, which is more than, further judge
Whether the resource usage amount of the task is more than the apllied resource of the task.
Any one task before treatment, needs to apply for the physical resources such as memory, CPU, the storage of corresponding amount, in order to
The physical resource of corresponding amount can be distributed to the task.If the resource usage amount of the task not only have exceeded for the task it is preset
Secondary resource limiting value, and when its resource usage amount is more than the task apllied resource, execute interrupt operation.It is no
Then, the interrupt operation to the task wouldn't be executed.
S1023:If more than, it is determined that the task meets preset interrupt condition, interrupts the task, and release is described to appoint
It is engaged in occupied resource.
After the interruption, specifically can directly remove the task, discharge corresponding memory source, central processor CPU resource,
Disk storage resource, network bandwidth resources are medium.Or the task is isolated, first discharge corresponding memory source, central processing unit
Cpu resource, disk storage resource, network bandwidth resources are medium, then in control group to the total resources usage amount of physical resource
When relatively low, then the task restored from isolated area, to continue the task.
Fig. 4 is wherein another flow diagram of the judgement interrupt and the processing of the embodiment of the present invention;
S1031:The resource usage amount of the task is compared with for its preset Secondary resource limiting value.Including into
The comparison of line number value specifically may be used subtractive way and be compared.
S1032:If it is its preset Secondary resource limiting value that the resource usage amount of the task, which is more than, it is determined that described
Resource used in business is more than the Secondary resource limiting value amount of being more than.It can be determined in such a way that subtraction seeks absolute value described super
It is excessive.
S1033:If the super of the task is more than threshold value or will be more than amount and the Secondary resource limit excess of greater than preset
The ratio of value is more than preset rate threshold, then the determination task meets preset interrupt condition, interrupts the task,
Discharge the occupied resource of the task.
After the interruption, specifically can directly remove the task, discharge corresponding memory source, central processor CPU resource,
Disk storage resource, network bandwidth resources are medium.Or the task is isolated, first discharge corresponding memory source, central processing unit
Cpu resource, disk storage resource, network bandwidth resources are medium, then in control group to the total resources usage amount of physical resource
When relatively low, then the task restored from isolated area, to continue the task.
By the description of above-described embodiment it is found that the specific following advantages of the present invention:
By group in order to control, the first limiting value that its resource usage amount cannot exceed is set, and appointing under group in order to control
Business setting can have ready conditions the second limiting value exceeded, can more efficiently ensure it is certain to resource using undulate quantity it is larger or
Person user estimates that relatively low task being capable of normal operation to the resource usage amount of task, it is also ensured that system will not be because in order to control
The total resource usage amount of group is exceeded and leads to system resource nervous the problem of even collapsing, and is effectively improved physical resource profit
With rate.
The device of the embodiment of the present invention is described in detail below.
Fig. 5 is referred to, is a kind of structure composition schematic diagram of physical resource management device of the embodiment of the present invention;The present invention
The physical resource management device of embodiment can be arranged for the group of planes to single physical machine or cloud computing platform
In resource scheduling system, or it is set up directly in all kinds of intelligent terminals, to complete to include memory source, central processing unit
The management of the physical resource of any one of cpu resource, disk storage resource, network bandwidth resources, described device specifically include:
Detection module 1, the total resources usage amount for detecting control group to physical resource, and when the total resources use
When amount is more than preset first resource limiting value, the resource for detecting the physical resource of included task in the control group uses
Amount;The physical resource includes appointing in memory source, central processor CPU resource, disk storage resource, network bandwidth resources
It is a kind of;
Processing module 2, for comparing the resource usage amount of the task with for its preset Secondary resource limiting value
Compared with if comparison result meets interrupt condition, interrupting the task, discharge the occupied resource of the task.
Control group cgroup includes one group of task task divided according to certain standard, any one in physical machine times
Business task can be added in the control group of existing standard, can also a task task be moved to another respective standard
Control group cgroup.To controlling the resources control of group cgroup first entirely to control group in the embodiment of the present invention
Cgroup is that first resource limiting value is arranged in unit, and second limit then is arranged to each task task under control group
Value.When the detection module 1 detects that the total resources usage amount of entire control group is more than first resource limiting value, by described
Processing module 2 is immediately performed corresponding interrupt operation, i.e. money of the processing module 2 further according to each task task in control group
Source service condition is corresponding to the progress of the second limiting value to be judged, to be isolated or remove certain task task for meeting condition, and is not had
When having more than first resource limiting value, even if the second limiting value that certain task task in control group are more than, then in not making
It is disconnected to judge, without being isolated or removal processing.
Such as task manager may be used in the total resources usage amount and resource usage amount that the detection module 1 detects
Acquisition modes detect and obtain corresponding numerical value.
When the processing module 2 judges that a certain task task can be interrupted, the task can be directly removed, or use
The task is isolated in the mode being temporarily isolating, in order to detect that controlling group is less than the total resources usage amount of physical resource
When third limiting value, restore the task from isolated area, and continue to run with the task, the third limiting value is user's root
A minimum angle value being arranged according to experience avoids the wasting of resources in order to make full use of physical resource.
The physical resource management device can be simultaneously respectively to controlling race by the detection module 1 and processing module 2
Each included task is detected and compares operation in group, can also be according to the sequence of the time of task start to process
Operation is detected and compared to each task.The processing module 2 is by the tasks interrupt therein for meeting interrupt condition
In order to remove or be isolated, and for being unsatisfactory for the task of interrupt condition, then it is allowed to continue to execute.
By the description of above-described embodiment it is found that the present invention has the following advantages:
By group in order to control, the first limiting value that its resource usage amount cannot exceed is set, and appointing under group in order to control
Business setting can have ready conditions the second limiting value exceeded, can more efficiently ensure it is certain to resource using undulate quantity it is larger or
Person user estimates that relatively low task being capable of normal operation to the resource usage amount of task, it is also ensured that system will not be because in order to control
The total resource usage amount of group is exceeded and leads to system resource nervous the problem of even collapsing, and is effectively improved physical resource profit
With rate.
Fig. 6 is the structure composition schematic diagram of another physical resource management device of the embodiment of the present invention;The present invention is implemented
The physical resource management device of example can be arranged for the cluster resources to single physical machine or cloud computing platform
In scheduling system, or it is set up directly in all kinds of intelligent terminals, to complete to include memory source, central processor CPU
The management of the physical resource of any one of resource, disk storage resource, network bandwidth resources, described device specifically includes above-mentioned
Detection module 1 in embodiment and processing module 2, in embodiments of the present invention, described device further includes:
Preset module 3 for being the preset first resource limiting value of control group, and is that the control group includes
The preset Secondary resource limiting value of each task, wherein the Secondary resource limiting value and be less than the first resource pole
Limit value.
It is the one of which concrete structure schematic diagram of the processing module in Fig. 6 further specifically, referring to Fig. 7 again,
In the embodiment of the present invention, the processing module 2 can specifically include:
First comparing unit 21, for by the resource usage amount of the task with for its preset Secondary resource limiting value into
Row compares;
First judging unit 22, if the resource usage amount for the task is more than to be its preset Secondary resource limit
Value, then further judge the interrupt priority level of the task;
First processing units 23, if the interrupt priority level for the task is height, it is determined that the task meets preset
Interrupt condition, interrupt the task, discharge the occupied resource of the task.
The more specific subtractive way that may be used that first comparing unit 21 can be used for executing numerical value is compared.
First judging unit 22 is specifically used for the requirement according to the task to real-time and determines that interrupt priority level, the interruption are excellent
First grade can carry out judgement determination according to the effect of the task, in can specifically being determined according to requirement of the task to real-time
Disconnected priority, if higher to requirement of real-time, interrupt priority level is low, otherwise, for height.For example, if the task be about
The audio and video of video conference handle task, it may be determined that the requirement of real-time that the audio and video handle task is high, then it is interrupted preferentially
Grade is low, and for the document transmission processing task of some point-to-points, relatively low to requirement of real-time, interrupt priority level is then height,
It can be with priority interruption in order to removing or be isolated.
After the interruption, the first processing units 23 specifically can directly remove the task, discharge corresponding memory source,
Central processor CPU resource, disk storage resource, network bandwidth resources are medium.Or the isolation of first processing units 23 should
Task, it is medium first to discharge corresponding memory source, central processor CPU resource, disk storage resource, network bandwidth resources, so
Afterwards control group it is relatively low to the total resources usage amount of physical resource when, then the task restored from isolated area, to continue
Carry out the task.
It is wherein another concrete structure schematic diagram of the processing module in Fig. 6 further specifically, referring to Fig. 8 again,
In embodiments of the present invention, the processing module 2 may include:
Second comparing unit 24, for by the resource usage amount of the task with for its preset Secondary resource limiting value into
Row compares;
Second judgment unit 25, if it is its preset Secondary resource limit that the resource usage amount for the task, which is more than,
Value, then further judge whether resource used in the task is more than the apllied resource of the task;
Second processing unit 26 interrupts described appoint for meeting preset interrupt condition if more than, it is determined that the task
Business, discharges the occupied resource of the task.
It includes carrying out the more specific of numerical value subtractive way may be used that second comparing unit 24, which is specifically used for executing,
It is compared.
Any one task before treatment, needs to apply for the physical resources such as memory, CPU, the storage of corresponding amount, in order to
The physical resource of corresponding amount can be distributed to the task.If the second judgment unit 25 judges the resource usage amount of the task
It not only has exceeded as the preset Secondary resource limiting value of the task, but also its resource usage amount is more than the apllied money of the task
When source, then otherwise the interrupt operation to the task wouldn't be executed by executing interrupt operation by the second processing unit 26.
After the interruption, the second processing unit 26 specifically can directly remove the task, discharge corresponding memory source,
Central processor CPU resource, disk storage resource, network bandwidth resources are medium.Or the isolation of second processing unit 26 should
Task, it is medium first to discharge corresponding memory source, central processor CPU resource, disk storage resource, network bandwidth resources, so
Afterwards control group it is relatively low to the total resources usage amount of physical resource when, then the task restored from isolated area, to continue
Carry out the task.
It is wherein another concrete mechanism schematic diagram of the processing module in Fig. 6 further specifically, referring to Fig. 9 again.
The processing module 2 can also include:
Third comparing unit 27, for by the resource usage amount of the task with for its preset Secondary resource limiting value into
Row compares;
Third judging unit 28, if it is its preset Secondary resource limit that the resource usage amount for the task, which is more than,
Value, it is determined that resource used in the task is more than the Secondary resource limiting value amount of being more than;
Third processing unit 29, if for the task it is super excess of greater than it is preset be more than threshold value or will be more than amount with
The ratio of Secondary resource limiting value is more than preset rate threshold, then the determination task meets preset interrupt condition,
The task is interrupted, the occupied resource of the task is discharged.
It includes carrying out the more specific of numerical value subtractive way may be used that the third comparing unit 27, which is specifically used for executing,
It is compared.The third judging unit 28 can determine that described is more than amount in such a way that subtraction seeks absolute value.
After the interruption, the third processing unit 29 specifically can directly remove the task, discharge corresponding memory source,
Central processor CPU resource, disk storage resource, network bandwidth resources are medium.Or the isolation of third processing unit 29 should
Task, it is medium first to discharge corresponding memory source, central processor CPU resource, disk storage resource, network bandwidth resources, so
Afterwards control group it is relatively low to the total resources usage amount of physical resource when, then the task restored from isolated area, to continue
Carry out the task.
It should be noted that the processing module 2 of the present embodiment can include specifically any in above-mentioned three kinds simultaneously
Or a variety of combinations, it can be specifically configured according to the needs of user, in order to complete accordingly to compare, judge and interrupt
Deng operation.
By the description of above-described embodiment it is found that the present invention has the following advantages:
By group in order to control, the first limiting value that its resource usage amount cannot exceed is set, and appointing under group in order to control
Business setting can have ready conditions the second limiting value exceeded, can more efficiently ensure it is certain to resource using undulate quantity it is larger or
Person user estimates that relatively low task being capable of normal operation to the resource usage amount of task, it is also ensured that system will not be because in order to control
The total resource usage amount of group is exceeded and leads to system resource nervous the problem of even collapsing, and is effectively improved physical resource profit
With rate.
One of ordinary skill in the art will appreciate that realizing all or part of flow in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the program can be stored in a computer read/write memory medium
In, the program is when being executed, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, the storage medium can be magnetic
Dish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access
Memory, RAM) etc..
The above disclosure is only the preferred embodiments of the present invention, cannot limit the right model of the present invention with this certainly
It encloses, therefore equivalent changes made in accordance with the claims of the present invention, is still within the scope of the present invention.
Claims (12)
1. a kind of physical resource management method, which is characterized in that including:
To the total resources usage amount of physical resource, the physical resource includes memory source, central processing unit for detection control group
Any one of cpu resource, disk storage resource, network bandwidth resources;
When the total resources usage amount is more than preset first resource limiting value, included task in the control group is detected
Physical resource resource usage amount;
The resource usage amount of the task is compared with for its preset Secondary resource limiting value, if during comparison result meets
Broken strip part then interrupts the task, discharges the occupied resource of the task;
Wherein, the first resource limiting value be for the control group it is preset, and it is described control group include it is every
One task is prefixed the Secondary resource limiting value, the Secondary resource limiting value and be less than the first resource limit
Value.
2. the method as described in claim 1, which is characterized in that the resource usage amount by the task with for its is preset
Secondary resource limiting value is compared, if comparison result meets interrupt condition, is interrupted the task, is discharged shared by the task
Resource, including:
The resource usage amount of the task is compared with for its preset Secondary resource limiting value;
If the resource usage amount of the task is more than to be its preset Secondary resource limiting value, the task is further judged
Interrupt priority level;
If the interrupt priority level of the task is height, it is determined that the task meets preset interrupt condition, interrupts the task,
Discharge the occupied resource of the task.
3. method as claimed in claim 2, which is characterized in that judge the interrupt priority level of the task, including:
Requirement according to the task to real-time determines interrupt priority level.
4. the method as described in claim 1, which is characterized in that the resource usage amount by the task with for its is preset
Secondary resource limiting value is compared, if comparison result meets interrupt condition, is interrupted the task, is discharged shared by the task
Resource, including:
The resource usage amount of the task is compared with for its preset Secondary resource limiting value;
If it is its preset Secondary resource limiting value that the resource usage amount of the task, which is more than, the task is further judged
Whether resource usage amount is more than the apllied resource of the task;
If more than, it is determined that the task meets preset interrupt condition, interrupts the task, and it is occupied to discharge the task
Resource.
5. the method as described in claim 1, which is characterized in that the resource usage amount by the task with for its is preset
Secondary resource limiting value is compared, if comparison result meets interrupt condition, is interrupted the task, is discharged shared by the task
Resource, including:
The resource usage amount of the task is compared with for its preset Secondary resource limiting value;
If it is its preset Secondary resource limiting value that the resource usage amount of the task, which is more than, it is determined that used in the task
Resource is more than the Secondary resource limiting value amount of being more than;
If the task it is super excess of greater than it is preset be more than threshold value or will be big with the ratio of Secondary resource limiting value more than measuring
In preset rate threshold, then the determination task meets preset interrupt condition, interrupts the task, and release is described to appoint
It is engaged in occupied resource.
6. a kind of physical resource management device, which is characterized in that including:
Detection module, the total resources usage amount for detecting control group to physical resource, and when the total resources usage amount is big
When preset first resource limiting value, the resource usage amount of the physical resource of included task in the control group is detected;
The physical resource includes any in memory source, central processor CPU resource, disk storage resource, network bandwidth resources
Kind;
Processing module, for the resource usage amount of the task to be compared with for its preset Secondary resource limiting value, if
Comparison result meets interrupt condition, then interrupts the task, discharges the occupied resource of the task;
Wherein, the first resource limiting value be for the control group it is preset, and it is described control group include it is every
One task is prefixed the Secondary resource limiting value, the Secondary resource limiting value and be less than the first resource limit
Value.
7. device as claimed in claim 6, which is characterized in that the processing module includes:
First comparing unit, for comparing the resource usage amount of the task with for its preset Secondary resource limiting value
Compared with;
First judging unit, if the resource usage amount for the task is more than to be its preset Secondary resource limiting value, into
One step judges the interrupt priority level of the task;
First processing units, if the interrupt priority level for the task is height, it is determined that the task meets preset interruption
Condition interrupts the task, discharges the occupied resource of the task.
8. device as claimed in claim 7, which is characterized in that first judging unit is specifically used for according to the task pair
The requirement of real-time determines interrupt priority level.
9. device as claimed in claim 6, which is characterized in that the processing module includes:
Second comparing unit, for comparing the resource usage amount of the task with for its preset Secondary resource limiting value
Compared with;
Second judgment unit, if it is its preset Secondary resource limiting value that the resource usage amount for the task, which is more than, into
One step judges whether resource used in the task is more than the apllied resource of the task;
Second processing unit, for if more than, it is determined that the task meets preset interrupt condition, interrupts the task, releases
Put the occupied resource of the task.
10. device as claimed in claim 6, which is characterized in that the processing module includes:
Third comparing unit, for comparing the resource usage amount of the task with for its preset Secondary resource limiting value
Compared with;
Third judging unit, if it is its preset Secondary resource limiting value that the resource usage amount for the task, which is more than, really
Resource used in the fixed task is more than the Secondary resource limiting value amount of being more than;
Third processing unit, if being more than threshold value or will be more than amount and the second money excess of greater than preset for the super of the task
The ratio of source electrode limit value is more than preset rate threshold, then the determination task meets preset interrupt condition, interrupts institute
Task is stated, the occupied resource of the task is discharged.
11. such as claim 6-10 any one of them devices, which is characterized in that further include:
Preset module, for be the preset first resource limiting value of control group, and for it is described control group include it is every
The preset Secondary resource limiting value of one task, wherein the Secondary resource limiting value and be less than the first resource limiting value.
12. a kind of intelligent terminal, which is characterized in that including such as claim 6-10 any one of them physical resource management
Device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210571761.3A CN103902364B (en) | 2012-12-25 | 2012-12-25 | A kind of physical resource management method, apparatus and intelligent terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210571761.3A CN103902364B (en) | 2012-12-25 | 2012-12-25 | A kind of physical resource management method, apparatus and intelligent terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103902364A CN103902364A (en) | 2014-07-02 |
CN103902364B true CN103902364B (en) | 2018-10-30 |
Family
ID=50993703
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210571761.3A Active CN103902364B (en) | 2012-12-25 | 2012-12-25 | A kind of physical resource management method, apparatus and intelligent terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103902364B (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105320559B (en) * | 2014-07-30 | 2019-02-19 | 中国移动通信集团广东有限公司 | A kind of dispatching method and device of cloud computing system |
CN106161559A (en) * | 2015-04-21 | 2016-11-23 | 阿尔卡特朗讯 | Method and device for the distribution of distributed storage network system shared resource |
CN105320561B (en) * | 2015-11-09 | 2019-03-08 | 深圳市万普拉斯科技有限公司 | Task management method and system |
CN105320570B (en) * | 2015-11-09 | 2019-01-29 | 深圳市万普拉斯科技有限公司 | Method for managing resource and system |
CN106776041B (en) * | 2016-12-30 | 2020-01-14 | Oppo广东移动通信有限公司 | Data processing method and device |
CN106951321B (en) * | 2017-02-13 | 2021-02-19 | 深信服科技股份有限公司 | Method and device for managing CPU (Central processing Unit) resources of virtual machine |
CN110888675B (en) * | 2018-09-11 | 2021-04-06 | 深圳云天励飞技术有限公司 | Hardware system and electronic device |
CN109582442A (en) * | 2018-11-30 | 2019-04-05 | 北京微播视界科技有限公司 | Processing method, electronic equipment and the computer storage medium of memory spilling OOM |
CN112948075B (en) * | 2021-02-04 | 2024-02-27 | 北京淇瑀信息科技有限公司 | Task congestion processing method and device and electronic equipment |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102708011A (en) * | 2012-05-11 | 2012-10-03 | 南京邮电大学 | Multistage load estimating method facing task scheduling of cloud computing platform |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8458324B2 (en) * | 2009-08-25 | 2013-06-04 | International Business Machines Corporation | Dynamically balancing resources in a server farm |
-
2012
- 2012-12-25 CN CN201210571761.3A patent/CN103902364B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102708011A (en) * | 2012-05-11 | 2012-10-03 | 南京邮电大学 | Multistage load estimating method facing task scheduling of cloud computing platform |
Also Published As
Publication number | Publication date |
---|---|
CN103902364A (en) | 2014-07-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103902364B (en) | A kind of physical resource management method, apparatus and intelligent terminal | |
CA2849565C (en) | Method, apparatus, and system for scheduling processor core in multiprocessor core system | |
WO2021121115A1 (en) | Virtual machine numa node scheduling method and apparatus, and device and medium | |
US10802877B2 (en) | Task management methods and system, and computer storage medium | |
CN104142860A (en) | Resource adjusting method and device of application service system | |
EP3129880A1 (en) | Method and device for augmenting and releasing capacity of computing resources in real-time stream computing system | |
CN107797853B (en) | Task scheduling method and device and multi-core processor | |
US10467054B2 (en) | Resource management method and system, and computer storage medium | |
CN107766145B (en) | Memory management method and device under dual systems | |
CN104539708A (en) | Capacity reduction method, device and system for cloud platform resources | |
CN111124687A (en) | CPU resource reservation method, device and related equipment | |
WO2021253851A1 (en) | Cluster distributed resource scheduling method, apparatus and device, and storage medium | |
CN112162835A (en) | Scheduling optimization method for real-time tasks in heterogeneous cloud environment | |
CN108874508A (en) | A kind of cloud computing virtual server system load equilibration scheduling method | |
CN105045667A (en) | Resource pool management method for vCPU scheduling of virtual machines | |
CN105760209B (en) | Remove method, apparatus and the automatic elastic group of virtual machine | |
CN115756866A (en) | Load balancing method, device and storage medium | |
CN108429704B (en) | Node resource allocation method and device | |
CN115391031A (en) | Load balancing scheduling method and computing equipment | |
CN114936106A (en) | Method, device and medium for processing host fault | |
WO2017030912A1 (en) | Using multiple central processing unit cores for packet forwarding in virtualized networks | |
CN110955644A (en) | IO control method, device, equipment and storage medium of storage system | |
CN111984406A (en) | Method, device and equipment for distributing CPU (Central processing Unit) resources in management process of virtualization platform | |
CN111240825A (en) | Memory configuration method of Docker cluster, storage medium and computer equipment | |
KR20150002270A (en) | Method and its apparatus for task load balancing for multicore system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20190805 Address after: Shenzhen Futian District City, Guangdong province 518057 Zhenxing Road, SEG Science Park 2 East Room 403 Co-patentee after: Tencent cloud computing (Beijing) limited liability company Patentee after: Tencent Technology (Shenzhen) Co., Ltd. Address before: Shenzhen Futian District City, Guangdong province 518057 Zhenxing Road, SEG Science Park 2 East Room 403 Patentee before: Tencent Technology (Shenzhen) Co., Ltd. |