CN107315643A - A kind of container resource regulating method - Google Patents
A kind of container resource regulating method Download PDFInfo
- Publication number
- CN107315643A CN107315643A CN201710485306.4A CN201710485306A CN107315643A CN 107315643 A CN107315643 A CN 107315643A CN 201710485306 A CN201710485306 A CN 201710485306A CN 107315643 A CN107315643 A CN 107315643A
- Authority
- CN
- China
- Prior art keywords
- node
- score
- nodes
- determine whether
- yes
- 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 OR CALCULATING; 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/5044—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 hardware capabilities
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明提供了一种容器资源调度方法,所述的方法包括以下步骤:S1:对节点进行评分;S2:选择得分最高的节点。通过上述设置,在资源允许的前提下,节省了网络传输镜像的带宽以及下载镜像所需的时间,提升的系统的运行效率,保证了系统的服务质量。
The present invention provides a container resource scheduling method, which includes the following steps: S1: scoring nodes; S2: selecting the node with the highest score. Through the above settings, under the premise of resource permitting, the bandwidth of network transmission mirroring and the time required for downloading mirroring are saved, the operating efficiency of the system is improved, and the service quality of the system is guaranteed.
Description
技术领域technical field
本发明涉及云计算技术领域,具体的说是一种容器资源调度方法。The invention relates to the technical field of cloud computing, in particular to a container resource scheduling method.
背景技术Background technique
随着云计算中容器技术迅猛发展以及容器技术的日益普及,越来越多的企业参与到容器技术当中,在云计算基础设施和服务中容器的使用量逐年增加,容器技术引发了信息技术的新一轮革命。目前,对于容器资源的分配主要采用以下几种方式:一种分配方式是根据接到指令的先后顺序来分配,这种方式没有考虑不同容器自身所需资源的大小,容易造成资源浪费;另一种分配方式是根据容器执行功能的不同来分配,这种方式下,虽然一定程度上实现了资源的配置,但是容器并不是固定不变的,执行的功能也是不同的,因此在资源配置上也会存在浪费的问题。With the rapid development of container technology in cloud computing and the increasing popularity of container technology, more and more enterprises are involved in container technology, and the use of containers in cloud computing infrastructure and services is increasing year by year. A new round of revolution. At present, the following methods are mainly used for the allocation of container resources: one allocation method is to allocate according to the order in which instructions are received, this method does not consider the size of resources required by different containers, which is easy to cause waste of resources; The first allocation method is to allocate according to the different execution functions of the containers. In this way, although the configuration of resources is realized to a certain extent, the containers are not fixed and the functions they perform are also different. Therefore, resource allocation is also different. There will be a waste problem.
发明内容Contents of the invention
为了解决上述问题,提供了一种容器资源调度方法,可以针对不同的容器分配相应的资源,大大提高了资源的利用率。In order to solve the above problems, a container resource scheduling method is provided, which can allocate corresponding resources for different containers, and greatly improve resource utilization.
本发明的一种具体实施例采用以下技术方案:A kind of specific embodiment of the present invention adopts following technical scheme:
一种容器资源调度方法,所述的方法包括以下步骤:A container resource scheduling method, said method comprising the following steps:
S1:对节点进行评分;S1: Score the nodes;
S2:选择得分最高的节点。S2: Select the node with the highest score.
进一步的,所述的方法还包括:Further, the method also includes:
S0:判断节点自身资源的大小,去除自身资源小于设定值的节点。S0: Determine the size of the node's own resources, and remove nodes whose resources are less than the set value.
进一步的,设定值的大小为100M。Further, the size of the set value is 100M.
进一步的,S1的具体实现过程为:Further, the specific implementation process of S1 is:
S11:设定镜像上限值max;S11: set the mirror image upper limit max;
S12:获取应用所需镜像值X1;S12: Obtain the image value X1 required by the application;
S13:获取某节点自身镜像值X2;S13: Obtain the self-image value X2 of a certain node;
S14:判断X1是否大于X2,若是,则该节点得分score=0;若否,进入S15;S14: Determine whether X1 is greater than X2, if yes, then the node score = 0; if not, go to S15;
S15:判断X2是否大于max,若是,则该节点得分score=100;若否,进入S16;S15: Determine whether X2 is greater than max, if yes, then the node score = 100; if not, go to S16;
S16:根据公式score=100*(X2-X1)/(max-X1)计算该节点得分;S16: Calculate the score of the node according to the formula score=100*(X2-X1)/(max-X1);
S17:重复步骤S13-S16,得到每一个节点的得分。S17: Repeat steps S13-S16 to obtain the score of each node.
进一步的,所述的方法还包括:Further, the method also includes:
S3:判断得分最高的节点数量是否大于1,若是,进入S4,若否,选择该节点;S3: Determine whether the number of nodes with the highest score is greater than 1, if yes, go to S4, if not, select the node;
S4:由系统随机选择其中一个节点进行资源分配。S4: The system randomly selects one of the nodes for resource allocation.
进一步的,所述的方法还包括:Further, the method also includes:
S3:判断得分最高的节点数量是否大于1,若是,进入S4,若否,选择该节点;S3: Determine whether the number of nodes with the highest score is greater than 1, if yes, go to S4, if not, select the node;
S4:判断最高分是否等于100分,若是,进入S5,若否,由系统随机选择其中一个节点进行资源分配;S4: Determine whether the highest score is equal to 100 points, if yes, go to S5, if not, the system randomly selects one of the nodes for resource allocation;
S5:判断得分最高的节点镜像值是否相同,若是,由系统随机选择其中一个节点进行资源分配;若否,进入S6;S5: Determine whether the mirror value of the node with the highest score is the same, if so, the system randomly selects one of the nodes for resource allocation; if not, go to S6;
S6:选择镜像值最高的节点。S6: Select the node with the highest mirror image value.
本发明一种具体实施例的有益效果是:The beneficial effect of a kind of specific embodiment of the present invention is:
1、对节点的镜像大小打分,镜像越大,主机的打分越高,并选择分数最高的节点并进行资源分配。通过上述设置,在资源允许的前提下,节省了网络传输镜像的带宽以及下载镜像所需的时间,提升的系统的运行效率,保证了系统的服务质量。1. Score the image size of the node. The larger the image, the higher the score of the host, and select the node with the highest score and allocate resources. Through the above settings, under the premise of resource permitting, the bandwidth of network transmission mirroring and the time required for downloading mirroring are saved, the operating efficiency of the system is improved, and the service quality of the system is guaranteed.
2、在打分之前,预先去除自身资源过小的节点,减少了需要评分的节点数量,提高了整个评分的效率。2. Before scoring, remove nodes with too small resources in advance, reducing the number of nodes that need to be scored, and improving the efficiency of the entire score.
3、通过对评分步骤进行分段判断,进一步减少了需要计算的节点数量,最大程度提高评分计算的效率。3. By segmenting the scoring steps, the number of nodes to be calculated is further reduced, and the efficiency of scoring calculations is maximized.
4、提供了两种对于后续节点选择的方法,一种直接随机选择,简化了设置过程;另一种分段判断,最终选择最高分中的最优选择,提高了选择质量。4. Provides two methods for subsequent node selection, one is direct random selection, which simplifies the setting process; the other is segmented judgment, which finally selects the best choice among the highest scores, which improves the quality of selection.
附图说明Description of drawings
图1是本发明一种实施例的方法流程图;Fig. 1 is a method flowchart of an embodiment of the present invention;
图2是本发明另一种实施例的方法流程图。Fig. 2 is a flowchart of a method in another embodiment of the present invention.
具体实施方式detailed description
为了使本领域的技术人员能够更好地理解、实现本发明,下面通过具体实施例对本发明进行详细说明。In order to enable those skilled in the art to better understand and realize the present invention, the present invention will be described in detail below through specific embodiments.
几个名词的解释:Explanation of several terms:
容器是对主机计算资源(CPU、内存、磁盘或者网络等)的隔离与划分,比如Docker。Containers are the isolation and division of host computing resources (CPU, memory, disk or network, etc.), such as Docker.
镜像是类似操作系统的镜像,包括一个完整可运行的系统,操作系统、基础组件、应用程序都可以打包在一个镜像中。容器依赖镜像才能运行。An image is an image similar to an operating system, including a complete operating system. The operating system, basic components, and applications can all be packaged in an image. Containers rely on images to run.
应用是运行在“容器”中的程序。Applications are programs that run in "containers".
节点,是指包含若干镜像的容器。A node refers to a container that contains several images.
实施例1Example 1
如图1所示为一种具体实施例,提供了一种容器资源调度方法,该方法包括以下步骤:As shown in Figure 1, a specific embodiment is provided, which provides a container resource scheduling method, which includes the following steps:
S1:对节点进行评分,具体实现过程为:S1: Score the nodes, the specific implementation process is:
S11:设定镜像上限值max,在实际应用中,可以将max设置为2G,也就是2048M;S11: Set the mirror image upper limit max, in practical applications, you can set max to 2G, which is 2048M;
S12:获取应用所需镜像值X1;S12: Obtain the image value X1 required by the application;
S13:获取某节点自身镜像值X2;S13: Obtain the self-image value X2 of a certain node;
S14:判断X1是否大于X2,若是,则该节点得分score=0;若否,进入S15;S14: Determine whether X1 is greater than X2, if yes, then the node score = 0; if not, go to S15;
S15:判断X2是否大于max,若是,则该节点得分score=100;若否,进入S16;S15: Determine whether X2 is greater than max, if yes, then the node score = 100; if not, go to S16;
S16:根据公式score=100*(X2-X1)/(max-X1)计算该节点得分;S16: Calculate the score of the node according to the formula score=100*(X2-X1)/(max-X1);
S17:重复步骤S13-S16,得到每一个节点的得分。S17: Repeat steps S13-S16 to obtain the score of each node.
S2:选择得分最高的节点。S2: Select the node with the highest score.
S3:判断得分最高的节点数量是否大于1,若是,进入S4,若否,选择该节点。S3: Determine whether the number of nodes with the highest score is greater than 1, if yes, go to S4, if not, select the node.
S4:由系统随机选择其中一个节点进行资源分配。S4: The system randomly selects one of the nodes for resource allocation.
实施例2Example 2
如图2所示为一种具体实施例,提供了一种容器资源调度方法,该方法包括以下步骤:As shown in Figure 2, a specific embodiment is provided, which provides a container resource scheduling method, which includes the following steps:
S1:对节点进行评分,具体实现过程为:S1: Score the nodes, the specific implementation process is:
S11:设定镜像上限值max在实际应用中,可以将max设置为2G,也就是2048M;S11: Set the mirror image upper limit value max In practical applications, you can set max to 2G, which is 2048M;
S12:获取应用所需镜像值X1;S12: Obtain the image value X1 required by the application;
S13:获取某节点自身镜像值X2;S13: Obtain the self-image value X2 of a certain node;
S14:判断X1是否大于X2,若是,则该节点得分score=0;若否,进入S15;S14: Determine whether X1 is greater than X2, if yes, then the node score = 0; if not, go to S15;
S15:判断X2是否大于max,若是,则该节点得分score=100;若否,进入S16;S15: Determine whether X2 is greater than max, if yes, then the node score = 100; if not, go to S16;
S16:根据公式score=100*(X2-X1)/(max-X1)计算该节点得分;S16: Calculate the score of the node according to the formula score=100*(X2-X1)/(max-X1);
S17:重复步骤S13-S16,得到每一个节点的得分。S17: Repeat steps S13-S16 to obtain the score of each node.
S2:选择得分最高的节点。S2: Select the node with the highest score.
S3:判断得分最高的节点数量是否大于1,若是,进入S4,若否,选择该节点。S3: Determine whether the number of nodes with the highest score is greater than 1, if yes, go to S4, if not, select the node.
S4:判断最高分是否等于100分,若是,进入S5,若否,由系统随机选择其中一个节点进行资源分配。S4: Determine whether the highest score is equal to 100 points, if yes, go to S5, if not, the system randomly selects one of the nodes for resource allocation.
S5:判断得分最高的节点镜像值是否相同,若是,由系统随机选择其中一个节点进行资源分配;若否,进入S6。S5: Determine whether the mirror value of the node with the highest score is the same, if yes, the system randomly selects one of the nodes for resource allocation; if not, go to S6.
S6:选择镜像值最高的节点。S6: Select the node with the highest mirror image value.
实施例3Example 3
在实施例1的基础上,在步骤S1之前增加下列步骤:On the basis of Embodiment 1, the following steps are added before step S1:
S0:判断节点自身资源的大小,去除自身资源小于设定值的节点。S0: Determine the size of the node's own resources, and remove nodes whose resources are less than the set value.
通过设置步骤S0,可以在评分之前预先去除完全不符合要求的节点,减少需要评分的节点数量,提高效率。在实际的应用中,给出了一个例子,将设定值的大小设置为100M。By setting step S0, nodes that do not meet the requirements can be removed in advance before scoring, reducing the number of nodes that need to be scored, and improving efficiency. In the actual application, an example is given, and the size of the set value is set to 100M.
实施例4Example 4
在实施例2的基础上,在步骤S1之前增加下列步骤:On the basis of embodiment 2, the following steps are added before step S1:
S0:判断节点自身资源的大小,去除自身资源小于设定值的节点。S0: Determine the size of the node's own resources, and remove nodes whose resources are less than the set value.
通过设置步骤S0,可以在评分之前预先去除完全不符合要求的节点,减少需要评分的节点数量,提高效率。在实际的应用中,给出了一个例子,将设定值的大小设置为100M。By setting step S0, nodes that do not meet the requirements can be removed in advance before scoring, reducing the number of nodes that need to be scored, and improving efficiency. In the actual application, an example is given, and the size of the set value is set to 100M.
尽管说明书及附图和实施例对本发明创造已进行了详细的说明,但是,本领域技术人员应当理解,仍然可以对本发明创造进行修改或者等同替换;而一切不脱离本发明创造的精神和范围的技术方案及其改进,其均涵盖在本发明创造专利的保护范围当中。Although the specification, drawings and embodiments have described the invention in detail, those skilled in the art should understand that the invention can still be modified or replaced in an equivalent manner; and everything that does not depart from the spirit and scope of the invention The technical solutions and their improvements are all included in the scope of protection of the invention patent.
Claims (6)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710485306.4A CN107315643A (en) | 2017-06-23 | 2017-06-23 | A kind of container resource regulating method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710485306.4A CN107315643A (en) | 2017-06-23 | 2017-06-23 | A kind of container resource regulating method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107315643A true CN107315643A (en) | 2017-11-03 |
Family
ID=60179601
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710485306.4A Pending CN107315643A (en) | 2017-06-23 | 2017-06-23 | A kind of container resource regulating method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107315643A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109582452A (en) * | 2018-11-27 | 2019-04-05 | 北京邮电大学 | A kind of container dispatching method, dispatching device and electronic equipment |
CN109951551A (en) * | 2019-03-21 | 2019-06-28 | 联想(北京)有限公司 | A kind of container mirror image management system and method |
CN110968424A (en) * | 2019-09-12 | 2020-04-07 | 广东浪潮大数据研究有限公司 | Resource scheduling method, device and storage medium based on K8s |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8989053B1 (en) * | 2013-11-29 | 2015-03-24 | Fedex Corporate Services, Inc. | Association management in a wireless node network |
CN105827548A (en) * | 2016-03-30 | 2016-08-03 | 乐视控股(北京)有限公司 | Resource scheduling method and apparatus |
CN106027643A (en) * | 2016-05-18 | 2016-10-12 | 无锡华云数据技术服务有限公司 | Resource scheduling method based on Kubernetes container cluster management system |
CN106664507A (en) * | 2014-05-28 | 2017-05-10 | 联邦快递服务公司 | Enabled node delivery of notifications using elements of a wireless node network |
-
2017
- 2017-06-23 CN CN201710485306.4A patent/CN107315643A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8989053B1 (en) * | 2013-11-29 | 2015-03-24 | Fedex Corporate Services, Inc. | Association management in a wireless node network |
CN106664507A (en) * | 2014-05-28 | 2017-05-10 | 联邦快递服务公司 | Enabled node delivery of notifications using elements of a wireless node network |
CN105827548A (en) * | 2016-03-30 | 2016-08-03 | 乐视控股(北京)有限公司 | Resource scheduling method and apparatus |
CN106027643A (en) * | 2016-05-18 | 2016-10-12 | 无锡华云数据技术服务有限公司 | Resource scheduling method based on Kubernetes container cluster management system |
Non-Patent Citations (1)
Title |
---|
刘辉扬: "基于Docker的容器监控和调度的研究与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109582452A (en) * | 2018-11-27 | 2019-04-05 | 北京邮电大学 | A kind of container dispatching method, dispatching device and electronic equipment |
CN109951551A (en) * | 2019-03-21 | 2019-06-28 | 联想(北京)有限公司 | A kind of container mirror image management system and method |
CN109951551B (en) * | 2019-03-21 | 2021-03-19 | 联想(北京)有限公司 | Container mirror image management system and method |
CN110968424A (en) * | 2019-09-12 | 2020-04-07 | 广东浪潮大数据研究有限公司 | Resource scheduling method, device and storage medium based on K8s |
CN110968424B (en) * | 2019-09-12 | 2023-04-07 | 广东浪潮大数据研究有限公司 | Resource scheduling method, device and storage medium based on K8s |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11429449B2 (en) | Method for fast scheduling for balanced resource allocation in distributed and collaborative container platform environment | |
CN107222531B (en) | Container cloud resource scheduling method | |
WO2017080391A1 (en) | Network service deployment method and device | |
CN108924268B (en) | A container cloud service system and pod creation method and device | |
US20150052254A1 (en) | Virtual Machine Live Migration Method, Virtual Machine Deployment Method, Server, and Cluster System | |
US20190196875A1 (en) | Method, system and computer program product for processing computing task | |
CN103593243B (en) | Dynamic extensible trunked system for increasing virtual machine resources | |
CN104156255A (en) | Virtual machine migration method, virtual machine migration device and source physical host | |
CN101488960A (en) | Apparatus and method for TCP protocol and data recovery based on parallel processing | |
CN112584422B (en) | 5G terminal performance acquisition method and device | |
CN108933815A (en) | A kind of control method of the Edge Server of mobile edge calculations unloading | |
EP4123449A1 (en) | Resource scheduling method and related device | |
CN105786619A (en) | Virtual machine distribution method and device | |
CN107315643A (en) | A kind of container resource regulating method | |
CN112433844B (en) | Resource allocation method, system, equipment and computer readable storage medium | |
CN118897736A (en) | Model reasoning scheduling method, device and server cluster | |
CN108132827A (en) | A kind of network slice method for mapping resource, relevant device and system | |
CN106325996A (en) | GPU resource distribution method and system | |
CN106775987A (en) | A kind of dispatching method of virtual machine for improving resource efficiency safely in IaaS cloud | |
CN112799829A (en) | A Knowledge-Driven Network Resource Orchestration Method | |
WO2023071576A1 (en) | Container cluster construction method and system | |
CN103747439B (en) | Wireless controller device, wireless authentication processing method, system, networking | |
CN112783643B (en) | Resource orchestration method and device for multi-access edge computing network | |
CN115640113A (en) | Multi-plane flexible scheduling method | |
US20240354170A1 (en) | Resource management and isolation in containerized workloads |
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 | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20200526 Address after: 250101 floor 27, S01, Inspur Science Park, No. 1036, Inspur Road, Jinan City, Shandong Province Applicant after: Tidal Cloud Information Technology Co.,Ltd. Address before: 450018 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. |
|
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171103 |