CN109753356A - A kind of container resource regulating method, device and computer readable storage medium - Google Patents

A kind of container resource regulating method, device and computer readable storage medium Download PDF

Info

Publication number
CN109753356A
CN109753356A CN201811590276.4A CN201811590276A CN109753356A CN 109753356 A CN109753356 A CN 109753356A CN 201811590276 A CN201811590276 A CN 201811590276A CN 109753356 A CN109753356 A CN 109753356A
Authority
CN
China
Prior art keywords
container
predicted
node
business
mentioned
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
Application number
CN201811590276.4A
Other languages
Chinese (zh)
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.)
Beijing Youxin Technology Co Ltd
Original Assignee
Beijing Youxin Technology Co Ltd
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 Beijing Youxin Technology Co Ltd filed Critical Beijing Youxin Technology Co Ltd
Priority to CN201811590276.4A priority Critical patent/CN109753356A/en
Publication of CN109753356A publication Critical patent/CN109753356A/en
Pending legal-status Critical Current

Links

Abstract

Embodiments of the present invention provide a kind of container resource regulating method, comprising: according to traffic ID to be predicted, duration to be predicted and through resources model trained in advance, to obtain resources information and be converted into container predictive information;When resources information meets the first preset condition, obtain container resource request and node listing, preset schedule operation is carried out according to container resource request and node listing, to obtain destination node, it is service creation target container to be predicted according to container predictive information, and target container is deployed in destination node.The present invention also provides corresponding device and computer readable storage mediums, can shift to an earlier date dilatation by the above method, reasonable distribution resource, improve resource utilization.

Description

A kind of container resource regulating method, device and computer readable storage medium
Technical field
The present invention relates to computer fields, and in particular to a kind of container resource regulating method, device and computer-readable deposits Storage media.
Background technique
Background that this section is intended to provide an explanation of the embodiments of the present invention set forth in the claims or context.Herein Description recognizes it is the prior art not because not being included in this section.
Docker be one open source engine, can easily for the several lightweights of any service creation, it is transplantable, Self-centered container.By container cluster management instrument Swarm, make Docker cluster for a user when virtual in one Entirety.
Existing technological difficulties are how to operate in container on suitable node, due to running container not on node Together, resource utilization also difference.And the resource utilization of each node the case where determining entire cluster, therefore, The excellent summary of colony dispatching strategy is just particularly important.The resource of different container demand different dimensions, when a node is any When the resource exhaustion of dimension, if there is the container of multi dimensional resource demand is activated, then the node will not be able to satisfy creation container Demand, cannot also run this container.In this case, the surplus resources of other dimensions are just idle and can not be utilized, These idle surplus resources are commonly referred to as resource fragmentation, bring the great wasting of resources, therefore in order to improve cluster Service quality needs to guarantee that the resource value of entire cluster is balanced.
Summary of the invention
It for the problem that above-mentioned resource fragmentation in the prior art is more, results in waste of resources, the embodiment of the present invention proposes A kind of container resource regulating method, device and computer readable storage medium.Resource utilization is turned up and keeps cluster resource The container dispatching method of equilibrium value.
In embodiment of the present invention in a first aspect, proposing a kind of container resource regulating method, which is characterized in that above-mentioned side Method includes:
According to traffic ID to be predicted, duration to be predicted and through resources model trained in advance, to obtain resource Predictive information, and container predictive information is converted by above-mentioned resources information;
When above-mentioned resources information meets the first preset condition, container resource is obtained according to said vesse predictive information Request, and node listing is obtained, preset schedule operation is carried out according to said vesse resource request and above-mentioned node listing, thus Obtain destination node;
It is the service creation target container to be predicted according to the container predictive information, and the target container is disposed In the destination node.
Optionally, wherein the above method further include:
When above-mentioned resources information meets the second preset condition, then according to said vesse predictive information, control it is above-mentioned to At least one of prediction business container to be removed is out of service.
Optionally, wherein above-mentioned resources model is based on xgboost model training and is formed, the above method further include:
The resource data of at least one business is monitored, the time series data of at least one above-mentioned business is obtained;
Preset data processing operation is executed to the time series data of at least one above-mentioned business, so that it is special to obtain multiple timing Sign forms the sample data set for being used for training pattern;
Using above-mentioned temporal aspect as input training parameter, above-mentioned xgboost model is trained, to obtain above-mentioned Resources model;
Wherein, at least one above-mentioned business includes above-mentioned business to be predicted, and above-mentioned resource data includes at least CPU value, interior Deposit value, disk I/O value and network interface card I/O value.
Optionally, wherein the above-mentioned resources through training in advance by traffic ID to be predicted and duration to be predicted input Model, to obtain resources information and include:
The service feature that at least one dimension is obtained according to above-mentioned traffic ID to be predicted, according to above-mentioned duration to be predicted and Current time generates the temporal characteristics of at least one dimension;
According to the temporal characteristics of the service feature of at least one above-mentioned dimension and at least one above-mentioned dimension, generate to be predicted Temporal aspect;
Above-mentioned temporal aspect to be predicted is input to above-mentioned resources model, is existed to obtain above-mentioned business to be predicted The above-mentioned resources information in above-mentioned duration to be predicted after current time.
Optionally, wherein converting container predictive information for above-mentioned resources information includes:
The current container amount of above-mentioned business to be predicted, above-mentioned business to be predicted are obtained according to the ID of above-mentioned business to be predicted Default container configuration information;
It, will be upper according to the default container configuration information of the current container amount of above-mentioned business to be predicted, above-mentioned business to be predicted The above-mentioned resources information for stating business to be predicted is converted into the said vesse predictive information of above-mentioned business to be predicted;
Wherein, above-mentioned resources information include: the CPU value of above-mentioned business demand to be predicted, memory value, disk I/O value with And network interface card I/O value;
Said vesse predictive information includes the container operation type and number of containers executed to above-mentioned business to be predicted, on Stating container operation type includes dilatation/or capacity reducing;
Above-mentioned default container configuration information includes: the CPU configuration information and memory of the unit container of above-mentioned business to be predicted Configuration information.
Optionally, wherein the above method further include:
Said vesse predictive information is parsed, judges whether to need to carry out dilatation or contracting to above-mentioned business to be predicted Hold;
If desired dilatation is carried out to above-mentioned business to be predicted, then above-mentioned resources information meets the first preset condition;With And
If desired capacity reducing is carried out to above-mentioned business to be predicted, then above-mentioned resources information meets the second preset condition.
Optionally, wherein when said vesse predictive information meets the first preset condition, above-mentioned acquisition node listing packet It includes:
Each node in above-mentioned cluster is monitored, obtain above-mentioned each node above-mentioned current CPU value and Above-mentioned current memory value;
The disk I/O for calculating each above-mentioned node in preset time is averaged occupancy, by the disk of each above-mentioned node IO is averaged above-mentioned current disk I/O value of the occupancy as each above-mentioned node;
The network interface card IO for calculating each above-mentioned node in preset time is averaged occupancy, by the network interface card of each above-mentioned node IO is averaged above-mentioned current network interface card I/O value of the occupancy as each above-mentioned node.
Optionally, wherein above-mentioned to include: based on said vesse resource request and the above-mentioned scheduling computation of node listing progress
Pessimistic Locking is called, the first screening is carried out by presetting strong restrictive condition, at least one is obtained from the node listing A first node;
The second screening is carried out by default weak limited condition, the target section is obtained from least one described first node Point, and the Pessimistic Locking is discharged after obtaining the destination node;
Wherein, above-mentioned to preset the above-mentioned current CPU value and above-mentioned current memory that strong restrictive condition includes: above-mentioned first node Value meets third preset condition, wherein above-mentioned third preset condition is formed according to said vesse resource request;
Above-mentioned default weak limited condition includes: that the above-mentioned current disk I/O value of above-mentioned destination node is less than in second node Above-mentioned current disk I/O value, above-mentioned network interface card I/O value are less than the above-mentioned network interface card I/O value in second node, wherein above-mentioned second node packet Include at least one above-mentioned first node the node some or all of in addition to above-mentioned destination node.
The second aspect of embodiment according to the present invention proposes a kind of container resource scheduling device, which is characterized in that above-mentioned Device includes:
Prediction module, for according to traffic ID to be predicted, duration to be predicted and through resources model trained in advance, To obtain resources information, and container predictive information is converted by above-mentioned resources information;
Scheduling computation module is used for when above-mentioned resources information meets the first preset condition, pre- according to said vesse Measurement information obtains container resource request, and obtains node listing, according to said vesse resource request and above-mentioned node listing into Row preset schedule operation, to obtain destination node;
Execution module is dispatched, for being the service creation target container to be predicted according to the container predictive information, and The target container is deployed in the destination node.
Optionally, wherein above-mentioned scheduling execution module is also used to:
When above-mentioned resources information meets the second preset condition, then according to said vesse predictive information, control it is above-mentioned to At least one of prediction business container to be removed is out of service.
Optionally, wherein above-mentioned resources model is based on xgboost model training and is formed, above-mentioned apparatus further include:
Monitoring module is monitored for the resource data at least one business, obtains at least one above-mentioned business Time series data;
Training module executes preset data processing operation for the time series data at least one above-mentioned business, thus To multiple temporal aspects, the sample data set for being used for training pattern is formed;And using above-mentioned temporal aspect as input training ginseng Number, is trained above-mentioned xgboost model, to obtain above-mentioned resources model;
Wherein, at least one above-mentioned business includes above-mentioned business to be predicted, and above-mentioned resource data includes at least CPU value, interior Deposit value, disk I/O value and network interface card I/O value.
Optionally, wherein
Above-mentioned prediction module is also used to:
The service feature that at least one dimension is obtained according to above-mentioned traffic ID to be predicted, according to above-mentioned duration to be predicted and Current time generates the temporal characteristics of at least one dimension;
According to the temporal characteristics of the service feature of at least one above-mentioned dimension and at least one above-mentioned dimension, generate to be predicted Temporal aspect;
Above-mentioned temporal aspect to be predicted is input to above-mentioned resources model, is existed to obtain above-mentioned business to be predicted The above-mentioned resources information in above-mentioned duration to be predicted after current time.
Optionally, wherein above-mentioned prediction module is also used to:
The current container amount of above-mentioned business to be predicted, above-mentioned business to be predicted are obtained according to the ID of above-mentioned business to be predicted Default container configuration information;
It, will be upper according to the default container configuration information of the current container amount of above-mentioned business to be predicted, above-mentioned business to be predicted The above-mentioned resources information for stating business to be predicted is converted into the said vesse predictive information of above-mentioned business to be predicted;
Wherein, above-mentioned resources information include: the CPU value of above-mentioned business demand to be predicted, memory value, disk I/O value with And network interface card I/O value;
Said vesse predictive information includes the container operation type and number of containers executed to above-mentioned business to be predicted, on Stating container operation type includes dilatation/or capacity reducing;
Above-mentioned default container configuration information includes: the CPU configuration information and memory of the unit container of above-mentioned business to be predicted Configuration information.
Optionally, wherein above-mentioned apparatus further includes judgment module, is used for:
Said vesse predictive information is parsed, judges whether to need to carry out dilatation or contracting to above-mentioned business to be predicted Hold;
If desired dilatation is carried out to above-mentioned business to be predicted, then above-mentioned resources information meets the first preset condition;With And
If desired capacity reducing is carried out to above-mentioned business to be predicted, then above-mentioned resources information meets the second preset condition.
Optionally, wherein above-mentioned scheduling computation module is used for:
Each node in above-mentioned cluster is monitored, obtain above-mentioned each node above-mentioned current CPU value and Above-mentioned current memory value;
The disk I/O for calculating each above-mentioned node in preset time is averaged occupancy, by the disk of each above-mentioned node IO is averaged above-mentioned current disk I/O value of the occupancy as each above-mentioned node;
The network interface card IO for calculating each above-mentioned node in preset time is averaged occupancy, by the network interface card of each above-mentioned node IO is averaged above-mentioned current network interface card I/O value of the occupancy as each above-mentioned node.
Optionally, wherein above-mentioned scheduling computation module is also used to:
Pessimistic Locking is called, the first screening is carried out by presetting strong restrictive condition, at least one is obtained from the node listing A first node;
The second screening is carried out by default weak limited condition, the target section is obtained from least one described first node Point, and the Pessimistic Locking is discharged after obtaining the destination node;
Wherein,
It is above-mentioned to preset the above-mentioned current CPU value and above-mentioned current memory value symbol that strong restrictive condition includes: above-mentioned first node Third preset condition is closed, wherein above-mentioned third preset condition is formed according to said vesse resource request;
Above-mentioned default weak limited condition includes: that the above-mentioned current disk I/O value of above-mentioned destination node is less than in second node Above-mentioned current disk I/O value, above-mentioned network interface card I/O value are less than the above-mentioned network interface card I/O value in second node, wherein above-mentioned second node packet Include at least one above-mentioned first node the node some or all of in addition to above-mentioned destination node.
The third aspect of embodiment according to the present invention proposes a kind of container dispatching device characterized by comprising
One or more processor;
Memory, for storing one or more programs;
When said one or multiple programs are executed by said one or multiple processors, so that said one or multiple Processor is realized:
According to traffic ID to be predicted, duration to be predicted and through resources model trained in advance, to obtain resource Predictive information, and container predictive information is converted by above-mentioned resources information;
When above-mentioned resources information meets the first preset condition, container resource is obtained according to said vesse predictive information Request, and node listing is obtained, preset schedule operation is carried out according to said vesse resource request and above-mentioned node listing, thus Obtain destination node;
It is the service creation target container to be predicted according to the container predictive information, and the target container is disposed In the destination node.
The fourth aspect of embodiment according to the present invention proposes a kind of computer readable storage medium, and above-mentioned computer can It reads storage medium and is stored with program, when above procedure is executed by processor, so that above-mentioned processor executes such as above-mentioned method.
Safety container resource regulating method provided by the embodiment of the present invention, by a certain business to be predicted in future Resource requirement in a period of time is made prediction, when the resource requirement for predicting the business increases, by being described to be predicted Service creation target container carries out dilatation, to meet the resource requirement that will increase, further, by scheduling computation to new The target container of creation is scheduled, and finds appropriate node from multiple nodes, is distributed finally by by the target container of the business To the node, using above-mentioned technical proposal, it can accomplish the dilatation in advance before the resource requirement of business increases, rationally divide With resource, improve resource utilization.
Detailed description of the invention
The following detailed description is read with reference to the accompanying drawings, above-mentioned and other mesh of exemplary embodiment of the invention , feature and advantage will become prone to understand.In the accompanying drawings, if showing by way of example rather than limitation of the invention Dry embodiment, in which:
Fig. 1 shows a kind of container resource regulating method flow chart according to an embodiment of the present invention.
Fig. 2 shows another container resource regulating method flow charts according to an embodiment of the present invention.
Fig. 3 shows another container resource regulating method flow chart according to an embodiment of the present invention.
Fig. 4 shows another container resource regulating method flow chart according to an embodiment of the present invention.
Fig. 5 shows another container resource regulating method flow chart according to an embodiment of the present invention.
Fig. 6 shows a kind of container resource scheduling device schematic diagram according to an embodiment of the present invention.
Fig. 7 shows another container resource scheduling device schematic diagram according to an embodiment of the present invention.
Fig. 8 shows a kind of schematic diagram of computer readable storage medium according to an embodiment of the present invention.
In the accompanying drawings, identical or corresponding label indicates identical or corresponding part.
Specific embodiment
The principle and spirit of the invention are described below with reference to several illustrative embodiments.It should be appreciated that providing this A little embodiments are used for the purpose of making those skilled in the art can better understand that realizing the present invention in turn, and be not with any Mode limits the scope of the invention.On the contrary, these embodiments are provided so that this disclosure will be more thorough and complete, and energy It is enough that the scope of the present disclosure is completely communicated to those skilled in the art.
Fig. 1 shows a kind of flow diagram of container resource regulating method, as shown in Figure 1, comprising the following steps:
S101: according to traffic ID to be predicted, duration to be predicted and through resources model trained in advance, to obtain Resources information, and container predictive information is converted by above-mentioned resources information;
S102: it when above-mentioned resources information meets the first preset condition, is obtained and is held according to said vesse predictive information Device resource request, and node listing is obtained, preset schedule fortune is carried out according to said vesse resource request and above-mentioned node listing It calculates, to obtain destination node;
S103: it is above-mentioned service creation target container to be predicted according to said vesse predictive information, and above-mentioned target is held Device is deployed in above-mentioned destination node.
Specifically, in above-mentioned S101, traffic ID to be predicted refers to that user wants to carry out the Business Name of resources, There are multiple business in administration in the middle part of container cluster based on Docker technology;Above-mentioned duration to be predicted refers to inputting duration according to user Data can know time interval to be predicted according to above-mentioned duration to be predicted and current time.
For example, if user wants predictive information of the inquiry business A in following 1 hour, so that it may input that (business A, 1 is small When), above-mentioned traffic ID to be predicted namely business A, above-mentioned duration to be predicted namely 1 hour, time interval to be predicted is (current Time~current time+1 hour);If user wants predictive information of the inquiry business B within 1 day future, so that it may input (industry Be engaged in B, and 24 hours), above-mentioned traffic ID to be predicted namely business B, above-mentioned duration to be predicted namely 24 hours, time zone to be predicted Between namely (current time~current time+24 hours).
Specifically, in above-mentioned S101, resources information refers to that above-mentioned resources model prediction goes out to be predicted The amount of hardware resources that traffic ID needs to expend in time interval to be predicted, such as amount of CPU resource, memory source amount, disk I/O resource amount and network interface card I/O resource amount etc.;Said vesse predictive information refers to the prediction letter of the operation as unit of container Breath, for example, in order to meet the amount of hardware resources that above-mentioned traffic ID to be predicted needs to expend in duration to be predicted, it can be with container The dilatation or capacity reducing executed for unit to the business to be predicted operates, can be with according to pre-configured unit container configuration information Calculate the number of containers for needing dilatation or capacity reducing.
Specifically, in above-mentioned S102, it includes: resources information that above-mentioned resources information, which meets the first preset condition, The situations such as dilatation are executed to the business to be predicted more than Current resource information or the instruction of container predictive information;Said vesse resource Request refers in order to meet the solicited message to hardware resource that said vesse predictive information is issued, for example, to dilatation One container, said vesse resource request can be with resources required in the default container configuration information of above-mentioned business to be predicted Amount is consistent.As shown in table 1, table 1 shows the example of a node listing, and above-mentioned node listing includes each section in cluster The value amount of point, above-mentioned value amount may include CPU value, memory value, disk I/O value and network interface card I/O value, specifically can be by each node Monitoring information obtain, above-mentioned node can be dummy node (such as virtual machine) or entity node (such as server), herein With no restrictions;The purpose of above-mentioned preset schedule operation is that one or more is found from node listing can satisfy said vesse For the node of resource request as destination node, above-mentioned destination node can be the lower node of resource utilization.
Table 1:
CPU Memory Disk I/O Network interface card IO
Node 1 30% 50% 50% 70%
Node 2 35% 52% 60% 56%
Node 3 40% 44% 66% 71%
The basic principle of the present embodiment is, by needing to resource of a certain business to be predicted within following a period of time Ask and make prediction, when predict the business resource requirement increase when, by for the service creation target container to be predicted into Row dilatation further, carries out newly created target container by scheduling computation to meet the resource requirement that will increase Scheduling, finds appropriate node from multiple nodes, the node is assigned to finally by by the target container of the business, in utilization Technical solution is stated, can accomplish dilatation in advance, reasonable distribution resource before the resource requirement of business increases, improve resource use Rate.
Container resource regulating method method based on Fig. 1, some embodiments of the present application additionally provide the adjustment method Some specific embodiments and expansion scheme, are illustrated below.
In one embodiment, when above-mentioned resources information meets the second preset condition, then according to said vesse prediction letter Breath, at least one container to be removed for controlling above-mentioned business to be predicted are out of service.
It specifically, include: that resources information is less than current money when above-mentioned resources information meets the second preset condition Source information or the instruction of container predictive information execute the situations such as capacity reducing operation to the business to be predicted.For example, if above-mentioned resources Model output resources information show business to be predicted in subsequent time period (current time~current time+preset when Between) resources requirement is smaller than current resource occupation amount or said vesse predictive information is indicated to the business to be predicted Capacity reducing is carried out as unit of container.
Further, above-mentioned according to said vesse predictive information, at least one of the above-mentioned business to be predicted of control waits removing appearance Device is out of service to be referred to and arbitrarily selects specified quantity from the corresponding multiple containers of the business to be predicted in cluster manager dual system Container be used as container to be removed, and directly the container to be removed of the specified quantity is shut down.
Business can be held in time when the container demand for the business that predicts will be reduced using above technical scheme Row capacity reducing, reasonable distribution resource further improve the case where maldistribution of the resources is weighed.
Further, some embodiments of the present application also to how to judge resources information meet the first preset condition, And how to judge that resources information meets the second preset condition and carried out exemplary illustration, it specifically includes:
Said vesse predictive information is parsed, judges whether to need to carry out dilatation or contracting to above-mentioned business to be predicted Hold;
If desired dilatation is carried out to above-mentioned business to be predicted, then above-mentioned resources information meets the first preset condition.
Optionally, capacity reducing if desired is carried out to above-mentioned business to be predicted, then it is default to meet second for above-mentioned resources information Condition.
Specifically, the message body content of the container predictive information can be (operation " the first predictive information ", Number " the second predictive information ").
For example, being obtained when receiving the first container predictive information (operation " dilatation ", number " 3 ") by parsing Taking the first predictive information is " dilatation ", that is, can determine whether that the instruction of said vesse predictive information executes dilatation behaviour to above-mentioned business to be predicted Make, may further judge that resources information meets the first preset condition;Optionally, when receiving second container predictive information When (operation " capacity reducing ", number " 1 "), obtaining the first predictive information by parsing is " capacity reducing ", that is, can determine whether needs pair Above-mentioned business to be predicted carries out capacity reducing.
It, can be quick by being parsed to container predictive information without complicated deterministic process using above technical scheme Carry out next step traffic control.
Fig. 2 shows the flow diagrams of another container resource regulating method provided by the invention, in conjunction with the container of Fig. 1 Resource regulating method method, the present embodiment are further illustrated to how obtaining above-mentioned resources model.
The resources of business be one about time series forecasting the problem of, current demand is by past demand It is determined, therefore mostly uses autoregression model in existing technology greatly, such as traditional autoregression model (AR), rolling average mould Type (MA), ARMA model (ARMA) and difference ARMA model (ARIMA).In the present embodiment, It is trained using monitor model xgboost, xgboost is a kind of integrated study model of machine learning.Alternatively it is also possible to It is trained using above-mentioned other cited models.
As shown in Fig. 2, the present embodiment includes the following steps:
S201: being monitored the resource data of at least one business, obtains the time series data of at least one above-mentioned business;
Wherein, at least one above-mentioned business includes above-mentioned business to be predicted, and above-mentioned resource data includes at least CPU value, interior Deposit value, disk I/O value and network interface card I/O value.
S202: preset data processing operation is executed to the time series data of at least one above-mentioned business, thus when obtaining multiple Sequence characteristics form the sample data set for being used for training pattern;
S203: using above-mentioned temporal aspect as input training parameter, being trained above-mentioned xgboost model, thus To above-mentioned resources model;
Specifically, in above-mentioned S201, in practical applications, can be obtained by being connected to the monitor supervision platform of container cluster to The time series data of a few business.Change dependent on the time, can reflect that the data of its variation degree can claim with numerical value Be time series data.There are two crucial indexs for time series data tool: monitoring time and monitoring numerical value, when monitoring time refers to this For ordinal number according to the time of formation, monitoring numerical value refers to the resource information of multiple dimensions, such as: CPU value, memory value, disk I/O value And network interface card I/O value.
Specifically, in above-mentioned S202, preset data processing operation includes carrying out Feature Engineering and polymerization to time series data Processing.
Wherein, it will be appreciated by persons skilled in the art that the purpose of Feature Engineering, is incited somebody to action by a series of operation The time series data of acquisition is indicated using more efficient coding mode (feature).Also original sample data is changed into and is used for mould The training data of type training, in general, Feature Engineering specifically include found out from original sample data it is some to subsequent number According to the significant feature of excavation.In the present embodiment, feature selected in features described above engineering may include time series feature With service feature, wherein time series feature be can be, for example, during celebrating a festival, weekend with it is each in non-weekend, one day Day is launched in hour, advertisement;Above-mentioned service feature can be, such as the front and back attribute of business affiliated function, business.Using above-mentioned Time series data can be converted into temporal aspect by preset classifying rules.
Further, many business scenarios usually need to carry out polymerization processing to above-mentioned time series data, can using when Between dimension polymerization methods, such as the time series data at same time point can be condensed together to obtain and gather the time series data of same period It is combined;Can also be using the polymerization methods in other dimensions, such as can will belong to the when ordinal number of the business of same department According to condensing together.For above-mentioned polymerization methods, polymerizeing index includes: AVG, MIN, MAX, STDDEV;Before polymerizing windows include: 1/2/4 hour, it is 7/14/30 day first.
Specifically, in above-mentioned S203, in the training process, sample data set can also be divided, it is specific to divide For training set and test set;For example, resource data in January~March can be used if wanting to predict the resource requirement in May As training set, using the resource data in April as test set.
Using above technical scheme, compared to traditional timing resources model, the present embodiment is by using supervision mould Type xgboost, can be by the resources model integrated of multiple business into a model, and ensure that resources model Accuracy.
Fig. 3 shows the flow diagram of another container resource regulating method provided by the invention, in conjunction with Fig. 1, this reality Apply example further to how by traffic ID to be predicted and duration to be predicted input through resources model trained in advance, thus It obtains resources information to illustrate, as shown in figure 3, including the following steps:
S301: obtaining the service feature of at least one dimension according to above-mentioned traffic ID to be predicted, according to it is above-mentioned to be predicted when Long and current time generates the temporal characteristics of at least one dimension;
S302: it according to the temporal characteristics of the service feature of at least one above-mentioned dimension and at least one above-mentioned dimension, generates Temporal aspect to be predicted;
S303: being input to above-mentioned resources model for above-mentioned temporal aspect to be predicted, to obtain above-mentioned to be predicted Above-mentioned resources information of the business in above-mentioned duration to be predicted.
For example, traffic ID to be predicted is business C, user's input it is to be predicted when a length of n, current time T, therefore predict Time is (T+1, T+2 ..., T+n), through this embodiment available time series { Rt, t=T+1, T+2 ..., T+n }, In, the Rt on each time point is the multi-C vector being made of multiple features.Feature can be according to above-mentioned business to be predicted The service feature that ID is obtained, such as business C can be 1. Batch Processing, 2. sales department's business etc., can also be according to upper State the temporal characteristics that duration and current time to be predicted obtain, for example, 1. weekend, when 2. day, are launched in advertisement at 3. 10 points~11 Between section etc., further, may make up a multi-C vector after combining above-mentioned multiple temporal characteristics with multiple service features Rt, the multi-C vector Rt on each time point constitute above-mentioned time series { Rt, t=T+1, T+2 ..., T+n }.
Further, above-mentioned temporal aspect { Rt, t=T+1, T+2 ..., T+n } to be predicted is input to and is trained in advance Resources model, can be obtained business C in the duration to be predicted after current time (T+1, T+2 ..., T+n) money Source predictive information, the resources information specifically include following a few class resource informations: CPU value, memory value, disk I/O value, network interface card I/O value.
Fig. 4 shows the flow diagram of another container resource regulating method provided by the invention, in conjunction with Fig. 1, this reality Example is applied further to illustrate to how converting container predictive information for above-mentioned resources information, as shown in figure 4, Include the following steps:
S401: the current container amount, above-mentioned to be predicted of above-mentioned business to be predicted is obtained according to the ID of above-mentioned business to be predicted The default container configuration information of business.
S402: according to the default container configuration information of the current container amount of above-mentioned business to be predicted, above-mentioned business to be predicted, Convert the above-mentioned resources information of above-mentioned business to be predicted to the said vesse predictive information of above-mentioned business to be predicted.
Specifically, in above-mentioned S401, working as business to be predicted can be directly known by inquiring container cluster manager dual system The quantity of preceding container amount namely current container;The default container configuration information of above-mentioned business to be predicted is in the business to be predicted It is pre-configured by user at the beginning of line.
Specifically, in above-mentioned S402, by current container amount with default container configuration information you can learn that this is to be predicted Stock number provided by the existing container of business, further by comparing resource provided by the existing container of business to be predicted Amount with the subsequent time required resources information of business to be predicted, you can learn that whether need to the business to be predicted into Row dilatation or capacity reducing.
Specifically, above-mentioned resources information may include: the CPU value of above-mentioned business demand to be predicted, memory value, disk I/O value and network interface card I/O value;
Such as: above-mentioned resources information can be { CPU=1 core, memory=512M, disk I/O=10M, network interface card IO= 10M}
Specifically, above-mentioned default container configuration information may include: the CPU configuration of the unit container of above-mentioned business to be predicted Information and memory configurations information.
For example, above-mentioned default container configuration information can be { CPU=1 core, memory=512M }
Specifically, said vesse predictive information includes the container operation type executed to above-mentioned business to be predicted and container Quantity, said vesse action type include dilatation/or capacity reducing.
For example, said vesse predictive information can be { " operation ": " dilatation ", " number ": " 1 " }, it is above-mentioned Operation namely the container operation type executed to above-mentioned business to be predicted, can be " dilatation " or " capacity reducing ", and above-mentioned " Number " namely number of containers corresponding to aforesaid operations type, such as { " operation ": " dilatation ", " number ": " 1 " } It refers to as one container of business dilatation to be predicted.Using above technical scheme, the present embodiment is able to the resource that will be abstracted Predictive information is embodied as the predictive information as unit of container.
Container resource regulating method method based on Fig. 1, some embodiments of the present application are further to the acquisition in S102 Node listing illustrates, and can specifically include:
(1) each node in above-mentioned cluster is monitored, obtains the current CPU value of each above-mentioned node and worked as Preceding memory value.
Specifically, the current CPU value and current memory value of each above-mentioned node can voluntarily be obtained from node, It can be and obtained by cluster manager dual system (swarm-manager).
(2) disk I/O for calculating each above-mentioned node in preset time is averaged occupancy, by each above-mentioned node Disk I/O is averaged above-mentioned current disk I/O value of the occupancy as each above-mentioned node.
(3) the network interface card IO for calculating each above-mentioned node in preset time is averaged occupancy, by each above-mentioned node Network interface card IO is averaged above-mentioned current network interface card I/O value of the occupancy as each above-mentioned node.
Fig. 5 shows the flow diagram of another container resource regulating method provided by the invention, in conjunction with Fig. 1, this reality It applies example further to illustrate to based on said vesse resource request and the above-mentioned scheduling computation of node listing progress, such as scheme Shown in 5, include the following steps:
S501: calling Pessimistic Locking, carries out the first screening by presetting strong restrictive condition, obtained from above-mentioned node listing to A few first node;
S502: the second screening is carried out by default weak limited condition, is obtained from least one above-mentioned first node above-mentioned Destination node, and the Pessimistic Locking is discharged after obtaining above-mentioned destination node;
Specifically, the purpose of above-mentioned scheduling computation is to find suitable destination node from above-mentioned node listing, so that Every resource value in the destination node is satisfied CPU value, memory value, disk I/O value and network interface card in container resource request The requirement of I/O value.
Specifically, in above-mentioned S501, preset strong restrictive condition include: above-mentioned first node above-mentioned current CPU value with it is upper It states current memory value and meets third preset condition, wherein above-mentioned third preset condition is formed according to said vesse resource request.
Further, the first screening process specifically includes: according to the current CPU value of first node and current memory value, with And the configuration information of each node, the remaining CPU value and free memory value of each node are conversed, whether judges each node Meet the cpu demand in container resource request and memory requirements, finds qualified node as first node.Above-mentioned third Preset condition namely according in container resource request cpu demand and memory requirements set by Rule of judgment.
Specifically, in above-mentioned S502, default weak limited condition includes: that the above-mentioned current disk I/O value of above-mentioned destination node is small Above-mentioned current disk I/O value in second node, above-mentioned network interface card I/O value are less than the above-mentioned network interface card I/O value in second node, wherein Above-mentioned second node include at least one above-mentioned first node some or all of in addition to above-mentioned destination node node.
For example, locked when execution first is screened by using distribution calculating process of the Pessimistic Locking to CPU, memory, it can It is limited by force with the distribution to CPU, memory, if the CPU value or memory value in cluster in each node are not enough to completely CPU value or memory value in sufficient container resource request can then directly result in distribution failure.Relatively, when execution second is screened, Weak limitation is carried out to the distribution of disk I/O, network interface card IO, that is, meeting container resource request if existing at least one first node In disk I/O value demand and network interface card I/O value demand multiple nodes, then will export disk I/O at least one above-mentioned first node Utilization rate or the minimum node of network interface card utilization rate are as destination node;However, if there is no meet at least one first node The node of disk I/O value demand and network interface card I/O value demand in container resource request, then directly from least one above-mentioned first node In find disk I/O utilization rate and the minimum node of network interface card utilization rate, and exported as destination node.
Using above-mentioned technical proposal, the present embodiment in the node assigning process based on CPU value, memory value by using compassion Lock and strong restrictive condition are seen, has sufficiently ensured the feasibility of container scheduling, and by based on disk I/O value and network interface card I/O value Weak limited condition is used in node assigning process, has ensured the high efficiency of container scheduling.
Fig. 6 shows a kind of structural schematic diagram of container resource scheduling device, as shown in Figure 6, comprising:
Prediction module 601, for according to traffic ID to be predicted, duration to be predicted and through resources mould trained in advance Type to obtain resources information, and converts container predictive information for above-mentioned resources information;
Scheduling computation module 602 is used for when above-mentioned resources information meets the first preset condition, according to the container Predictive information obtains container resource request, and obtains node listing, according to said vesse resource request and above-mentioned node listing Preset schedule operation is carried out, to obtain destination node;
Execution module 603 is dispatched, for being above-mentioned service creation target container to be predicted according to said vesse predictive information, And above-mentioned target container is deployed in above-mentioned destination node.
Specifically, in the above-mentioned description to prediction module 601, traffic ID to be predicted refers to that user wants to carry out resource There are multiple business in the Business Name of prediction, the container cluster middle part administration based on Docker technology;Above-mentioned duration to be predicted refers to Time interval to be predicted can be known according to above-mentioned duration to be predicted and current time by inputting duration data according to user.
For example, if user wants predictive information of the inquiry business A in following 1 hour, so that it may input that (business A, 1 is small When), above-mentioned traffic ID to be predicted namely business A, above-mentioned duration to be predicted namely 1 hour, time interval to be predicted is (current Time~current time+1 hour);If user wants predictive information of the inquiry business B within 1 day future, so that it may input (industry Be engaged in B, and 24 hours), above-mentioned traffic ID to be predicted namely business B, above-mentioned duration to be predicted namely 24 hours, time zone to be predicted Between namely (current time~current time+24 hours).
Specifically, in the above-mentioned description to prediction module 601, resources information refers to above-mentioned resources model The amount of hardware resources that the traffic ID to be predicted predicted needs to expend in time interval to be predicted, for example, it is amount of CPU resource, interior Deposit stock number, disk I/O stock number and network interface card I/O resource amount etc.;Said vesse predictive information refers to as unit of container Operation predictive information, for example, in order to meet the hardware resource that above-mentioned traffic ID to be predicted needs to expend in duration to be predicted Amount, the dilatation or capacity reducing operation that can be executed as unit of container to the business to be predicted, holds according to pre-configured unit Device configuration information can calculate the number of containers for needing dilatation or capacity reducing.
Specifically, in the above-mentioned description to scheduling computing module 602, above-mentioned resources information meets the first default item Part includes: that resources information is more than that Current resource information or the instruction of container predictive information execute dilatation to the business to be predicted Etc. situations;Said vesse resource request refers in order to which meet that said vesse predictive information issued asks hardware resource Information is sought, for example, said vesse resource request can match with the default container of above-mentioned business to be predicted to one container of dilatation Required stock number is consistent in confidence breath.As shown in table 1, table 1 shows the example of a node listing, above-mentioned node column Table includes the value amount of each node in cluster, and above-mentioned value amount may include CPU value, memory value, disk I/O value and network interface card I/O value, It can specifically be obtained by the monitoring information to each node, above-mentioned node can be dummy node (such as virtual machine) or entity section Point (such as server), herein with no restrictions;The purpose of above-mentioned preset schedule operation be to find from node listing one or Multiple nodes that can satisfy said vesse resource request as destination node, above-mentioned destination node can be resource utilization compared with Low node.
Table 1:
CPU Memory Disk I/O Network interface card IO
Node 1 30% 50% 50% 70%
Node 2 35% 52% 60% 56%
Node 3 40% 44% 66% 71%
The basic principle of the present embodiment is, by needing to resource of a certain business to be predicted within following a period of time Ask and make prediction, when predict the business resource requirement increase when, by for the service creation target container to be predicted into Row dilatation further, carries out newly created target container by scheduling computation to meet the resource requirement that will increase Scheduling, finds appropriate node from multiple nodes, the node is assigned to finally by by the target container of the business, in utilization Technical solution is stated, can accomplish dilatation in advance, reasonable distribution resource before the resource requirement of business increases, improve resource use Rate.
Optionally, wherein above-mentioned scheduling execution module 603 is also used to:
When above-mentioned resources information meets the second preset condition, then according to said vesse predictive information, control it is above-mentioned to At least one of prediction business container to be removed is out of service.
Optionally, wherein above-mentioned resources model is based on xgboost model training and is formed, above-mentioned apparatus further include:
Monitoring module is monitored for the resource data at least one business, obtains at least one above-mentioned business Time series data;
Training module executes preset data processing operation for the time series data at least one above-mentioned business, thus To multiple temporal aspects, the sample data set for being used for training pattern is formed;
Using above-mentioned temporal aspect as input training parameter, above-mentioned xgboost model is trained, to obtain above-mentioned Resources model;
Wherein, at least one above-mentioned business includes above-mentioned business to be predicted, and above-mentioned resource data includes at least CPU value, interior Deposit value, disk I/O value and network interface card I/O value.
Optionally, above-mentioned prediction module 601 is also used to:
The service feature that at least one dimension is obtained according to above-mentioned traffic ID to be predicted, according to above-mentioned duration to be predicted and Current time generates the temporal characteristics of at least one dimension;
According to the temporal characteristics of the service feature of at least one above-mentioned dimension and at least one above-mentioned dimension, generate to be predicted Temporal aspect;
Above-mentioned temporal aspect to be predicted is input to above-mentioned resources model, is existed to obtain above-mentioned business to be predicted The above-mentioned resources information in above-mentioned duration to be predicted after current time.
Optionally, wherein above-mentioned prediction module 601 is also used to:
The current container amount of above-mentioned business to be predicted, above-mentioned business to be predicted are obtained according to the ID of above-mentioned business to be predicted Default container configuration information;
It, will be upper according to the default container configuration information of the current container amount of above-mentioned business to be predicted, above-mentioned business to be predicted The above-mentioned resources information for stating business to be predicted is converted into the said vesse predictive information of above-mentioned business to be predicted;
Wherein, above-mentioned resources information include: the CPU value of above-mentioned business demand to be predicted, memory value, disk I/O value with And network interface card I/O value;
Said vesse predictive information includes the container operation type and number of containers executed to above-mentioned business to be predicted, on Stating container operation type includes dilatation/or capacity reducing;
Above-mentioned default container configuration information includes: the CPU configuration information and memory of the unit container of above-mentioned business to be predicted Configuration information.
Optionally, wherein above-mentioned apparatus further includes judgment module, is used for:
Said vesse predictive information is parsed, judges whether to need to carry out dilatation or contracting to above-mentioned business to be predicted Hold;
If desired dilatation is carried out to above-mentioned business to be predicted, then above-mentioned resources information meets the first preset condition;With And
If desired capacity reducing is carried out to above-mentioned business to be predicted, then above-mentioned resources information meets the second preset condition.
Optionally, wherein above-mentioned scheduling computation module 602 is used for:
Each node in above-mentioned cluster is monitored, obtain above-mentioned each node above-mentioned current CPU value and Above-mentioned current memory value;
The disk I/O for calculating each above-mentioned node in preset time is averaged occupancy, by the disk of each above-mentioned node IO is averaged above-mentioned current disk I/O value of the occupancy as each above-mentioned node;
The network interface card IO for calculating each above-mentioned node in preset time is averaged occupancy, by the network interface card of each above-mentioned node IO is averaged above-mentioned current network interface card I/O value of the occupancy as each above-mentioned node.
Optionally, wherein above-mentioned scheduling computation module 602 is also used to:
Pessimistic Locking is called, the first screening is carried out by presetting strong restrictive condition, at least one is obtained from the node listing A first node;
The second screening is carried out by default weak limited condition, above-mentioned target section is obtained from least one above-mentioned first node Point, and the Pessimistic Locking is discharged after obtaining above-mentioned destination node;
Wherein, above-mentioned to preset the above-mentioned current CPU value and above-mentioned current memory that strong restrictive condition includes: above-mentioned first node Value meets third preset condition, wherein above-mentioned third preset condition is formed according to said vesse resource request;
Above-mentioned default weak limited condition includes: that the above-mentioned current disk I/O value of above-mentioned destination node is less than in second node Above-mentioned current disk I/O value, above-mentioned network interface card I/O value are less than the above-mentioned network interface card I/O value in second node, wherein above-mentioned second node packet Include at least one above-mentioned first node the node some or all of in addition to above-mentioned destination node.
After describing the method and apparatus of exemplary embodiment of the invention, next, introducing according to the present invention The container resource scheduling device of another aspect.
Person of ordinary skill in the field it is understood that various aspects of the invention can be implemented as equipment, method or Computer readable storage medium.Therefore, various aspects of the invention can be embodied in the following forms, it may be assumed that complete hardware The embodiment party combined in terms of embodiment, complete Software Implementation (including firmware, microcode etc.) or hardware and software Formula may be collectively referred to as " circuit ", " module " or " equipment " here.
In some possible embodiments, the adaptive voice end point detecting device of the invention based on frequency domain energy can To include at least one or more processors and at least one processor.Wherein, the memory is stored with program, works as institute When stating program and being executed by the processor, so that the processor executes step as shown in Figure 1:
S101: according to traffic ID to be predicted, duration to be predicted and through resources model trained in advance, to obtain Resources information, and container predictive information is converted by above-mentioned resources information;
S102: it when above-mentioned resources information meets the first preset condition, is obtained and is held according to the container predictive information Device resource request, and node listing is obtained, preset schedule fortune is carried out according to said vesse resource request and above-mentioned node listing It calculates, to obtain destination node;
S103: it is above-mentioned service creation target container to be predicted according to said vesse predictive information, and above-mentioned target is held Device is deployed in above-mentioned destination node.
In addition, when described program of the invention is executed by the processor, also making described although attached be not shown in the figure Processor executes other operations or step described in above-mentioned example method.
The container resource scheduling device 7 of this embodiment according to the present invention is described referring to Fig. 7.Fig. 7 is shown Device 7 be only an example, should not function to the embodiment of the present invention and use scope bring any restrictions.
As shown in fig. 7, device 7 can be showed in the form of universal computing device, including but not limited to: at least one processing Device 10, at least one processor 20, the bus 60 for connecting distinct device component.
Bus 60 includes data/address bus, address bus and control bus.
Memory 20 may include volatile memory, such as random access memory (RAM) 21 and/or cache are deposited Reservoir 22 can further include read-only memory (ROM) 23.
Memory 20 can also include program module 24, and such program module 24 includes but is not limited to: operation equipment, one It can in a or multiple application programs, other program modules and program data, each of these examples or certain combination It can include the realization of network environment.
Device 7 can also be communicated with one or more external equipments 2 (such as keyboard, sensing equipment, bluetooth equipment etc.), It can be communicated with one or more other equipment.This communication can be carried out by input/output (I/O) interface 40, and It is shown on display unit 30.Also, device 7 can also pass through network adapter 50 and one or more network (example Such as local area network (LAN), wide area network (WAN) and/or public network, such as internet) communication.As shown, network adapter 50 It is communicated by bus 60 with other modules in device 7.It should be understood that although not shown in the drawings, but can be used with coupling apparatus 7 Other hardware and/or software module, including but not limited to: microcode, device driver, redundant processing unit, external disk drive Dynamic array, RAID device, tape drive and data backup storage equipment etc..
In some possible embodiments, various aspects of the invention are also implemented as a kind of computer-readable storage The form of medium comprising program code, when said program code is when being executed by processor, said program code is for making institute It states processor and executes method described above.
Method described above include shown in drawings above with unshowned multiple operations and step, here will not It repeats again.
The computer readable storage medium can be using any combination of one or more readable mediums.Readable medium can To be readable signal medium or readable storage medium storing program for executing.Readable storage medium storing program for executing for example may be-but not limited to-electricity, magnetic, Optical, electromagnetic, the equipment of infrared ray or semiconductor, equipment or device, or any above combination.Readable storage medium storing program for executing is more Specific example (non exhaustive list) includes: the electrical connection with one or more conducting wires, portable disc, hard disk, deposits at random It is access to memory (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable Compact disk read-only memory (CD-ROM), light storage device, magnetic memory device or above-mentioned any appropriate combination.
As shown in figure 8, describing the computer readable storage medium 80 of embodiment according to the present invention, can use Portable compact disc read only memory (CD-ROM) and including program code, and can be on terminal device, such as PC Operation.However, computer readable storage medium of the invention is without being limited thereto, in this document, readable storage medium storing program for executing, which can be, appoints What include or the tangible medium of storage program that the program can be commanded and execute equipment, equipment or device use or and its It is used in combination.
The program for executing operation of the present invention can be write with any combination of one or more programming languages Code, described program design language include object oriented program language-Java, C++ etc., further include conventional Procedural programming language-such as " C " language or similar programming language.Program code can be fully in user It is executed in calculating equipment, partly execution part executes on a remote computing or completely long-range on a user device It calculates and is executed on equipment or server.In the situation for being related to remote computing device, remote computing device can be by any number of The network of class --- it is connected to user calculating equipment including local area network (LAN) or wide area network (WAN)-, or, it may be connected to External computing device (such as being connected using ISP by internet).
In addition, although describing the operation of the method for the present invention in the accompanying drawings with particular order, this do not require that or Hint must execute these operations in this particular order, or have to carry out shown in whole operation be just able to achieve it is desired As a result.Additionally or alternatively, it is convenient to omit multiple steps are merged into a step and executed by certain steps, and/or by one Step is decomposed into execution of multiple steps.
Although detailed description of the preferred embodimentsthe spirit and principles of the present invention are described by reference to several, it should be appreciated that, this It is not limited to the specific embodiments disclosed for invention, does not also mean that the feature in these aspects cannot to the division of various aspects Combination is benefited to carry out, this to divide the convenience merely to statement.The present invention is directed to cover appended claims spirit and Included various modifications and equivalent arrangements in range.

Claims (18)

1. a kind of container resource regulating method, which is characterized in that the described method includes:
According to traffic ID to be predicted, duration to be predicted and through resources model trained in advance, to obtain resources Information, and container predictive information is converted by the resources information;
When the resources information meets the first preset condition, container resource is obtained according to the container predictive information and is asked It asks, and obtains node listing, preset schedule operation is carried out according to the container resource request and the node listing, thus To destination node;
It is the service creation target container to be predicted according to the container predictive information, and the target container is deployed in institute State destination node.
2. container resource regulating method as described in claim 1, which is characterized in that the method also includes:
When the resources information meets the second preset condition, then according to the container predictive information, control is described to be predicted At least one of business container to be removed is out of service.
3. container resource regulating method as described in claim 1, which is characterized in that the resources model is based on Xgboost model training is formed, the method also includes:
The resource data of at least one business is monitored, the time series data of at least one business is obtained;
Preset data processing operation is executed to the time series data of at least one business, to obtain multiple temporal aspects, shape At the sample data set for training pattern;
Using the temporal aspect as input training parameter, the xgboost model is trained, to obtain the resource Prediction model;
Wherein, at least one described business include the business to be predicted, the resource data include at least CPU value, memory value, Disk I/O value and network interface card I/O value.
4. container resource regulating method as described in claim 1, which is characterized in that
The resources model through training in advance by traffic ID to be predicted and duration to be predicted input, to obtain resource Predictive information includes:
The service feature that at least one dimension is obtained according to the traffic ID to be predicted, according to the duration to be predicted and currently Time generates the temporal characteristics of at least one dimension;
According to the temporal characteristics of the service feature of at least one dimension and at least one dimension, when generating to be predicted Sequence characteristics;
The temporal aspect to be predicted is input to the resources model, to obtain the business to be predicted current The resources information in the duration to be predicted after time.
5. container resource regulating method as described in claim 1, which is characterized in that convert appearance for the resources information Device predictive information includes:
According to the ID of the business to be predicted obtain the current container amount of the business to be predicted, the business to be predicted it is default Container configuration information;
According to the default container configuration information of the current container amount of the business to be predicted, the business to be predicted, will it is described to The resources information of prediction business is converted into the container predictive information of the business to be predicted;
Wherein, the resources information includes: CPU value, memory value, disk I/O value and the net of the business demand to be predicted Card I/O value;
The container predictive information includes the container operation type and number of containers executed to the business to be predicted, the appearance Device action type includes dilatation/or capacity reducing;
The default container configuration information includes: the CPU configuration information and memory configurations of the unit container of the business to be predicted Information.
6. container resource regulating method as claimed in claim 2, which is characterized in that the method also includes:
The container predictive information is parsed, judges whether to need to carry out dilatation or capacity reducing to the business to be predicted;
If desired dilatation is carried out to the business to be predicted, then the resources information meets the first preset condition;And
If desired capacity reducing is carried out to the business to be predicted, then the resources information meets the second preset condition.
7. container resource regulating method as described in claim 1, which is characterized in that when the container predictive information meets first When preset condition, the acquisition node listing includes:
Each node in the cluster is monitored, the current CPU value of each node and described is obtained Current memory value;
The disk I/O for calculating each node in preset time is averaged occupancy, and the disk I/O of each node is put down The current disk I/O value of the equal occupancy as each node;
The network interface card IO for calculating each node in preset time is averaged occupancy, and the network interface card IO of each node is put down The current network interface card I/O value of the equal occupancy as each node.
8. container resource regulating method as claimed in claim 7, which is characterized in that it is described based on the container resource request and Node listing carries out the scheduling computation
Call Pessimistic Locking, carry out the first screening by presetting strong restrictive condition, obtained from the node listing at least one the One node;
The second screening is carried out by default weak limited condition, obtains the destination node from least one described first node, And the Pessimistic Locking is discharged after obtaining the destination node;
Wherein,
It is described that preset strong restrictive condition include: that the current CPU value of the first node and the current memory value meet Three preset conditions, wherein the third preset condition is formed according to the container resource request;
The default weak limited condition includes: the current disk I/O value of the destination node less than described in second node Current disk I/O value, the network interface card I/O value are less than the network interface card I/O value in second node, wherein the second node includes institute State at least one first node the node some or all of in addition to the destination node.
9. a kind of container resource scheduling device, which is characterized in that described device includes:
Prediction module, for according to traffic ID to be predicted, duration to be predicted and through resources model trained in advance, thus Resources information is obtained, and converts container predictive information for the resources information;
Scheduling computation module, for predicting to believe according to the container when the resources information meets the first preset condition Breath obtains container resource request, and obtains node listing, is carried out according to the container resource request and the node listing pre- If scheduling computation, to obtain destination node;
Execution module is dispatched, for being the service creation target container to be predicted according to the container predictive information, and by institute It states target container and is deployed in the destination node.
10. container resource scheduling device as claimed in claim 9, which is characterized in that the scheduling execution module is also used to:
When the resources information meets the second preset condition, then according to the container predictive information, control is described to be predicted At least one of business container to be removed is out of service.
11. container resource scheduling device as claimed in claim 9, which is characterized in that the resources model is based on Xgboost model training is formed, described device further include:
Monitoring module is monitored for the resource data at least one business, obtains the timing of at least one business Data;
Training module executes preset data processing operation for the time series data at least one business, to obtain more A temporal aspect forms the sample data set for being used for training pattern;And using the temporal aspect as input training parameter, The xgboost model is trained, to obtain the resources model;
Wherein, at least one described business include the business to be predicted, the resource data include at least CPU value, memory value, Disk I/O value and network interface card I/O value.
12. container resource scheduling device as claimed in claim 9, which is characterized in that
The prediction module is also used to:
The service feature that at least one dimension is obtained according to the traffic ID to be predicted, according to the duration to be predicted and currently Time generates the temporal characteristics of at least one dimension;
According to the temporal characteristics of the service feature of at least one dimension and at least one dimension, when generating to be predicted Sequence characteristics;
The temporal aspect to be predicted is input to the resources model, to obtain the business to be predicted current The resources information in the duration to be predicted after time.
13. container resource scheduling device as claimed in claim 9, which is characterized in that the prediction module is also used to:
According to the ID of the business to be predicted obtain the current container amount of the business to be predicted, the business to be predicted it is default Container configuration information;
According to the default container configuration information of the current container amount of the business to be predicted, the business to be predicted, will it is described to The resources information of prediction business is converted into the container predictive information of the business to be predicted;
Wherein, the resources information includes: CPU value, memory value, disk I/O value and the net of the business demand to be predicted Card I/O value;
The container predictive information includes the container operation type and number of containers executed to the business to be predicted, the appearance Device action type includes dilatation/or capacity reducing;
The default container configuration information includes: the CPU configuration information and memory configurations of the unit container of the business to be predicted Information.
14. container resource scheduling device as claimed in claim 10, which is characterized in that described device further includes judgment module, For:
The container predictive information is parsed, judges whether to need to carry out dilatation or capacity reducing to the business to be predicted;
If desired dilatation is carried out to the business to be predicted, then the resources information meets the first preset condition;And
If desired capacity reducing is carried out to the business to be predicted, then the resources information meets the second preset condition.
15. container resource scheduling device as claimed in claim 9, which is characterized in that the scheduling computation module is used for:
Each node in the cluster is monitored, the current CPU value of each node and described is obtained Current memory value;
The disk I/O for calculating each node in preset time is averaged occupancy, and the disk I/O of each node is put down The current disk I/O value of the equal occupancy as each node;
The network interface card IO for calculating each node in preset time is averaged occupancy, and the network interface card IO of each node is put down The current network interface card I/O value of the equal occupancy as each node.
16. container resource scheduling device as claimed in claim 15, which is characterized in that the scheduling computation module is also used to:
Call Pessimistic Locking, carry out the first screening by presetting strong restrictive condition, obtained from the node listing at least one the One node;
The second screening is carried out by default weak limited condition, obtains the destination node from least one described first node, And the Pessimistic Locking is discharged after obtaining the destination node;
Wherein,
It is described that preset strong restrictive condition include: that the current CPU value of the first node and the current memory value meet Three preset conditions, wherein the third preset condition is formed according to the container resource request;
The default weak limited condition includes: the current disk I/O value of the destination node less than described in second node Current disk I/O value, the network interface card I/O value are less than the network interface card I/O value in second node, wherein the second node includes institute State at least one first node the node some or all of in addition to the destination node.
17. a kind of container dispatching device characterized by comprising
One or more processor;
Memory, for storing one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processing Device is realized:
According to traffic ID to be predicted, duration to be predicted and through resources model trained in advance, to obtain resources Information, and container predictive information is converted by the resources information;
When the resources information meets the first preset condition, container resource is obtained according to the container predictive information and is asked It asks, and obtains node listing, preset schedule operation is carried out according to the container resource request and the node listing, thus To destination node;
It is the service creation target container to be predicted according to the container predictive information, and the target container is deployed in institute State destination node.
18. a kind of computer readable storage medium, the computer-readable recording medium storage has program, when described program is located When managing device execution, so that the processor executes such as method of any of claims 1-8.
CN201811590276.4A 2018-12-25 2018-12-25 A kind of container resource regulating method, device and computer readable storage medium Pending CN109753356A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811590276.4A CN109753356A (en) 2018-12-25 2018-12-25 A kind of container resource regulating method, device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811590276.4A CN109753356A (en) 2018-12-25 2018-12-25 A kind of container resource regulating method, device and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN109753356A true CN109753356A (en) 2019-05-14

Family

ID=66402997

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811590276.4A Pending CN109753356A (en) 2018-12-25 2018-12-25 A kind of container resource regulating method, device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109753356A (en)

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110659104A (en) * 2019-08-29 2020-01-07 重庆小雨点小额贷款有限公司 Service monitoring method and related equipment
CN110727512A (en) * 2019-09-30 2020-01-24 星环信息科技(上海)有限公司 Cluster resource scheduling method, device, equipment and storage medium
CN110781576A (en) * 2019-09-09 2020-02-11 腾讯科技(深圳)有限公司 Simulation node scheduling method, device and equipment
CN111049747A (en) * 2019-12-18 2020-04-21 北京计算机技术及应用研究所 Intelligent virtual network path planning method for large-scale container cluster
CN111274576A (en) * 2020-01-17 2020-06-12 济南浪潮高新科技投资发展有限公司 Control method, system, equipment and medium for intelligent contract operating environment
CN111427696A (en) * 2020-04-07 2020-07-17 上海飞旗网络技术股份有限公司 Service resource scheduling method and device
CN111724067A (en) * 2020-06-22 2020-09-29 中国银行股份有限公司 Resource scheduling method and device
CN112130984A (en) * 2019-06-25 2020-12-25 中国电信股份有限公司 Resource processing method, device and computer readable storage medium
WO2021012956A1 (en) * 2019-07-22 2021-01-28 腾讯科技(深圳)有限公司 Resource processing method for cloud platform, and related device and storage medium
CN112363825A (en) * 2020-10-16 2021-02-12 北京五八信息技术有限公司 Elastic expansion method and device
CN112445577A (en) * 2020-11-30 2021-03-05 广州文远知行科技有限公司 Container adding method and device, terminal equipment and storage medium
CN112631776A (en) * 2020-12-26 2021-04-09 中国农业银行股份有限公司 Kafka partition expansion method and device, storage medium and computer equipment
CN113031976A (en) * 2021-03-26 2021-06-25 山东英信计算机技术有限公司 Ambari-based cluster capacity management method, device and medium
CN114003378A (en) * 2021-10-26 2022-02-01 深圳证券信息有限公司 Container cluster load balancing method, device, equipment and storage medium
CN114116186A (en) * 2020-08-26 2022-03-01 中国电信股份有限公司 Resource dynamic scheduling method and device
WO2022105589A1 (en) * 2020-11-20 2022-05-27 上海连尚网络科技有限公司 Resource scheduling method and apparatus, electronic device and computer readable medium
CN110764903B (en) * 2019-09-19 2023-06-16 平安科技(深圳)有限公司 Method, apparatus, device and storage medium for elastically performing heat container
CN116610270A (en) * 2023-07-21 2023-08-18 湖南马栏山视频先进技术研究院有限公司 Video processing calculation and separation method and video calculation and separation system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106408184A (en) * 2016-09-12 2017-02-15 中山大学 User credit evaluation model based on multi-source heterogeneous data
CN107729126A (en) * 2016-08-12 2018-02-23 中国移动通信集团浙江有限公司 A kind of method for scheduling task and device of container cloud
CN108228347A (en) * 2017-12-21 2018-06-29 上海电机学院 The Docker self-adapting dispatching systems that a kind of task perceives
CN108632365A (en) * 2018-04-13 2018-10-09 腾讯科技(深圳)有限公司 Service Source method of adjustment, relevant apparatus and equipment
CN108984269A (en) * 2018-07-16 2018-12-11 中山大学 Container resource provision method and system based on random regression forest model

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107729126A (en) * 2016-08-12 2018-02-23 中国移动通信集团浙江有限公司 A kind of method for scheduling task and device of container cloud
CN106408184A (en) * 2016-09-12 2017-02-15 中山大学 User credit evaluation model based on multi-source heterogeneous data
CN108228347A (en) * 2017-12-21 2018-06-29 上海电机学院 The Docker self-adapting dispatching systems that a kind of task perceives
CN108632365A (en) * 2018-04-13 2018-10-09 腾讯科技(深圳)有限公司 Service Source method of adjustment, relevant apparatus and equipment
CN108984269A (en) * 2018-07-16 2018-12-11 中山大学 Container resource provision method and system based on random regression forest model

Cited By (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112130984A (en) * 2019-06-25 2020-12-25 中国电信股份有限公司 Resource processing method, device and computer readable storage medium
WO2021012956A1 (en) * 2019-07-22 2021-01-28 腾讯科技(深圳)有限公司 Resource processing method for cloud platform, and related device and storage medium
US11966792B2 (en) 2019-07-22 2024-04-23 Tencent Technology (Shenzhen) Company Limited Resource processing method of cloud platform, related device, and storage medium
CN110659104A (en) * 2019-08-29 2020-01-07 重庆小雨点小额贷款有限公司 Service monitoring method and related equipment
CN110659104B (en) * 2019-08-29 2022-06-24 重庆小雨点小额贷款有限公司 Service monitoring method and related equipment
CN110781576A (en) * 2019-09-09 2020-02-11 腾讯科技(深圳)有限公司 Simulation node scheduling method, device and equipment
CN110764903B (en) * 2019-09-19 2023-06-16 平安科技(深圳)有限公司 Method, apparatus, device and storage medium for elastically performing heat container
CN110727512A (en) * 2019-09-30 2020-01-24 星环信息科技(上海)有限公司 Cluster resource scheduling method, device, equipment and storage medium
CN111049747A (en) * 2019-12-18 2020-04-21 北京计算机技术及应用研究所 Intelligent virtual network path planning method for large-scale container cluster
CN111049747B (en) * 2019-12-18 2022-01-04 北京计算机技术及应用研究所 Intelligent virtual network path planning method for large-scale container cluster
CN111274576A (en) * 2020-01-17 2020-06-12 济南浪潮高新科技投资发展有限公司 Control method, system, equipment and medium for intelligent contract operating environment
CN111427696B (en) * 2020-04-07 2023-03-14 上海飞旗网络技术股份有限公司 Service resource scheduling method and device
CN111427696A (en) * 2020-04-07 2020-07-17 上海飞旗网络技术股份有限公司 Service resource scheduling method and device
CN111724067A (en) * 2020-06-22 2020-09-29 中国银行股份有限公司 Resource scheduling method and device
CN114116186A (en) * 2020-08-26 2022-03-01 中国电信股份有限公司 Resource dynamic scheduling method and device
CN114116186B (en) * 2020-08-26 2023-11-21 中国电信股份有限公司 Dynamic scheduling method and device for resources
CN112363825A (en) * 2020-10-16 2021-02-12 北京五八信息技术有限公司 Elastic expansion method and device
WO2022105589A1 (en) * 2020-11-20 2022-05-27 上海连尚网络科技有限公司 Resource scheduling method and apparatus, electronic device and computer readable medium
CN112445577B (en) * 2020-11-30 2023-11-24 广州文远知行科技有限公司 Container adding method, device, terminal equipment and storage medium
CN112445577A (en) * 2020-11-30 2021-03-05 广州文远知行科技有限公司 Container adding method and device, terminal equipment and storage medium
CN112631776A (en) * 2020-12-26 2021-04-09 中国农业银行股份有限公司 Kafka partition expansion method and device, storage medium and computer equipment
CN113031976A (en) * 2021-03-26 2021-06-25 山东英信计算机技术有限公司 Ambari-based cluster capacity management method, device and medium
CN113031976B (en) * 2021-03-26 2023-09-29 山东英信计算机技术有限公司 Cluster capacity management method, device and medium based on Ambari
CN114003378B (en) * 2021-10-26 2022-12-13 深圳证券信息有限公司 Container cluster load balancing method, device, equipment and storage medium
CN114003378A (en) * 2021-10-26 2022-02-01 深圳证券信息有限公司 Container cluster load balancing method, device, equipment and storage medium
CN116610270B (en) * 2023-07-21 2023-10-03 湖南马栏山视频先进技术研究院有限公司 Video processing calculation and separation method and video calculation and separation system
CN116610270A (en) * 2023-07-21 2023-08-18 湖南马栏山视频先进技术研究院有限公司 Video processing calculation and separation method and video calculation and separation system

Similar Documents

Publication Publication Date Title
CN109753356A (en) A kind of container resource regulating method, device and computer readable storage medium
CN101013427B (en) Method and system for managing data
Dogan et al. Matching and scheduling algorithms for minimizing execution time and failure probability of applications in heterogeneous computing
Murtaza et al. QoS-aware service provisioning in fog computing
US20090077235A1 (en) Mechanism for profiling and estimating the runtime needed to execute a job
US11579933B2 (en) Method for establishing system resource prediction and resource management model through multi-layer correlations
CN110389820B (en) Private cloud task scheduling method for resource prediction based on v-TGRU model
CN111860853A (en) Online prediction system, online prediction equipment, online prediction method and electronic equipment
CN113791882B (en) Multi-task deployment method and device, electronic equipment and storage medium
CN113886454A (en) Cloud resource prediction method based on LSTM-RBF
CN110389817A (en) Dispatching method, device and the computer program product of cloudy system
CN116302448B (en) Task scheduling method and system
Tong et al. A customer-oriented method to support multi-tasks scheduling under uncertain time in cloud manufacturing
Zhao et al. Integrating deep reinforcement learning with pointer networks for service request scheduling in edge computing
CN114997414A (en) Data processing method and device, electronic equipment and storage medium
CN114020469A (en) Edge node-based multi-task learning method, device, medium and equipment
CN113946440A (en) Resource scheduling method in green cloud environment
CN114035919A (en) Task scheduling system and method based on power distribution network layered distribution characteristics
CN114090201A (en) Resource scheduling method, device, equipment and storage medium
He et al. Dynamic scalable stochastic petri net: A novel model for designing and analysis of resource scheduling in cloud computing
CN114615144B (en) Network optimization method and system
CN112801144B (en) Resource allocation method, device, computer equipment and storage medium
CN117311999B (en) Resource scheduling method, storage medium and electronic equipment of service cluster
CN113391923B (en) System resource data allocation method and device
CN115883392B (en) Data perception method and device of computing power network, electronic equipment and storage medium

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190514