CN109582461A - A kind of calculation resource disposition method and system for linux container - Google Patents

A kind of calculation resource disposition method and system for linux container Download PDF

Info

Publication number
CN109582461A
CN109582461A CN201811352854.0A CN201811352854A CN109582461A CN 109582461 A CN109582461 A CN 109582461A CN 201811352854 A CN201811352854 A CN 201811352854A CN 109582461 A CN109582461 A CN 109582461A
Authority
CN
China
Prior art keywords
resource
container
dimension
physical host
host
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
Application number
CN201811352854.0A
Other languages
Chinese (zh)
Other versions
CN109582461B (en
Inventor
王煜炜
刘畅
刘敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Institute of Computing Technology of CAS
Original Assignee
Institute of Computing Technology of CAS
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Institute of Computing Technology of CAS filed Critical Institute of Computing Technology of CAS
Priority to CN201811352854.0A priority Critical patent/CN109582461B/en
Publication of CN109582461A publication Critical patent/CN109582461A/en
Application granted granted Critical
Publication of CN109582461B publication Critical patent/CN109582461B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation 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/505Allocation 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 load

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention provides a kind of calculation resource disposition method and system for linux container.The method, it include: 1) for each physical host, the case where N-dimensional resource can be provided to the conditions of demand of N-dimensional resource and the physical host according to the container to be built, calculates matching degree of the physical host in the resource of every dimension with the container, N > 1;2) in N-dimensional space, based on the feasible zone range determined by the feasible zone boundary value m being arranged, the one or more physical hosts being within the scope of the feasible zone with the matching degree of the container, m > 0 are filtered out in the resource of every dimension.The present invention can be effectively reduced resource fragmentation, improve host close to the resource utilization under full load situation, avoid the wasting of resources.Also, the present invention improves about 100% in terms of being deployed in resource balancing degree compared to traditional Greedy strategy after tested.

Description

A kind of calculation resource disposition method and system for linux container
Technical field
The present invention relates to field of computer technology more particularly to a kind of resource deployment schemes for linux container.
Background technique
As an important technology for realizing linux kernel function, linux container technology (LXC) is away from the present existing more than ten years Developing history.The technology to be isolated from each other between different processes by the build tool packet, and such isolation is not needed by hard Part virtualization.Be explained herein with reference to principle of the Fig. 1 to linux container technology, as shown, by container be used as every The system of disembarking, is different zones by the division of resources of host (i.e. physical machine entity), and multiple containers are shared in the same Linux Core accommodates an application in each container, so that the execution for the program of different application is independent of one another.It is believed that container It is the virtualization for having carried out one layer of software in existing operating system, kernel is shared between container, virtualization level is seldom, makes It has smaller expense and consumed resource for the virtualization of virtual machine.Since container technique is with light, simple Clean advantage receives the favor of major cloud service provider, is virtualization technology burning hot at present.
It include: Docker, openVZ, FreeBSD jails, Solaris than more typical linux container technology Containers.Most of open source systems based on these technologies are all very simple to the deployment strategy of resource, often only consider For the matching of CPU and memory.However, the resource in cluster is usually all multidimensional, such as CPU, memory, network bandwidth, GPU, block I/O bandwidth, storage etc., if then holding carrying out to guarantee that the balanced of multi dimensional resource uses when resource deployment It easily causes and occurs resource fragmentation in cluster.Assuming that only consider the three dimensional resource in cluster, CPU, memory and storage, based on existing Strategy it is possible that CPU is finished and memory there remains many situations, will cause the waste of resource in this way.It is then desired to one Kind is capable of the deployment strategy of balanced all kinds of resources, to make full use of the multi dimensional resource in cluster.
Summary of the invention
Therefore, it is an object of the invention to overcome the defect of the above-mentioned prior art, a kind of money for linux container is provided Source dispositions method, comprising:
1) each physical host, conditions of demand and the physics according to the container to be built to N-dimensional resource are directed to Host can provide the case where N-dimensional resource, calculate of the physical host in the resource of every dimension with the container With degree, N > 1;
2) it in N-dimensional space, based on the feasible zone range determined by the feasible zone boundary value m being arranged, filters out every The one or more physical hosts being in the resource of dimension with the matching degree of the container within the scope of the feasible zone, m > 0。
Preferably, according to the method for the present invention, wherein step 1) include: by the physical host each dimension resource The upper matching degree with the container is transformed into unified numerical intervals.
Preferably, according to the method for the present invention, wherein by following formula by the physical host in the resource of each dimension Unified numerical intervals are transformed into the matching degree of the container:
ScoreD(p, c)=(useDD)/TD*100
Wherein, ScoreDThe matching degree in resource with the container c, use are tieed up in D for physical host pDIt is physical host Usage amount of the p for D dimension resource, TDIt is total amount of the physical host p for D dimension resource, γDIt is container c to institute State the demand of D dimension resource.
Preferably, according to the method for the present invention, wherein feasible zone range described in step 2) be in N dimension space with most The distance of excellent solution is less than the region of m, and the optimal solution is the solution that the value of each dimension is equal in N-dimensional space.
Preferably, according to the method for the present invention, wherein judge whether a physical host meets using following formula in step 2) It is within the scope of the feasible zone in the resource of every dimension with the matching degree of the container:
Wherein, xiFor the resource matched degree of i-th dimension, N is the number of dimensions of resource, and m is the feasible zone boundary value of setting.
Preferably, according to the method for the present invention, wherein feasible zone range described in step 2) be in N dimension space with original The distance of point is less than the region of m, and the origin is the point that the value of each dimension is 0 in N-dimensional space.
Preferably, according to the method for the present invention, wherein further include:
3) it for each physical host filtered out, calculates for indicating all to lead after assigning them to the container The resources balance factor of the resources balance situation of machine cluster;
4) according to the resources balance factor, selection is so that the optimal physics master of the resources balance situation of whole mainframe clusters Machine distributes to the container.
Preferably, according to the method for the present invention, wherein step 3) is calculated as follows current container being deployed in alternative host k Resources balance factor when upper:
Wherein, Hostk_useDIt is that alternative host k has used resource situation, Host on dimension Di_useDIt is that other are standby Host i is selected to use resource situation on dimension D.γDIt is demand of the current container to D dimension resource, N is money The number of dimensions in source, M are the quantity of physical host in cluster.
Also, step 4) includes: to select the smallest physical host of the resources balance factor as distributing to the container Physical host.
Preferably, according to the method for the present invention, wherein step 4) includes: the resources balance factor in multiple physical hosts When identical, according to the resource that the application to be run in the container is stressed, adjust each in the resources balance factor of physical host Ratio shared by a dimension resource.
Preferably, according to the method for the present invention, before step 1) further include:
0-1) determine the multiple containers for needing to build in system;
0-2) according to the dependence between the multiple container, the size of stock number needed for each container, select into The priority of each container when row resource deployment, with according to the priority be each container allocation physical host.
Preferably, according to the method for the present invention, wherein step 0-2) include: container to be relied on by other containers, and/or Need the container of hardware resource and/or the higher priority of container setting that required stock number is big.
A kind of computer readable storage medium, wherein being stored with computer program, the computer program is when executed For realizing method described in above-mentioned any one.
A kind of resource deployment system for for linux container, comprising:
Storage device and processor;
Wherein, for storing computer program, the computer program executes the storage device by the processor When for realizing method described in above-mentioned any one.
Compared with the prior art, the advantages of the present invention are as follows:
Screened using the feasible zone of hyperspace in the resource of every dimension be in the matching degree of container it is feasible Physical host within the scope of domain, so that will not to occur resource in any one dimension excessive or very few for the physical host filtered out The case where, to avoid the case where resource fragmentation occur during container runs program.Physical host is being calculated every When matching degree in the resource of dimension with container, the matching degree of each dimension is transformed into unified numerical intervals, so that Screening in N-dimensional space becomes easier.Feasible zone range is defined as being less than at a distance from optimal solution in N-dimensional space The region of the m value of setting, the solution that the value that optimal solution is defined as each dimension in N-dimensional space is equal, can accurately by The physical host screened is limited in so that near the optimal solution of the equilibrium situation of the resource of each dimension.For used In the biggish situation of m value, may filter out more than one can distribute to the physical host of current container, and further judgement is every at this time Can a physical host improve the resources balance situation of entire physical host cluster, and allowing to find improves entire physical host The Resource Allocation Formula of the resources balance situation of cluster.The solution of the present invention improves traditional greedy algorithm, calculation amount It is relatively small, and resource fragmentation can be effectively reduced, improve host close to the resource utilization under full load situation, it avoids The wasting of resources.This deployment strategy improves about 100% in terms of being deployed in resource balancing degree compared to Greedy strategy after tested.
Detailed description of the invention
Embodiments of the present invention is further illustrated referring to the drawings, in which:
Fig. 1 is the schematic illustration of linux container technology;
Fig. 2 is the flow chart of the method for the resource deployment according to an embodiment of the invention for linux container;
Fig. 3 a is the feasible zone range that memory and cpu resource are directed to according to one embodiment of present invention in two-dimensional space Schematic diagram;
Fig. 3 b is according to one embodiment of present invention in three-dimensional space for memory, CPU and network bandwidth resources The schematic diagram of feasible zone range;
Fig. 4 shows using the solution of the present invention and carries out using the scheme of traditional greedy algorithm money when resource deployment The simulation result of source balance factor;
Fig. 5 shows using the solution of the present invention and carries out using the scheme of traditional greedy algorithm object when resource deployment Manage the simulation result of the comprehensive resources utilization rate of mainframe cluster.
Specific embodiment
Since the resource deployment for linux container needs to consider to filter out from a large amount of physical host respectively for more The deployment strategy of a container, and the resource class considered needed for each physical host is also multidimensional, by traversing each physics Host and each container match the resource of every dimension of each container, and calculation amount and time-consuming are often difficult to Meet the requirement for system of building.Thus, the prior art generallys use greedy calculation when executing the resource deployment for being directed to linux container Method only executes the search of limited calculation amount, preferred resource deployment scheme is determined in search range.
Inventor after research by having found, based on traditional resource deployment scheme using greedy algorithm, in host resource Close to there are many unserviceable fragment resources in the case where saturation, i.e., when most host resource occupied situation Under be also difficult to further increase the average utilization of resource by continuing searching suitable resource deployment scheme.Also, this feelings Condition is also embodied in existing resource deployment scheme and is difficult to balancedly dispose the resource of multiple dimensions, i.e., as described in background technique Ground, it is understood that there may be there are also remaining situations for the resource of another dimension when the resource of certain dimension is used up.And the application in container Program is typically necessary while meeting the resources of multiple dimensions and can just run, and the case where above-mentioned resources left occurs and can then waste object Resource, the reduction system of reason host can concurrently deployed number of containers.
In this regard, the invention proposes a kind of calculation resource disposition methods for linux container, it is with reference to the accompanying drawing and specific real Mode is applied to elaborate to the present invention.
With reference to Fig. 2, according to one embodiment of present invention, which comprises
Step 1. determined according to the specific requirements of system building environment need the container disposed and its mirror image address, container it Between dependence, all kinds of software and hardware resources needed for container.Here the dependence between container refers to the fortune of container A Row need to be using container B as condition, such as container A needs to call container B or need to trigger container B etc. at runtime.Table 1 is shown The information of container determined needed for according to one embodiment of present invention.
Table 1
Wherein, Container Name is for identifying each container;Mirror image address is for creating container;Hardware is bound to hold for recording Device needs the hardware resource (such as GPU, network interface card, vCPU etc.) bound, and the container for being bundled with hardware resource then needs preferentially Consideration meets its requirement;The resource of N number of dimension can be container using required all kinds of resources, such as CPU, GPU, memory, Storage, network bandwidth, block I/O bandwidth etc..
Step 2. is carried out according to the dependence between each container, the size of stock number needed for each container, selection The priority of each container when resource deployment, with according to the priority be each container allocation physical host.According to this One embodiment of invention determines that the principle of the priority of each container is in this step, is preferably by other containers The container of dependence and the big container allocation physical host of required stock number.Reason for doing so is that in order to prevent After the complete physical host of the relatively small container allocation of resource occupation amount, remaining inadequate resource is big for resource occupation amount Container used.Carrying out deployment based on the dependence between container is also for similar consideration, to prevent deployment The case where the application on container cannot be executed smoothly.
According to other embodiments of the invention, in this step, it can artificially select to carry out each appearance when resource deployment The priority of device.According to another embodiment of the present invention, the priority of each container can also be determined using following manner:
Step 2-1: compare with the presence or absence of dependence between two containers, if then continuing step 2-2, if otherwise continuing Step 2-3;
Step 2-2: according to the dependence between container, if the application in container A needs to rely on answering in container B With the priority of B being then set above to the priority of A, and continue step 2-4;
Step 2-3: judging whether it has bound hardware resource for container, has the container of hardware resource to be set as binding With higher priority, and continue step 2-4;
Step 2-4: for there are multiple containers to have the case where equal priority, by the stock number of certain required dimension Big container is set as having higher priority.
It determines as a result, and distributes physical host in what order for multiple containers.
Step 3. is directed to the container of current physical host to be allocated, all alternative physical hosts is traversed, for every One physical host, according to the container to be built to the demand of whole multi dimensional resources and the physical host for described The total amount and usage amount of multi dimensional resource calculate matching degree of each physical host in every dimension resource with the container. According to one embodiment of present invention, can be according to the actual conditions of container to be allocated, it will obvious undesirable physics Host excludes alternative physical host.
Here can using it is any it is appropriate by the way of calculate a physical host in the resource of any one dimension with institute The matching degree of container is stated, such as whether the physical host meets the needs of container for the total amount of the resource of the dimension Whether amount or the physical host meet the demand, etc. of the container for the unused amount of the resource of the dimension.
Due to whether will judge a physical host using the feasible zone of multiple dimensions in later step of the invention For container use, processing, reduction calculation amount preferably walk herein according to one embodiment of present invention for convenience Matching degree of the physical host in every dimension resource with the container is calculated by normalized mode in rapid, it will be different The numerical value of the matching degree of dimension is unified to the identical order of magnitude.For example, calculating can be normalized using following formula:
ScoreD(p, c)=(useDD)/TD*100
Wherein, ScoreDThe matching degree in resource with container c, use are tieed up in D for physical host pDIt is that physical host p is directed to The usage amount of the D dimension resource, TDIt is total amount of the physical host p for D dimension resource, γDIt is container c to described The demand of D dimension resource.
Calculating formula in this way can calculate obtain a physical host in every dimension resource with the container Normalized matching degree.
Step 4. is directed to the feasible zone range of N-dimensional resource according to determined by the feasible zone boundary value m of setting, filters out every Matching degree in dimension resource is in one or more physical hosts within the scope of the feasible zone.Here feasible zone side Dividing value m is the parameter for determining feasible zone range, and m is greater than 0, can be determined based on experience value or by user by test. Biggish m corresponds to biggish feasible zone range, is conducive to filter out more satisfactory physical hosts, so that search result Closer to traversal search, bigger calculation amount is also corresponded to.Lesser m corresponds to lesser feasible zone range, can subtract The quantity for the physical host that container uses that is filtered out less distribute to, search process is closer to greedy algorithm, calculation amount It is smaller.
According to one embodiment of present invention, for by the physical host in the resource of each dimension with the appearance The matching degree of device is transformed into unified numerical intervals, such as based on aforementioned normalized calculating formula by the matching degree of each dimension The case where being converted into percentage can according to need and feasible zone range is determined as in N-dimensional space at a distance from origin Region less than m.
According to still another embodiment of the invention, feasible zone range can also be determined as in N-dimensional space with it is optimal The distance of solution is less than the region of m, and optimal solution here refers to the comparable solution of the balance degree of each dimension in N-dimensional space. The purpose for the arrangement is that physical host is each in the ideal case for the considerations of filtering out resource more balanced allocation plan When essentially equal with the matching degree of container in dimension, the equilibrium degree of resource is optimal.However, for most situations, physics master Matching degree of the machine in the resource of each dimension is simultaneously unequal.Such as standard is used in some technologies for solving resources balance The mode that difference, variance calculate filters out the best scheme of equilibrium degree, however inventor thinks that such mode can not be complete Avoid the occurrence of resource fragmentation.This is because, although standard deviation and variance can provide the degree for deviateing mean value on the whole, It does not embody and deviates from ideal range, the object filtered out in this way with the presence or absence of the resource of some or several dimensions Reason host is likely to appear in the situation that resource is excessive or very few in some or several dimensions.In contrast, using feasible zone The generation of this case then can be effectively avoided in range.
Below by the feasible zone boundary value m for being illustrated how by two specific examples based on setting determine N-dimensional can Row domain range.
Fig. 3 a is shown according to one embodiment of present invention, for the feasible zone range of 2 dimension resources, wherein 2 dimension Resource is respectively memory and CPU.With reference to Fig. 3 a, when memory matching degree is equal with CPU matching degree, the equilibrium degree of resource is optimal, Memory matching degree and the CPU matching degree for meeting the physical host of this condition are true by point (0,0) and point (100,100) institute in figure On fixed straight line.It is referred to by the range that feasible zone boundary value m is determined true by memory matching degree and CPU the matching degree institute of host The shortest distance between fixed point and the straight line of optimal solution is less than m.By taking Fig. 3 a as an example, point (0, d) indicate CPU matching degree be 0 and Memory matching degree is d, it is assumed that the distance that the point reaches optimal solution straight line is m, thenIt is possible thereby to determine feasible zone model It encloses (Feasible Region), i.e. the region between two dotted lines of Fig. 3 a, wherein a dotted line is by point (0, d) and point (100-d, 100) is determined, another dotted line is determined by point (d, 0) and point (100,100-d), or is denoted as | CPU matching degree-memory matching degree |Remaining region is fringe region (Edge Region).
It, can matching by a host in all N number of dimension resources with container after feasible zone range has been determined Degree is compared with the feasible zone range, if entirely falling within the scope of the feasible zone, then it is assumed that the physical host meets resource Balanced screening criteria.
By taking above-mentioned 2 dimension resource as an example, it is assumed that feasible zone boundary value m is 0.3, if the CPU matching degree of host and interior Depositing matching degree is respectively 0.65 and 0.7, and the difference of the two is less thanThen the host meets screening criteria, if one The CPU matching degree and memory matching degree of host are respectively 0.4 and 0.9, and the difference of the two is greater thanThen the host is not inconsistent Close screening criteria.
Fig. 3 b is shown according to one embodiment of present invention, for the feasible zone range of 3 dimension resources, wherein 3 dimension Resource is respectively memory, CPU and network bandwidth.The memory by host is referred to by the range that feasible zone boundary value m is determined With most short between the point and the straight line of optimal solution on three-dimensional space determined by degree, CPU matching degree and network bandwidth matching degree Distance is less than m.As shown in Fig. 3 b, feasible zone range is homogeneous with memory matching degree, CPU matching degree and network bandwidth matching degree Deng straight line as central axes, using m as radius cylindrical body, the area of space other than the cylindrical body belongs to edge Region.Above-mentioned feasible zone range can be indicated by following calculating formula: (Scorecpu-Scoremem)2+(Scorecpu- Scorenet)2+ (Scorenet-Scoremem)2< 3m2
Wherein, Scorecpu、Scoremem、ScorenetRespectively indicate CPU matching degree, memory matching degree and network bandwidth With degree.The host for meeting above formula meets screening criteria.
With 2 peacekeepings 3 tie up it is resources-type as, can also be directed to N-dimensional resource feasible zone range, and be based on the feasible zone model It encloses and determines whether the physical host meets screening with the matching degree of container in the resource of each dimension with a physical host Standard.In this regard, inventor summarizes the feasible zone range in N-dimensional space, meet following formula:
Wherein, xiFor the resource matched degree of i-th dimension, N is the number of dimensions of resource, and m is the feasible zone boundary value of setting.If It is that a physical host meets the expression formula, then it is assumed that it meets screening criteria.
One or more physical hosts for meeting current container demand, and physics master can be filtered out by step 4 There is excessive or very few situation in the resource that machine does not have any one dimension, can meet the needs of container and money simultaneously The standard of source equilibrium.If the physical host for meeting container demand can be filtered out just by feasible zone range, then may be used It, then can be by all if the quantity of the physical host filtered out is greater than 1 the physical host is directly distributed to the container As subsequent step is further selected.
Step 5. is directed to each physical host filtered out, calculates for indicating complete after assigning them to the container The resources balance factor of the resources balance situation of portion's mainframe cluster, with according to the resources balance factor, selection is distributed to described The physical host of container.The reason of so implementing this step is that a physical host can often be supported to dispose multiple simultaneously Container is then likely to occur if only considering the matching degree between physical host and container and is deployed in a large amount of container together Situation on one physical host, this may impact the resources balance situation of whole physical host clusters.Thus, In this step, it may be considered that if current container is deployed on different alternative physical hosts to whole physical host clusters The influence of resources balance situation, to filter out so that the optimal allocation result of the whole equilibrium situation of cluster.
According to one embodiment of present invention, when current container can be deployed on alternative host k based on following formula calculating The resources balance factor of whole physical host clusters:
Wherein, Hostk_useDIt is that alternative host k has used resource situation, Host on dimension Di_useDIt is that other are standby Host i is selected to use resource situation on dimension D.γDIt is demand of the container c to D dimension resource, N is resource Number of dimensions, M are the quantity of physical host in cluster.
It can be seen that the resources balance factor by above-mentioned expression formula and be defined as the side that each multi dimensional resource of cluster uses The mean value of difference, the value the big, indicates that the use of resource is more unbalanced.Therefore, the money for each alternative host can be compared Source balance factor selects so that the above-mentioned the smallest physical host of the resources balance factor distributes to the container.
If it was found that acceptable basis is current when there is a situation where that the resources balance factor of more than one physical host is equal Different coefficients is arranged for every dimension resource in the demand for the application to be run in container.For example, it is assumed that being run in current container Application be the application of video code conversion class, such application to CPU, memory it is more demanding, therefore alternative host can be turned up in CPU With the ratio in the two dimensions of memory with the matching degree of the container, such as the ratio of CPU is adjusted to The ratio of memory is adjusted toThe ratio for keeping the resource of other dimensions isIn another example false If the application run in current container is the application of machine learning class, such application is more demanding to GPU, can be by the ratio of GPU It is adjusted toThe ratio for keeping the resource of other dimensions is
The priority of step 6. each container according to determined by through step 2, determines next physics master to be allocated The container of machine, and the 3-5 that repeats the above steps, until completing resource deployment.
It can achieve the effect that verify deployment strategy according to the present invention, it is real that inventor has carried out following emulation It tests, compares the effect using balanced deployment strategy and traditional Greedy strategy of the invention.Test when, be respectively adopted by The mainframe cluster that 5-12 physical host is constituted carries out ten groups of experiments for each cluster and seeks average result.
Fig. 4 shows the mean value of the resources balance factor for whole physical hosts, wherein the broken line with point is traditional Greedy strategy, the broken line without point are result of the invention.It can be seen that no matter containing how much physics master in mainframe cluster Machine, the resources balance factor of the invention are respectively less than traditional prior art, and value is about the half of the prior art.This explanation It can make entire mainframe cluster that there is very good resources balance situation using method of the invention.
Fig. 5 shows entire mainframe cluster to the mean value of the utilization rate of multi dimensional resource.In Fig. 5, dark column indicates this Invention, light column indicate traditional Greedy strategy.As can be seen that in the utilization to the host in cluster close to the case where saturation Under, better resource utilization can be obtained using the solution of the present invention, improve about 5%-10% compared to the prior art. Inventor thinks that the reason of generating this effect is that balanced deployment strategy according to the present invention considers the equilibrium of multi dimensional resource It uses, host can be improved close to the resource utilization under full load situation efficiently against resource fragmentation.It is contemplated that It arrives, the solution of the present invention is particularly suitable for the extensive large data sets environment such as cloud computing.
It should be noted that each step introduced in above-described embodiment is all not necessary, those skilled in the art Can carry out according to actual needs it is appropriate accept or reject, replacement, modification etc..
It should be noted last that the above examples are only used to illustrate the technical scheme of the present invention and are not limiting.On although The invention is described in detail with reference to an embodiment for text, those skilled in the art should understand that, to skill of the invention Art scheme is modified or replaced equivalently, and without departure from the spirit and scope of technical solution of the present invention, should all be covered at this In the scope of the claims of invention.

Claims (13)

1. a kind of calculation resource disposition method for linux container, comprising:
1) each physical host, conditions of demand and the physical host according to the container to be built to N-dimensional resource are directed to The case where N-dimensional resource can be provided, matching degree of the physical host in the resource of every dimension with the container is calculated, N > 1;
2) it in N-dimensional space, based on the feasible zone range determined by the feasible zone boundary value m being arranged, filters out every one-dimensional The one or more physical hosts being in the resource of degree with the matching degree of the container within the scope of the feasible zone, m > 0.
2. according to the method described in claim 1, wherein step 1) include: by the physical host in the resource of each dimension Unified numerical intervals are transformed into the matching degree of the container.
3. according to the method described in claim 2, wherein by following formula by the physical host in the resource of each dimension with The matching degree of the container is transformed into unified numerical intervals:
ScoreD(p, c)=(uSeDD)/TD*100
Wherein, ScoreDThe matching degree in resource with the container c, use are tieed up in D for physical host pDIt is that physical host p is directed to The usage amount of the D dimension resource, TD are total amount of the physical host p for D dimension resource, γDIt is container c to described The demand of D dimension resource.
4. method described in any one of -3 according to claim 1, wherein feasible zone range described in step 2) is in N-dimensional sky The interior region for being less than m at a distance from optimal solution, the optimal solution are the solution that the value of each dimension is equal in N-dimensional space.
5. according to the method described in claim 4, wherein judging whether a physical host meets using following formula in step 2) It is within the scope of the feasible zone in the resource of every dimension with the matching degree of the container:
Wherein, xiFor the resource matched degree of i-th dimension, N is the number of dimensions of resource, and m is the feasible zone boundary value of setting.
6. according to the method in claim 2 or 3, wherein feasible zone range described in step 2) be in N-dimensional space with original The distance of point is less than the region of m, and the origin is the point that the value of each dimension is 0 in N-dimensional space.
7. according to the method described in claim 1, wherein, further includes:
3) it for each physical host filtered out, calculates for indicating whole host sets after assigning them to the container The resources balance factor of the resources balance situation of group;
4) according to the resources balance factor, selection is so that the optimal physical host point of the resources balance situation of whole mainframe clusters Container described in dispensing.
8. according to the method described in claim 7, wherein step 3) is calculated as follows current container is deployed on alternative host k When the resources balance factor:
Wherein, Hostk_useDIt is that alternative host k has used resource situation, Host on dimension Di_useDIt is that other are alternative main Machine i has used resource situation on dimension D.γDIt is demand of the current container to D dimension resource, N is the dimension of resource Degree amount, M are the quantity of physical host in cluster.
Also, step 4) includes: to select the smallest physical host of the resources balance factor as the object for distributing to the container Manage host.
9. according to the method described in claim 8, wherein step 4) include: multiple physical hosts the resources balance factor it is identical When, according to the resource that the application to be run in the container is stressed, adjust each dimension in the resources balance factor of physical host Spend ratio shared by resource.
10. method described in any one of -3 according to claim 1, before step 1) further include:
0-1) determine the multiple containers for needing to build in system;
0-2) according to the dependence between the multiple container, the size of stock number needed for each container, selection is provided The priority of each container when source is disposed, with according to the priority for each container allocation physical host.
11. according to the method described in claim 10, wherein step 0-2) include: container to be relied on by other containers, and/or Need the container of hardware resource and/or the higher priority of container setting that required stock number is big.
12. a kind of computer readable storage medium, wherein being stored with computer program, the computer program is used when executed In method of the realization as described in any one of claim 1-11.
13. a kind of for being directed to the resource deployment system of linux container, comprising:
Storage device and processor;
Wherein, the storage device is used for storing computer program, the computer program when being executed by the processor In method of the realization as described in any one of claim 1-11.
CN201811352854.0A 2018-11-14 2018-11-14 Resource deployment method and system for Linux container Active CN109582461B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811352854.0A CN109582461B (en) 2018-11-14 2018-11-14 Resource deployment method and system for Linux container

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811352854.0A CN109582461B (en) 2018-11-14 2018-11-14 Resource deployment method and system for Linux container

Publications (2)

Publication Number Publication Date
CN109582461A true CN109582461A (en) 2019-04-05
CN109582461B CN109582461B (en) 2021-03-09

Family

ID=65922272

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811352854.0A Active CN109582461B (en) 2018-11-14 2018-11-14 Resource deployment method and system for Linux container

Country Status (1)

Country Link
CN (1) CN109582461B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111046102A (en) * 2019-11-27 2020-04-21 复旦大学 High-performance block chain service system based on ether house
CN112256430A (en) * 2020-10-23 2021-01-22 北京三快在线科技有限公司 Container deployment method, device, equipment and storage medium
CN112559129A (en) * 2020-12-16 2021-03-26 西安电子科技大学 Device and method for testing load balancing function and performance of virtualization platform

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102215168A (en) * 2011-06-03 2011-10-12 黄东 Method for optimizing and scheduling service resources based on laminated network
US8082549B2 (en) * 2006-11-08 2011-12-20 Board Of Regents, The University Of Texas System System, method and apparatus for allocating resources by constraint selection
CN104834569A (en) * 2015-05-11 2015-08-12 北京京东尚科信息技术有限公司 Cluster resource scheduling method and cluster resource scheduling system based on application types
CN104881322A (en) * 2015-05-18 2015-09-02 中国科学院计算技术研究所 Method and device for dispatching cluster resource based on packing model
CN106502761A (en) * 2016-10-18 2017-03-15 华南师范大学 A kind of virtual machine deployment method of resources effective utilization
CN107562545A (en) * 2017-09-11 2018-01-09 南京奥之云信息技术有限公司 A kind of container dispatching method based on Docker technologies
US9886307B2 (en) * 2014-11-21 2018-02-06 International Business Machines Corporation Cross-platform scheduling with long-term fairness and platform-specific optimization
CN107734052A (en) * 2017-11-02 2018-02-23 华南理工大学 The load balancing container dispatching method that facing assembly relies on
US20180081722A1 (en) * 2016-09-20 2018-03-22 International Business Machines Corporation Multi-platform scheduler for permanent and transient applications
US20180276044A1 (en) * 2017-03-27 2018-09-27 International Business Machines Corporation Coordinated, topology-aware cpu-gpu-memory scheduling for containerized workloads

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8082549B2 (en) * 2006-11-08 2011-12-20 Board Of Regents, The University Of Texas System System, method and apparatus for allocating resources by constraint selection
CN102215168A (en) * 2011-06-03 2011-10-12 黄东 Method for optimizing and scheduling service resources based on laminated network
US9886307B2 (en) * 2014-11-21 2018-02-06 International Business Machines Corporation Cross-platform scheduling with long-term fairness and platform-specific optimization
CN104834569A (en) * 2015-05-11 2015-08-12 北京京东尚科信息技术有限公司 Cluster resource scheduling method and cluster resource scheduling system based on application types
CN104881322A (en) * 2015-05-18 2015-09-02 中国科学院计算技术研究所 Method and device for dispatching cluster resource based on packing model
US20180081722A1 (en) * 2016-09-20 2018-03-22 International Business Machines Corporation Multi-platform scheduler for permanent and transient applications
CN106502761A (en) * 2016-10-18 2017-03-15 华南师范大学 A kind of virtual machine deployment method of resources effective utilization
US20180276044A1 (en) * 2017-03-27 2018-09-27 International Business Machines Corporation Coordinated, topology-aware cpu-gpu-memory scheduling for containerized workloads
CN107562545A (en) * 2017-09-11 2018-01-09 南京奥之云信息技术有限公司 A kind of container dispatching method based on Docker technologies
CN107734052A (en) * 2017-11-02 2018-02-23 华南理工大学 The load balancing container dispatching method that facing assembly relies on

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111046102A (en) * 2019-11-27 2020-04-21 复旦大学 High-performance block chain service system based on ether house
CN111046102B (en) * 2019-11-27 2023-10-31 复旦大学 High performance blockchain service system
CN112256430A (en) * 2020-10-23 2021-01-22 北京三快在线科技有限公司 Container deployment method, device, equipment and storage medium
CN112559129A (en) * 2020-12-16 2021-03-26 西安电子科技大学 Device and method for testing load balancing function and performance of virtualization platform
CN112559129B (en) * 2020-12-16 2023-03-10 西安电子科技大学 Device and method for testing load balancing function and performance of virtualization platform

Also Published As

Publication number Publication date
CN109582461B (en) 2021-03-09

Similar Documents

Publication Publication Date Title
WO2022262167A1 (en) Cluster resource scheduling method and apparatus, electronic device and storage medium
US10129333B2 (en) Optimization of computer system logical partition migrations in a multiple computer system environment
TWI488111B (en) System and method for translating program functions for correct handling of local-scope variables and computing system incorporating the same
JP5967672B2 (en) Database management system, computer, database management method
US20150309842A1 (en) Core Resource Allocation Method and Apparatus, and Many-Core System
CN109684074A (en) Physical machine resource allocation methods and terminal device
CN109582461A (en) A kind of calculation resource disposition method and system for linux container
EP2472398A1 (en) Memory-aware scheduling for NUMA architectures
TWI786564B (en) Task scheduling method and apparatus, storage media and computer equipment
CN114356543A (en) Kubernetes-based multi-tenant machine learning task resource scheduling method
CN105893010A (en) Host scheduling method and system used for container deployment
WO2021141875A1 (en) Automated local scaling of compute instances
CN108241531A (en) A kind of method and apparatus for distributing resource for virtual machine in the cluster
US20240061712A1 (en) Method, apparatus, and system for creating training task on ai training platform, and medium
US9218198B2 (en) Method and system for specifying the layout of computer system resources
US20210390405A1 (en) Microservice-based training systems in heterogeneous graphic processor unit (gpu) cluster and operating method thereof
Ma et al. vLocality: Revisiting data locality for MapReduce in virtualized clouds
CN114386560A (en) Data processing method and device
CN113391913A (en) Distributed scheduling method and device based on prediction
CN114625500A (en) Method and application for scheduling micro-service application based on topology perception in cloud environment
CN113535087B (en) Data processing method, server and storage system in data migration process
CN110958192B (en) Virtual data center resource allocation system and method based on virtual switch
CN116661979A (en) Heterogeneous job scheduling system and method
CN114048040B (en) Task scheduling method based on time delay relation between memory and image classification model
CN116149843A (en) Dynamic programming-based resource allocation method, network, storage medium and processor

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
GR01 Patent grant
GR01 Patent grant