CN109471733A - A kind of resource control method and device - Google Patents
A kind of resource control method and device Download PDFInfo
- Publication number
- CN109471733A CN109471733A CN201811399681.8A CN201811399681A CN109471733A CN 109471733 A CN109471733 A CN 109471733A CN 201811399681 A CN201811399681 A CN 201811399681A CN 109471733 A CN109471733 A CN 109471733A
- Authority
- CN
- China
- Prior art keywords
- service unit
- current
- flexible strategy
- gpu
- total quantity
- 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.)
- Pending
Links
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
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 application provides a kind of resource control method and device, which comprises obtains the graphics processor GPU information and memory information of each service unit;Flexible strategy is determined according to the GPU information of each service unit, memory information and current service unit total quantity, and the flexible strategy is for controlling the quantity of service unit.Through the above technical solutions, can predict that the resource quantity of service is effectively controlled to deep learning.
Description
Technical field
The present invention relates to computer field more particularly to a kind of resource control methods and device.
Background technique
Generally there are two types of methods for elastic telescopic: horizontal extension and vertical telescopic.Horizontal extension is the number of additions and deletions service unit
Amount, vertical telescopic is the resource for changing each service unit.(one increasing income, more in cloud platform for managing by Kubernetes
The application of containerization on a host) official use HPA (Horizontal service unit Autoscaling, horizontal extension)
Strategy is that (the minimum deployment unit in Kubernetes is made of one group of tightly coupled container according to each service unit Pod
Container group) CPU (Central Processing Unit, central processing unit) monitoring data, determine increase/deletion Pod number
Amount.In the epoch of deep learning, many companies both provide the prediction service of deep learning, and many cloud service platforms are bases
In Kubernetes clustered deploy(ment).The prediction service of deep learning is not different with common service in itself, but
In operational process, common service relys more on CPU, and the prediction of deep learning service is smaller to the dependence of CPU, passes through CPU
Monitoring data control can not effectively control the quantity of Pod.
Summary of the invention
The application technology to be solved is to provide a kind of resource control method and device, can predict to take to deep learning
The resource quantity of business is effectively controlled.
In order to solve the above-mentioned technical problem, this application provides a kind of resource control methods, which comprises
Obtain the graphics processor GPU information and memory information of each service unit;
Flexible strategy is determined according to the GPU information of each service unit, memory information and current service unit total quantity,
The flexible strategy is for controlling the quantity of service unit.
Optionally, described true according to the GPU information of each service unit, memory information and current service unit total quantity
Flexible strategy includes: calmly
The GPU utilization rate of each service unit is calculated according to the GPU information of each service unit;
The memory usage of each service unit is calculated according to the memory information of each service unit;
It is determined according to the GPU utilization rate of each service unit, memory usage and current service unit total quantity flexible
Strategy.
Optionally, true according to the GPU utilization rate of each service unit, memory usage and current service unit total quantity
Flexible strategy includes: calmly
When meeting following either condition, flexible strategy is determined to increase service unit:
The average GPU utilization rate of current all service units is greater than first threshold, and current service unit total quantity is less than
Service unit quantity max-thresholds;
The average memory usage of current all service units is greater than second threshold, and current service unit total quantity is less than
Service unit quantity max-thresholds.
Optionally, described according to the GPU utilization rate of each service unit, memory usage and current service unit sum
Amount determines that flexible strategy includes:
If the average GPU utilization rate of current all service units and average memory usage are respectively less than third threshold value, and work as
Preceding service unit total quantity is greater than service unit quantity minimum threshold, it is determined that flexible strategy is for deletion service unit and/or temporarily
Stop service unit.
Optionally, described true according to the GPU information of each service unit, memory information and current service unit total quantity
After fixed flexible strategy, the method also includes:
Execute the corresponding operation of the flexible strategy.
The application also provides a kind of resource control, comprising: memory and processor;The memory, for saving
Program for resources control;
The processor executes the program for being used for resources control for reading, performs the following operations:
Obtain the graphics processor GPU information and memory information of each service unit;
Flexible strategy is determined according to the GPU information of each service unit, memory information and current service unit total quantity,
The flexible strategy is for controlling the quantity of service unit.
Optionally, described true according to the GPU information of each service unit, memory information and current service unit total quantity
Flexible strategy includes: calmly
The GPU utilization rate of each service unit is calculated according to the GPU information of each service unit;
The memory usage of each service unit is calculated according to the memory information of each service unit;
It is determined according to the GPU utilization rate of each service unit, memory usage and current service unit total quantity flexible
Strategy.
Optionally, true according to the GPU utilization rate of each service unit, memory usage and current service unit total quantity
Flexible strategy includes: calmly
When meeting following either condition, flexible strategy is determined to increase service unit:
The average GPU utilization rate of current all service units is greater than first threshold, and current service unit total quantity is less than
Service unit quantity max-thresholds;
The average memory usage of current all service units is greater than second threshold, and current service unit total quantity is less than
Service unit quantity max-thresholds.
Optionally, described according to the GPU utilization rate of each service unit, memory usage and current service unit sum
Amount determines that flexible strategy includes:
If the average GPU utilization rate of current all service units and average memory usage are respectively less than third threshold value, and work as
Preceding service unit total quantity is greater than service unit quantity minimum threshold, it is determined that flexible strategy is for deletion service unit and/or temporarily
Stop service unit.
Optionally, the processor executes the program for being used for resources control for reading, also performs the following operations:
Described determined according to the GPU information of each service unit, memory information and current service unit total quantity is stretched
After strategy, the corresponding operation of the flexible strategy is executed.
Compared with prior art, the application includes: to obtain the graphics processor GPU information and memory letter of each service unit
Breath;Flexible strategy is determined according to the GPU information of each service unit, memory information and current service unit total quantity, it is described
Flexible strategy is for controlling the quantity of service unit.Through the above technical solutions, can predict deep learning the resource of service
Quantity is effectively controlled.
Detailed description of the invention
Fig. 1 is the flow diagram of the resource control method of the embodiment of the present invention one;
Fig. 2 is another flow diagram of the resource control method of the embodiment of the present invention one;
Fig. 3 is the structural schematic diagram of the resource control of the embodiment of the present invention one.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention
Embodiment be described in detail.It should be noted that in the absence of conflict, in the embodiment and embodiment in the application
Feature can mutual any combination.
Step shown in the flowchart of the accompanying drawings can be in a computer system such as a set of computer executable instructions
It executes.Also, although logical order is shown in flow charts, and it in some cases, can be to be different from herein suitable
Sequence executes shown or described step.
Embodiment one
As shown in Figure 1, the present embodiment provides a kind of resource control methods, which comprises
Step S100, GPU (Graphics Processing Unit, the graphics processor) letter of each service unit is obtained
Breath and memory information;
Step S102, it is determined according to the GPU information of each service unit, memory information and current service unit total quantity
Flexible strategy, the flexible strategy is for controlling the quantity of service unit.
Optionally, described true according to the GPU information of each service unit, memory information and current service unit total quantity
Flexible strategy may include: calmly
The GPU utilization rate of each service unit is calculated according to the GPU information of each service unit;
The memory usage of each service unit is calculated according to the memory information of each service unit;
It is determined according to the GPU utilization rate of each service unit, memory usage and current service unit total quantity flexible
Strategy.
Optionally, true according to the GPU utilization rate of each service unit, memory usage and current service unit total quantity
Flexible strategy may include: calmly
When meeting following either condition, flexible strategy is determined to increase service unit:
The average GPU utilization rate of current all service units is greater than first threshold, and current service unit total quantity is less than
Service unit quantity max-thresholds;
The average memory usage of current all service units is greater than second threshold, and current service unit total quantity is less than
Service unit quantity max-thresholds.
In addition to it can determine flexible strategy to increase service unit when meeting above-mentioned condition, in other embodiments, also
Other conditions that can increase service unit can be set.For example, can set when in the GPU utilization rate of all service units
Maximum value is greater than first threshold and when current service unit total quantity is less than service unit quantity max-thresholds, it is determined that flexible plan
Slightly increase service unit;Or it can also set when the maximum value in the memory usage of all service units is greater than the second threshold
Value and when current service unit total quantity is less than service unit quantity max-thresholds, it is determined that flexible strategy is single to increase service
Member.
It above are only for example, in other embodiments, it can be according to the utilization rate of the GPU of each service unit, interior
The total quantity of utilization rate and current service unit is deposited, setting can increase the various conditional combinations of service unit, different herein
One enumerates.
Optionally, described according to the GPU utilization rate of each service unit, memory usage and current service unit sum
Amount determines that flexible strategy may include:
If the average GPU utilization rate of current all service units and average memory usage are respectively less than third threshold value, and work as
Preceding service unit total quantity is greater than service unit quantity minimum threshold, it is determined that flexible strategy is for deletion service unit and/or temporarily
Stop service unit.
In addition to it can determine flexible strategy for deletion and/or unit out of service when meeting above-mentioned condition, in other realities
It applies in example, other can delete and/or the condition of unit out of service can also be set.For example, can set when all services
The minimum of minimum value and memory usage in the GPU utilization rate of unit is respectively less than third threshold value and current service unit sum
When measuring greater than service unit quantity minimum threshold, it is determined that flexible strategy is deletion and/or unit out of service.
It above are only for example, in other embodiments, it can be according to the utilization rate of the GPU of each service unit, interior
The total quantity of utilization rate and current service unit is deposited, setting can delete and/or the various conditional combinations of unit out of service,
It is numerous to list herein.
It should be noted that first threshold, second threshold and third threshold value between any two can be equal, it can not also phase
Deng.
Optionally, as shown in Fig. 2, it is described according to the GPU information of each service unit, memory information and current service list
After first total quantity determines flexible strategy, the method can also include:
Step S104, the corresponding operation of the flexible strategy is executed.
In the present embodiment, service unit can be the minimum deployment unit Pod in Kubernetes, and Pod is by one group of tight coupling
The container group of the container composition of conjunction.Flexible strategy can be determined according to the GPU information and memory information of Pod by Kubernetes,
After determining flexible strategy, Kubernetes controls the quantity of Pod according to the content for the strategy that stretches.
When needing to increase Pod quantity, Kubernetes can determine increased quantity according to system mechanism, such as often hold
The primary operation for increasing Pod of row can increase by 4 Pod, alternatively, the primary operation for increasing Pod of every execution can increase by 8 Pod.
It above are only example, specifically increase that how many Pod can set corresponding mechanism in Kubernetes.
Equally, when needing to delete Pod quantity, Kubernetes can determine the quantity deleted, example according to system mechanism
If the primary operation for deleting Pod of every execution can delete 2 Pod, alternatively, the primary operation for deleting Pod of every execution can delete 4
A Pod.It above are only example, specifically delete that how many Pod can set corresponding mechanism in Kubernetes.
Through the above technical solutions, can predict that the resource quantity of service is effectively controlled to deep learning.
As shown in figure 3, the present embodiment also provides a kind of resource control, comprising: memory 10 and processor 20;
The memory 10, for saving the program for being used for resources control;
The processor 20 is performed the following operations for reading the program for executing the resources control:
Obtain the graphics processor GPU information and memory information of each service unit;
Flexible strategy is determined according to the GPU information of each service unit, memory information and current service unit total quantity,
The flexible strategy is for controlling the quantity of service unit.
Optionally, described true according to the GPU information of each service unit, memory information and current service unit total quantity
Flexible strategy may include: calmly
The GPU utilization rate of each service unit is calculated according to the GPU information of each service unit;
The memory usage of each service unit is calculated according to the memory information of each service unit;
It is determined according to the GPU utilization rate of each service unit, memory usage and current service unit total quantity flexible
Strategy.
Optionally, true according to the GPU utilization rate of each service unit, memory usage and current service unit total quantity
Flexible strategy may include: calmly
When meeting following either condition, flexible strategy is determined to increase service unit:
The average GPU utilization rate of current all service units is greater than first threshold, and current service unit total quantity is less than
Service unit quantity max-thresholds;
The average memory usage of current all service units is greater than second threshold, and current service unit total quantity is less than
Service unit quantity max-thresholds.
Optionally, described according to the GPU utilization rate of each service unit, memory usage and current service unit sum
Amount determines that flexible strategy may include:
If the average GPU utilization rate of current all service units and average memory usage are respectively less than third threshold value, and work as
Preceding service unit total quantity is greater than service unit quantity minimum threshold, it is determined that flexible strategy is for deletion service unit and/or temporarily
Stop service unit.
Optionally, the processor 20, which is used to read, executes the program for being used for resources control, can also be performed as follows
Operation:
Described determined according to the GPU information of each service unit, memory information and current service unit total quantity is stretched
After strategy, the corresponding operation of the flexible strategy is executed.
Through the above technical solutions, can predict that the resource quantity of service is effectively controlled to deep learning.
Those of ordinary skill in the art will appreciate that all or part of the steps in the above method can be instructed by program
Related hardware is completed, and described program can store in computer readable storage medium, such as read-only memory, disk or CD
Deng.Optionally, one or more integrated circuits also can be used to realize, accordingly in all or part of the steps of above-described embodiment
Ground, each module/unit in above-described embodiment can take the form of hardware realization, can also use the shape of software function module
Formula is realized.The application is not limited to the combination of the hardware and software of any particular form.
The foregoing is merely preferred embodiment of the present application, are not intended to limit this application, for the skill of this field
For art personnel, various changes and changes are possible in this application.Within the spirit and principles of this application, made any to repair
Change, equivalent replacement, improvement etc., should be included within the scope of protection of this application.
Claims (10)
1. a kind of resource control method, which is characterized in that the described method includes:
Obtain the graphics processor GPU information and memory information of each service unit;
Flexible strategy is determined according to the GPU information of each service unit, memory information and current service unit total quantity, it is described
Flexible strategy is for controlling the quantity of service unit.
2. the method as described in claim 1, which is characterized in that described according to the GPU information of each service unit, memory information
And current service unit total quantity determines that flexible strategy includes:
The GPU utilization rate of each service unit is calculated according to the GPU information of each service unit;
The memory usage of each service unit is calculated according to the memory information of each service unit;
Flexible strategy is determined according to the GPU utilization rate of each service unit, memory usage and current service unit total quantity.
3. method according to claim 2, which is characterized in that according to the GPU utilization rate of each service unit, memory usage
And current service unit total quantity determines that flexible strategy includes:
When meeting following either condition, flexible strategy is determined to increase service unit:
The average GPU utilization rate of current all service units is greater than first threshold, and current service unit total quantity is less than service
Element number max-thresholds;
The average memory usage of current all service units is greater than second threshold, and current service unit total quantity is less than service
Element number max-thresholds.
4. method according to claim 2, which is characterized in that described to be made according to the GPU utilization rate of each service unit, memory
Determine that flexible strategy includes: with rate and current service unit total quantity
If the average GPU utilization rate of current all service units and average memory usage are respectively less than third threshold value, and current clothes
Unit total quantity of being engaged in is greater than service unit quantity minimum threshold, it is determined that flexible strategy is to delete service unit and/or pause clothes
Business unit.
5. the method as described in Claims 1-4 is any, it is characterised in that:
It is described that flexible strategy is determined according to the GPU information of each service unit, memory information and current service unit total quantity
Later, the method also includes:
Execute the corresponding operation of the flexible strategy.
6. a kind of resource control, comprising: memory and processor;It is characterized by:
The memory, for saving the program for being used for resources control;
The processor executes the program for being used for resources control for reading, performs the following operations:
Obtain the graphics processor GPU information and memory information of each service unit;
Flexible strategy is determined according to the GPU information of each service unit, memory information and current service unit total quantity, it is described
Flexible strategy is for controlling the quantity of service unit.
7. device as claimed in claim 6, which is characterized in that described according to the GPU information of each service unit, memory information
And current service unit total quantity determines that flexible strategy includes:
The GPU utilization rate of each service unit is calculated according to the GPU information of each service unit;
The memory usage of each service unit is calculated according to the memory information of each service unit;
Flexible strategy is determined according to the GPU utilization rate of each service unit, memory usage and current service unit total quantity.
8. device as claimed in claim 7, which is characterized in that according to the GPU utilization rate of each service unit, memory usage
And current service unit total quantity determines that flexible strategy includes:
When meeting following either condition, flexible strategy is determined to increase service unit:
The average GPU utilization rate of current all service units is greater than first threshold, and current service unit total quantity is less than service
Element number max-thresholds;
The average memory usage of current all service units is greater than second threshold, and current service unit total quantity is less than service
Element number max-thresholds.
9. device as claimed in claim 8, which is characterized in that described to be made according to the GPU utilization rate of each service unit, memory
Determine that flexible strategy includes: with rate and current service unit total quantity
If the average GPU utilization rate of current all service units and average memory usage are respectively less than third threshold value, and current clothes
Unit total quantity of being engaged in is greater than service unit quantity minimum threshold, it is determined that flexible strategy is to delete service unit and/or pause clothes
Business unit.
10. the device as described in claim 6 to 9 is any, it is characterised in that:
The processor executes the program for being used for resources control for reading, also performs the following operations:
It is described that flexible strategy is determined according to the GPU information of each service unit, memory information and current service unit total quantity
Later, the corresponding operation of the flexible strategy is executed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811399681.8A CN109471733A (en) | 2018-11-22 | 2018-11-22 | A kind of resource control method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811399681.8A CN109471733A (en) | 2018-11-22 | 2018-11-22 | A kind of resource control method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109471733A true CN109471733A (en) | 2019-03-15 |
Family
ID=65673056
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811399681.8A Pending CN109471733A (en) | 2018-11-22 | 2018-11-22 | A kind of resource control method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109471733A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113778617A (en) * | 2021-08-10 | 2021-12-10 | 万翼科技有限公司 | Container horizontal expansion method and device, electronic equipment and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106056529A (en) * | 2015-04-03 | 2016-10-26 | 阿里巴巴集团控股有限公司 | Method and equipment for training convolutional neural network used for image recognition |
CN106776014A (en) * | 2016-11-29 | 2017-05-31 | 科大讯飞股份有限公司 | Parallel acceleration method and system in Heterogeneous Computing |
CN107122245A (en) * | 2017-04-25 | 2017-09-01 | 上海交通大学 | GPU task dispatching method and system |
CN107135257A (en) * | 2017-04-28 | 2017-09-05 | 东方网力科技股份有限公司 | Task is distributed in a kind of node cluster method, node and system |
CN108733531A (en) * | 2017-04-13 | 2018-11-02 | 南京维拓科技有限公司 | GPU performance monitoring systems based on cloud computing |
CN108769100A (en) * | 2018-04-03 | 2018-11-06 | 郑州云海信息技术有限公司 | A kind of implementation method and its device based on kubernetes number of containers elastic telescopics |
-
2018
- 2018-11-22 CN CN201811399681.8A patent/CN109471733A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106056529A (en) * | 2015-04-03 | 2016-10-26 | 阿里巴巴集团控股有限公司 | Method and equipment for training convolutional neural network used for image recognition |
CN106776014A (en) * | 2016-11-29 | 2017-05-31 | 科大讯飞股份有限公司 | Parallel acceleration method and system in Heterogeneous Computing |
CN108733531A (en) * | 2017-04-13 | 2018-11-02 | 南京维拓科技有限公司 | GPU performance monitoring systems based on cloud computing |
CN107122245A (en) * | 2017-04-25 | 2017-09-01 | 上海交通大学 | GPU task dispatching method and system |
CN107135257A (en) * | 2017-04-28 | 2017-09-05 | 东方网力科技股份有限公司 | Task is distributed in a kind of node cluster method, node and system |
CN108769100A (en) * | 2018-04-03 | 2018-11-06 | 郑州云海信息技术有限公司 | A kind of implementation method and its device based on kubernetes number of containers elastic telescopics |
Non-Patent Citations (1)
Title |
---|
李周平: "《网络数据爬取与分析实务》", 30 September 2018 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113778617A (en) * | 2021-08-10 | 2021-12-10 | 万翼科技有限公司 | Container horizontal expansion method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111682954B (en) | Method, system, and computer readable medium for managing a network of microservices | |
EP3289485B1 (en) | Automatic demand-driven resource scaling for relational database-as-a-service | |
CN109062512A (en) | A kind of distributed storage cluster, data read-write method, system and relevant apparatus | |
US9384035B2 (en) | Virtual computer system, management computer, and virtual computer management method | |
US9274714B2 (en) | Method and system for managing storage capacity in a storage network | |
US20060031631A1 (en) | Method of managing storage capacity in storage system, a storage device and a computer system | |
US20140149707A1 (en) | Method and apparatus to manage tier information | |
US20080195404A1 (en) | Compliant-based service level objectives | |
US10417062B2 (en) | Method and apparatus of unloading out of memory processing flow to user space | |
CN103164268A (en) | System optimization method and system optimization device | |
CN104461746B (en) | A kind of memory headroom optimization method and system based on android system | |
CN100530111C (en) | Multi-thread access indirect register scheduling method | |
AU2015203316B2 (en) | Intelligent application back stack management | |
CN107977167A (en) | Optimization method is read in a kind of degeneration of distributed memory system based on correcting and eleting codes | |
US9135064B2 (en) | Fine grained adaptive throttling of background processes | |
CN110609807A (en) | Method, apparatus, and computer-readable storage medium for deleting snapshot data | |
CN106020752A (en) | Method and system for self-adaptation display | |
CN109471733A (en) | A kind of resource control method and device | |
US8732568B1 (en) | Systems and methods for managing workflows | |
CN109656479A (en) | A kind of method and device constructing memory command sequence | |
US20170289061A1 (en) | Soft reservation techniques and systems for virtualized environments | |
CN109375871A (en) | A kind of log processing method, system and electronic equipment and storage medium | |
US11636000B2 (en) | Method, device, and computer program product for managing processes based on reading speed of a message queue | |
US11269521B2 (en) | Method, device and computer program product for processing disk unavailability states | |
CN104750869A (en) | File management method and device |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190315 |
|
RJ01 | Rejection of invention patent application after publication |