CN106598740A - System and method for limiting CPU (Central Processing Unit) occupancy rate of multi-thread program - Google Patents
System and method for limiting CPU (Central Processing Unit) occupancy rate of multi-thread program Download PDFInfo
- Publication number
- CN106598740A CN106598740A CN201611161496.6A CN201611161496A CN106598740A CN 106598740 A CN106598740 A CN 106598740A CN 201611161496 A CN201611161496 A CN 201611161496A CN 106598740 A CN106598740 A CN 106598740A
- Authority
- CN
- China
- Prior art keywords
- module
- business module
- cpu
- business
- priority
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 14
- 238000012545 processing Methods 0.000 title abstract description 6
- 238000012544 monitoring process Methods 0.000 claims abstract description 13
- 230000004044 response Effects 0.000 claims description 8
- 230000005059 dormancy Effects 0.000 claims description 3
- 238000005259 measurement Methods 0.000 claims description 3
- 230000002618 waking effect Effects 0.000 claims 1
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 230000002155 anti-virotic effect Effects 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000007634 remodeling Methods 0.000 description 1
- 239000000126 substance Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/5038—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/5018—Thread allocation
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention provides a system and a method for limiting the CPU (Central Processing Unit) occupancy rate of a multi-thread program. The system comprises a control module, a monitoring module and service modules, wherein the control module is used for checking the CPU utilization rate of the multi-thread program, setting a threshold value, starting and stopping execution of the service modules, registering started service modules to the monitoring module and deleting service modules finishing tasks; the monitoring module is used for calculating the CPU occupancy rate of each module and the CPU utilization rates of all modules, starting or running the service modules, informing the control module, and lowering or raising the priorities of the service modules according to the features of the service modules; and the service modules are used for executing services, and run in the system in a thread way. During limiting, the service modules of the multi-thread program are classified, so that the execution of the service modules can be stopped according to the priorities once the CPU occupancy rate is larger than a set value, and successful execution of main services of the system is ensured.
Description
Technical field
The present invention relates to computer program control field, especially needs timely corresponding and computation-intensive program
The control aspect of utilization rate.
Background technology
In the prior art, known technology be current operation system after installing, various softwares can be installed.Pressure
Contracting, decoder software, antivirus software, the agent software of each various kinds, office software.These softwares may during operation
Cause the behavior that the seemingly-dead of client or generation can not be responded, cause user experience poor.Particularly on some servers
Be not main business software running process in may take substantial amounts of cpu resources, cause the main business of server cannot
Perform.This method is exactly to solve how to ensure that program takes less cpu resources using multi-thread mechanism, and do not affect be
The problem that system main business is performed.
The content of the invention
The purpose of the present invention is aiming at the deficiency existing for prior art, and provides a kind of multithread programs that limit and take
The system and method for limiting of cpu utilization rates, the program realizes program and takes less cpu resources, has no effect on system main
The execution of business.
The system for limiting multithread programs occupancy cpu utilization rates of this programme, including such as lower module:
Control module, for checking the cpu busy percentage and given threshold of the multithread programs, starts, stops holding for business module
OK, the business module for starting is registered to monitoring module with the business module for deleting the task that completes;
Monitoring module, for calculating the cpu utilization rates of the cpu utilization rates shared by modules and whole modules;Start or
Operation business module simultaneously notifies control module, according to the cpu maximum occupation rates for being configured, adjusts the run time of modules;
According to the characteristic of business module, the priority of business module is reduced or improved;
Business module, for performing business, is run in systems in the way of thread.
The method that multithread programs take cpu utilization rates is limited, step is as follows:
1)The priority and type of each business module are set in multithread programs startup stage.When each business module starts with
The mode of thread is run in systems;
2)According to the type of service of current system, the cpu occupancies of the multithread programs are set;
3)When business module is not loaded with, the cpu occupancies of measurement and adjustment control module after adjustment is finished, control mould
Block will all the time take the cpu occupancies of the ratio;
4)After business module starts, monitoring module calculates first the cpu occupancies of each business module, and control module is accounted for
With rate, the cpu utilization rates of the multithread programs are calculated, if the cpu utilization rates of the multithread programs are less than setting value, no
Carry out any operation;If cpu utilization rates are higher than setting value, according to the classification and priority of business module, preferentially stop minimum
The execution of the business module of rank;
5)All business modules are all stopped operation, cannot also meet setting value, then control module carries out dormancy, concedes control mould
The cpu that block takes.
Wherein, in step 1)Middle business module is divided into different classifications according to its characteristic:Type of service to real-time response,
With higher priority, the execution of other types of service can be suspended, for not to response time requirement, with relatively low
Priority, can be by the business of higher priority to seizing, and the module that may be monitored at any time is out of service.Business module is responsible for holding
Row miscellaneous service, business module is divided into different types of service according to the property of business, and the type for having Real-Time Scheduling has batch processing
Type, different types of priority is different, and the priority of same type is also different.But the priority of Real-Time Scheduling
Higher than the priority of batch processing.When the business module for stopping is selected, in same type of business module, prioritizing selection pair
Cpu takes higher task.The business of real-time response only starts to stop such after the business of other classifications is all stopped,
Other business.
In step 4)In, if business module is stopped after execution, need to set the time that the business module is waken up next time
With the priority after wake-up, after same type of business module is waken up, the highest level of category priority, quilt will be in
The time that the business module of stopping is waken up next time will be arranged according to the cpu utilization rates for currently calculating and the multithread programs
Maximum value calculation goes out wakeup time.
In described step 4, when adjusting the business module priority being stopped, the priority of the business module being stopped will
Higher than the priority of the same type of business module not stopped, less than the same type of priority for stopping before.
The beneficial effect of this programme can be learnt according to the narration to such scheme, due in this scenario to multithread programs
Business module be classified, once so the occupancy of cpu be more than setting value, then can be stopped according to priority,
Ensure that the smooth execution of system main business.As can be seen here, the present invention is compared with prior art, special with prominent substance
Point and significant progress, its beneficial effect implemented is also obvious.
Description of the drawings
Fig. 1 is the structural representation of the specific embodiment of the invention.
Fig. 2 is the flow chart of the specific embodiment of the invention.
Specific embodiment
It is right below by a specific embodiment, and with reference to its accompanying drawing clearly to illustrate the technical characterstic of this programme
This programme is illustrated.
By accompanying drawing as can be seen that the system for limiting multithread programs occupancy cpu utilization rates of this programme of this programme, bag
Control module, monitoring module and business module are included,
Control module, for checking the cpu busy percentage and given threshold of the multithread programs, starts, stops holding for business module
OK, the business module for starting is registered to monitoring module with the business module for deleting the task that completes;Monitoring module, for calculating each
The cpu utilization rates of cpu utilization rates and whole modules shared by module;Start or run business module and notify to control mould
Block, according to the cpu maximum occupation rates for being configured, adjusts the run time of modules;According to the characteristic of business module, reduce or
Improve the priority of business module;Business module, for performing business, is run in systems in the way of thread.
Said system limits the method that multithread programs take cpu utilization rates, and step is as follows:
1)The priority and type of each business module are set in multithread programs startup stage.When each business module starts with
The mode of thread is run in systems;
2)According to the type of service of current system, the cpu occupancies of the multithread programs are set;
3)When business module is not loaded with, the cpu occupancies of measurement and adjustment control module after adjustment is finished, control mould
Block will all the time take the cpu occupancies of the ratio;
4)After business module starts, monitoring module calculates first the cpu occupancies of each business module, and control module is accounted for
With rate, the cpu utilization rates of the multithread programs are calculated, if the cpu utilization rates of the multithread programs are less than setting value, no
Carry out any operation;If cpu utilization rates are higher than setting value, according to the classification and priority of business module, preferentially stop minimum
The execution of the business module of rank;
5)All business modules are all stopped operation, cannot also meet setting value, then control module carries out dormancy, concedes control mould
The cpu that block takes.
Wherein, in step 1)Middle business module is divided into different classifications according to its characteristic:Type of service to real-time response,
With higher priority, the execution of other types of service can be suspended, for not to response time requirement, with relatively low
Priority, can be by the business of higher priority to seizing, and the module that may be monitored at any time is out of service.Business module is responsible for holding
Row miscellaneous service, business module is divided into different types of service according to the property of business, and the type for having Real-Time Scheduling has batch processing
Type, different types of priority is different, and the priority of same type is also different.But the priority of Real-Time Scheduling
Higher than the priority of batch processing.When the business module for stopping is selected, in same type of business module, prioritizing selection pair
Cpu takes higher task.The business of real-time response only starts to stop such after the business of other classifications is all stopped,
Other business.
In step 4)In, if business module is stopped after execution, need to set the time that the business module is waken up next time
With the priority after wake-up, after same type of business module is waken up, the highest level of category priority, quilt will be in
The time that the business module of stopping is waken up next time will be arranged according to the cpu utilization rates for currently calculating and the multithread programs
Maximum value calculation goes out wakeup time.In described step 4, when adjusting the business module priority being stopped, the industry being stopped
The priority of business module will be above the priority of the same type of business module not stopped, less than the same type for stopping before
Priority.
The present invention is not limited in above-mentioned specific embodiment, essential scope of the those of ordinary skill in the art in the present invention
Change, remodeling, addition or the replacement inside made, should also belong to protection scope of the present invention.
Claims (7)
1. it is a kind of to limit the system that multithread programs take cpu utilization rates, it is characterised in that to include such as lower module:
Control module, for checking the cpu busy percentage and given threshold of the multithread programs, starts, stops holding for business module
OK, the business module for starting is registered to monitoring module with the business module for deleting the task that completes;
Monitoring module, for calculating the cpu utilization rates of the cpu utilization rates shared by modules and whole modules;Start or
Operation business module simultaneously notifies control module, according to the cpu maximum occupation rates for being configured, adjusts the run time of modules;
According to the characteristic of business module, the priority of business module is reduced or improved;
Business module, for performing business, is run in systems in the way of thread.
2. it is a kind of to limit the method that multithread programs take cpu utilization rates, it is characterised in that to comprise the steps:
1)The priority and type of each business module are set in multithread programs startup stage;
Each business module is run in systems when starting in the way of thread;
2)According to the type of service of current system, the cpu occupancies of the multithread programs are set;
3)When business module is not loaded with, the cpu occupancies of measurement and adjustment control module after adjustment is finished, control mould
Block will all the time take the cpu occupancies of the ratio;
4)After business module starts, monitoring module calculates first the cpu occupancies of each business module, and control module is accounted for
With rate, the cpu utilization rates of the multithread programs are calculated, if the cpu utilization rates of the multithread programs are less than setting value, no
Carry out any operation;If cpu utilization rates are higher than setting value, according to the classification and priority of business module, preferentially stop minimum
The execution of the business module of rank;
5)All business modules are all stopped operation, cannot also meet setting value, then control module carries out dormancy, concedes control mould
The cpu that block takes.
3. it is according to claim 2 to limit the method that multithread programs take cpu utilization rates, it is characterized in that:Described step
Rapid 1)Middle business module is divided into different classifications according to its characteristic:Type of service to real-time response, with higher priority,
The execution of other types of service can be suspended, for not to response time requirement, with relatively low priority, can be by higher
The business of priority is to seizing, and the module that may be monitored at any time is out of service.
4. it is according to claim 2 to limit the method that multithread programs take cpu utilization rates, it is characterized in that:Described step
It is preferential after needing to set time that the business module is waken up next time and waking up if business module is stopped after execution in rapid 4
Level, after same type of business module is waken up, by the highest level in category priority.
5. it is according to claim 4 to limit the method that multithread programs take cpu utilization rates, it is characterized in that:It is stopped
The maximum that the time that business module is waken up next time will be arranged according to the cpu utilization rates for currently calculating and the multithread programs
What is calculated goes out wakeup time.
6. it is according to claim 4 to limit the method that multithread programs take cpu utilization rates, it is characterized in that:Described step
Rapid 4)In, when adjusting the business module priority being stopped, it is same that the priority of the business module being stopped will be above not stopping
The priority of the business module of one type, less than the same type of priority for stopping before.
7. it is according to claim 2 to limit the method that multithread programs take cpu utilization rates, it is characterized in that:Step 4)In
When the business module for stopping is selected, in same type of business module, prioritizing selection takes higher task to cpu.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611161496.6A CN106598740B (en) | 2016-12-15 | 2016-12-15 | System and method for limiting CPU utilization rate occupied by multithreading program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611161496.6A CN106598740B (en) | 2016-12-15 | 2016-12-15 | System and method for limiting CPU utilization rate occupied by multithreading program |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106598740A true CN106598740A (en) | 2017-04-26 |
CN106598740B CN106598740B (en) | 2020-11-27 |
Family
ID=58802658
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611161496.6A Active CN106598740B (en) | 2016-12-15 | 2016-12-15 | System and method for limiting CPU utilization rate occupied by multithreading program |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106598740B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107423123A (en) * | 2017-07-25 | 2017-12-01 | 广东欧珀移动通信有限公司 | Method for scheduling task, device, storage medium and electronic equipment |
CN109324878A (en) * | 2018-09-20 | 2019-02-12 | 郑州云海信息技术有限公司 | A kind of control method and relevant device of process CPU usage |
CN110768910A (en) * | 2018-07-25 | 2020-02-07 | 视联动力信息技术股份有限公司 | Data transmission method and device |
CN111580955A (en) * | 2020-04-03 | 2020-08-25 | 上海非码网络科技有限公司 | Intelligent analysis system and method for computer utilization rate |
CN112291205A (en) * | 2020-10-13 | 2021-01-29 | 杭州迪普科技股份有限公司 | Control method and device for deep packet inspection service and computer equipment |
CN112737835A (en) * | 2020-12-25 | 2021-04-30 | 北京浪潮数据技术有限公司 | Cloud host business management method and related device |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001043096A (en) * | 1999-07-29 | 2001-02-16 | Atr Adaptive Communications Res Lab | Scheduling method in software real time |
CN101056264A (en) * | 2007-04-25 | 2007-10-17 | 华为技术有限公司 | Traffic control method and service processing system |
CN101227289A (en) * | 2008-02-02 | 2008-07-23 | 华为技术有限公司 | Uniform intimidation managing device and loading method of intimidation defense module |
US20080313639A1 (en) * | 2007-06-13 | 2008-12-18 | Krishna Kumar | Policy based scheduling of software applications |
CN101984414A (en) * | 2010-11-05 | 2011-03-09 | 中兴通讯股份有限公司 | Method and device for scheduling central processing unit (CPU) resource |
CN102779066A (en) * | 2012-06-14 | 2012-11-14 | 中国电子科技集团公司第四十一研究所 | Method for reducing influence of antivirus software on operational efficiency of test instrument |
US20140007106A1 (en) * | 2012-07-02 | 2014-01-02 | Arnold S. Weksler | Display and Terminate Running Applications |
-
2016
- 2016-12-15 CN CN201611161496.6A patent/CN106598740B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001043096A (en) * | 1999-07-29 | 2001-02-16 | Atr Adaptive Communications Res Lab | Scheduling method in software real time |
CN101056264A (en) * | 2007-04-25 | 2007-10-17 | 华为技术有限公司 | Traffic control method and service processing system |
US20080313639A1 (en) * | 2007-06-13 | 2008-12-18 | Krishna Kumar | Policy based scheduling of software applications |
CN101227289A (en) * | 2008-02-02 | 2008-07-23 | 华为技术有限公司 | Uniform intimidation managing device and loading method of intimidation defense module |
CN101984414A (en) * | 2010-11-05 | 2011-03-09 | 中兴通讯股份有限公司 | Method and device for scheduling central processing unit (CPU) resource |
CN102779066A (en) * | 2012-06-14 | 2012-11-14 | 中国电子科技集团公司第四十一研究所 | Method for reducing influence of antivirus software on operational efficiency of test instrument |
US20140007106A1 (en) * | 2012-07-02 | 2014-01-02 | Arnold S. Weksler | Display and Terminate Running Applications |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107423123A (en) * | 2017-07-25 | 2017-12-01 | 广东欧珀移动通信有限公司 | Method for scheduling task, device, storage medium and electronic equipment |
CN110768910A (en) * | 2018-07-25 | 2020-02-07 | 视联动力信息技术股份有限公司 | Data transmission method and device |
CN109324878A (en) * | 2018-09-20 | 2019-02-12 | 郑州云海信息技术有限公司 | A kind of control method and relevant device of process CPU usage |
CN111580955A (en) * | 2020-04-03 | 2020-08-25 | 上海非码网络科技有限公司 | Intelligent analysis system and method for computer utilization rate |
CN112291205A (en) * | 2020-10-13 | 2021-01-29 | 杭州迪普科技股份有限公司 | Control method and device for deep packet inspection service and computer equipment |
CN112737835A (en) * | 2020-12-25 | 2021-04-30 | 北京浪潮数据技术有限公司 | Cloud host business management method and related device |
Also Published As
Publication number | Publication date |
---|---|
CN106598740B (en) | 2020-11-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106598740A (en) | System and method for limiting CPU (Central Processing Unit) occupancy rate of multi-thread program | |
WO2017080273A1 (en) | Task management methods and system, and computer storage medium | |
US20160292017A1 (en) | Traffic control method and system | |
US9104498B2 (en) | Maximizing server utilization within a datacenter | |
US9875145B2 (en) | Load based dynamic resource sets | |
CN104006488B (en) | Air-conditioner control system and the method controlling operation of air conditioner thereof | |
CN103353853A (en) | Automatic load adjusting method | |
US9037880B2 (en) | Method and system for automated application layer power management solution for serverside applications | |
US20120324000A1 (en) | System and method for flow control in a messaging subsystem based on message-in/out rates | |
CN107797853B (en) | Task scheduling method and device and multi-core processor | |
CN104850460A (en) | Service program thread management method | |
CN109962856B (en) | Resource allocation method, device and computer readable storage medium | |
US10467054B2 (en) | Resource management method and system, and computer storage medium | |
WO2011088261A2 (en) | Methods and apparatus for coordinated energy management in virtualized data centers | |
WO2019134292A1 (en) | Container allocation method and apparatus, server and medium | |
CN103179048A (en) | Method and system for changing main machine quality of service (QoS) strategies of cloud data center | |
WO2021253851A1 (en) | Cluster distributed resource scheduling method, apparatus and device, and storage medium | |
CN104461731B (en) | Resources of virtual machine recovery method and device in a kind of dynamic resource extension | |
WO2023115931A1 (en) | Big-data component parameter adjustment method and apparatus, and electronic device and storage medium | |
CN106445636B (en) | A kind of dynamic resource scheduling algorithm under PAAS platform | |
CN105302641A (en) | Node scheduling method and apparatus in virtual cluster | |
Liao et al. | Auto-scaling strategy for amazon web services in cloud computing | |
CN107203256B (en) | Energy-saving distribution method and device under network function virtualization scene | |
CN103677959A (en) | Virtual machine cluster migration method and system based on multicast | |
CN106648847A (en) | Asynchronous task management method and device in cloud computing operation system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20201102 Address after: 215100 No. 1 Guanpu Road, Guoxiang Street, Wuzhong Economic Development Zone, Suzhou City, Jiangsu Province Applicant after: SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd. Address before: 450000 Henan province Zheng Dong New District of Zhengzhou City Xinyi Road No. 278 16 floor room 1601 Applicant before: ZHENGZHOU YUNHAI INFORMATION TECHNOLOGY Co.,Ltd. |
|
TA01 | Transfer of patent application right | ||
GR01 | Patent grant | ||
GR01 | Patent grant |