It is a kind of to strengthen the cloud computing user resources quota allotment approach of fairness
Technical field
The present invention relates to a kind of cloud computing user resources quota allotment approach, in particular, more particularly to it is a kind of with
Family influences the reallocation of its resource quota to strengthen the cloud computing user resources quota of fairness on the utilization rate of resource quota in the past
Distribution method.
Background technology
Under cloud computing environment, resource-sharing, the method for service used on demand so that certain user may exceedingly take money
Source.In the case where cloud computing resources are limited, under particularly publicly-owned cloud environment, excessive resource occupation may result in other use
Family can not use resource, service impacting fairness and quality.The setting of resource quota limits single use to a certain extent
The resource occupation quantity at family, user can only apply for resource, using resource in quota limit, but cloud computing platform is usual at present
Mode is limited using unified fixed resource quota, there is problems with:
One is that different users has different resource requirements, also has different in different service stages even if same user
Resource requirement, the mode of fixed resource quota can not ensure the resource requirement of user, relatively influence the public affairs of resource quota distribution
Levelling.
Two be some malicious acts destruction resource quota distributional equity.As certain user is taken compared with large resource for a long time
Quota, but quota utilization rate is than relatively low, in cloud platform resource-constrained and in the case of needing to ensure service quality, it is impossible to for more
Many user's distribution or adjustresources, influence the use of other users and the efficient utilization of platform resource;Certain user in order to
More resources are obtained, the means such as may cheat by demand and lie about higher resource quota, make other users resource requirement
It can not meet.
Three be isomerization and the virtualization feature of cloud platform resource, makes user be difficult to calculate required resource quantity, application
Resource quota and actual demand may have larger deviation, it is difficult to effectively estimate cloud platform resources requirement, influence is flat
The service quality of platform.
On the premise of cloud platform resource-constrained and needs ensure service quality, needed to effectively estimate cloud platform resource
The amount of asking, liberally limits certain user's resource using amount to meet the resource requirement of more users, it is necessary to which one kind is in cloud computing
Strengthen the resource quota distribution mechanism of fairness under environment.
(a kind of limitation cloud computing user resources use the method for amount, application number 201310743282.X, the applying date to patent
2013.12.29, application publication number CN103729236A) disclose a kind of method for limiting cloud computing user resources using amount.
This method obtains available resources total amount in physical machine and, as the user resources quota factor, formulates physical resource and virtual resource first
It is one-to-one to use strategy, when setting user resources to use amount, compare user and used stock number and amount is set, if specified
Value is more than uses stock number, then sets effective, otherwise invalid.It this method propose a kind of limitation cloud computing user resources and use volume
The method of degree, but this method is simpler, and volume is used only by setting user resources are compared to stock number with user
Degree, the fairness problem of user resources allocation of quota is not considered.
The content of the invention
There is provided a kind of cloud computing user resources of enhancing fairness in order to overcome the shortcoming of above-mentioned technical problem by the present invention
Quota allotment approach.
The present invention enhancing fairness cloud computing user resources quota allotment approach, it is particular in that, by with
Lower step is realized:Step 1:The judgement of resource quota applying type, according to the application information of user resources quota, judges resource
The type of quota application, if applying first, then performs step 2;If resource quota modification application, then step 4 is performed;
Step 2:Top limit is obtained, for the application first of user resources quota, user's application system is obtained by application information
Type, business demand and scale, inquire about the corresponding resource quota top limit of such application system, are used as user resources quota
Distribution factor, performs step 3 first;Step 3:Resource quota is distributed first, compares the resource quota and maximum limit of user's application
The size of volume;If the resource quota of user's application is more than top limit, top limit is distributed as the resource quota of user;If
The resource quota of user's application is less than top limit, then distributes to the resource quota of user's application;Step 4:Judge modification application
Type, judges that resource quota modification application is increase resource quota or reduces resource quota, if resource quota is reduced, then
The corresponding resource quota of user is discharged, the resource quota required to user is reduced;If increase resource quota, then step is performed
5;Step 5:The credit factor is calculated, user credit factor C is calculated according to user's history resource quota service conditioni, credit factor Ci
It is directly proportional to resource quota utilization rate, performs step 6;Step 6:Increase resource quota, judge credit factor CiWhether base is more than
Quasi- value C0, if greater than a reference value, then distribute to user and apply for increased resource quota;, then will application if less than a reference value
Increased resource quota is multiplied by coefficient Ci/C0Corresponding resource size distributes to user;Step 7:The cycle of user resources quota
Property adjustment, used by the cycle of time T and identical method calculating user credit factor C in step 5i, and according to user credit
The resource quota of the factor periodically dynamic adjustment user.
The cloud computing user resources quota allotment approach of the enhancing fairness of the present invention, the calculating credit described in step 5
The factor is realized by following steps:Step 5-1:History resource quota utilization rate is obtained, if having i resource quota in history
Use, participate in the shared n classes resource calculated;I resource quota utilization rate is expressed as U in user's history1(t1,d1) ...,
Um(tm,dm) ..., Ui(ti,di), wherein:
Um(tm,dm)=(um,1(tm,dm),...,um,k(tm,dm),...,um,n(tm,dm))
Um(tm,dm) represent m sub-distribution resource quota utilization rate, um,k(tm,dm) represent that the kth class of m sub-distribution is provided
The resource quota utilization rate in source, k=1,2 ..., n;tmRepresent the allocated initial time of the m times resource quota, dmRepresent m
The service time of secondary resource quota;Step 5-2:Weight is calculated, each resource quota utilization rate is calculated by formula (1) first
um,k(tm,dm) shared by weight wm,k:
wm,kFor resource quota utilization rate um,k(tm,dm) shared by weight;α is to dmFactor of influence, 0 < α < 1, D's
Size is equal to the cycle time T, m=1,2 ..., i of periodically dynamic adjustresources quota;
Then weight shared by the m times resource quota utilization rate is expressed as:Wm=(wm,1,...,wm,k,...wm,n);
Step 5-3:The user credit factor is calculated, with a n element group representation user resources quota:
Qi(ti,di)=(qi,1(ti,di),...,qi,k(ti,di),...,qi,n(ti,di))
Qi(ti,di) represent that ith distributes to the resource quota of user, qi,k(ti,di) represent that the kth class of ith distribution is provided
The quota in source;
For kth class resource, distribute and use after i resource quota, pass through the credit factor that formula (2) calculates user
For all resource types, after i resource quota, when i+1 time distributes new resource quota for user, use
The credit factor at family n tuples CiTo represent:Ci=(ci,1,...,ci,k,...,ci,n)。
The cloud computing user resources quota allotment approach of the enhancing fairness of the present invention, the increase resource described in step 6 is matched somebody with somebody
Volume is realized by following steps:
If the increased resource quota of user's i+1 time application is expressed as:
The increase volume for being actually allocated to user is expressed as:
ΔQi+1(ti+1,di+1)=(Δ qi+1,1(ti+1,di+1),...,Δqi+1,k(ti+1,di+1),...,Δqi+1,n(ti+1,
di+1))
If a reference value C of the user credit factor0For:C0=(c0,1,...,c0,k,...,c0,n)
Compare credit factor C successivelyiWith a reference value C0The size of middle corresponding element, if the credit factor c of certain class resourcei,j
More than its a reference value c0,j, illustrate that such resource has higher utilization rate, then distribute to user and apply for increased resource quota,
I.e.:
If the credit factor c of certain class resourcei,kLess than its a reference value c0,k, illustrate that the utilization rate of such resource is relatively low, should
Reduction distributes to user and applies for increased resource quota, i.e.,:
The cloud computing user resources quota allotment approach of the enhancing fairness of the present invention, if user applies for that reduced resource is matched somebody with somebody
Volume is Release
After the corresponding resource quota of user, the actual resource quota of user is:
The cloud computing user resources quota allotment approach of the enhancing fairness of the present invention, the user resources described in step 7
The periodicity adjustment of quota is realized by following steps:
Step 7-1:Periodically judge and calculate the credit factor, judge whether to reach the calculating of periodicity adjustresources quota
Cycle T, if be not reaching to, is continued waiting for;If reached, the credit factor C of user is calculatedi, perform step 7-2;
Step 7-2:The comparison of the credit factor, compares credit factor C successivelyiWith a reference value C0The size of middle corresponding element, such as
The really credit factor c of certain class resourcei,jMore than its a reference value c0,j, illustrate that such resource has higher utilization rate, this cycle
Property adjustment keep user resources quota it is constant;If the credit factor c of certain class resourcei,kLess than its a reference value c0,k, illustrate such
The utilization rate of resource is relatively low, should reduce the resource quota of user, performs step 7-3;
Step 7-3:The resource quota after reduction is calculated, if the current resource quota of user is expressed as:
Qi(ti,di)=(qi,1(ti,di),...,qi,k(ti,di),...,qi,n(ti,di)), qi,k(ti,di) work as user
The quota of certain preceding class resource;Performing the user resources quota calculated after reduction is:
Perform step 7-4;
Step 7-4:It is less than the kth class resource of a reference value for the credit factor, calculates it and using resource quantity rkIf, meter
The new resources quota calculatedMore than rk, illustrate that new resources quota meets user's request, then by the resource calculated
Quota is actually allocated to user, i.e.,:
If the new resources quota calculatedLess than rk, illustrate that new resources quota can not meet user and need
Ask, then user is being actually allocated to user with resource quantity as new resources quota, i.e.,:
qi+1,k(ti+1,di+1)=rk。
The cloud computing user resources quota allotment approach of the enhancing fairness of the present invention, the application system described in step 2
Type include ecommerce, E-Government, medium-sized and small enterprises website, trade information management system, the business demand includes every
The trading volume that handles in real time of second, certain service response time are not less than certain value, some period heap file submission processing, the scale
Information refers to the quantity of application system part, supports maximum number of user, the resource quota of user's application.
The cloud computing user resources quota allotment approach of the enhancing fairness of the present invention, the n classes resource includes but not limited
In CPU, internal memory, cloud hard disk, IP and virtual router, the corresponding CPU core number of described resource quota, memory size, cloud hard disk
Capacity, IP quantity and virtual router quantity.
The cloud computing user resources quota allotment approach of the enhancing fairness of the present invention, the CPU of m sub-distribution resource is matched somebody with somebody
Volume utilization rate=∑ (CPU core number × this time that certain period user uses in the quota service time)/(CPU quotas sum
× quota service the time), (the cloud hard disk that certain period user uses in the quota service time holds cloud hard disk quota utilization rate=∑
Amount × this time)/(cloud hard disk quota total amount × quota service time), internal memory quota utilization rate=∑ (quota service time
Memory size × this time that interior certain period user uses)/(internal memory quota total amount × quota service time).
In the calculating process of resource quota utilization rate, by taking CPU as an example, if user CPU quotas are 100 cores, quota clothes
The business time be 100 days, user continuous 5 days, 10 days, 15 days, 20 days, 5 days, 5 days, 5 days, 5 days, 20 days, 10 days this 10
The CPU core number used in period is respectively 24,20,32,36,28,45,56,30,40,18, then CPU resource quota is used
Rate=(24 × 5+20 × 10+32 × 15+36 × 20+28 × 5+45 × 5+56 × 5+30 × 5+40 × 20+18 × 10)/(100 ×
100)=32.75%.
The beneficial effects of the invention are as follows:The cloud computing user resources quota allotment approach of the present invention, use different from the past
The method that unified fixed resource quota restrictions unique user resource is used, the present invention obtains resource quota application information and sentenced first
Disconnected resource quota applying type;Then the application first of different user resource quota is directed to, according to application system type, business need
Summation scale is used using the different resource quota upper limits to limit the resource of user;For the change Shen of user resources quota
Please, the credit factor model of user is set up based on user's history resource quota service condition, resource is implemented to bad credit customer
The punitive distribution of quota, resource is used limitation user next time;Malicious act for destroying resource quota fairness in distribution,
Resource quota periodically dynamic adjustment distribution method is set up, prevents resource from abusing;Cloud computing platform resource, which can effectively be estimated, to be needed
The amount of asking, meets the demand of more users, improves service quality.The present invention proposes effective resource quota distribution side from multi-angle
Method, enhances resource quota distributional equity, reduce further the risk that influence other users are used.The present invention is applied to
All resource types that cloud computing is used, are not limited by single resource type.
Brief description of the drawings
Fig. 1 is the flow chart of the resource quota distribution method of the present invention;
Fig. 2 is the allocation process diagram first of resource quota;
Fig. 3 is resource quota allocation process diagram again;
Fig. 4 is resource quota periodically dynamic adjustment flow chart;
Fig. 5 is the user credit factor and resource quota utilization rate variation diagram;
Fig. 6 is the resource quota figure of the actual distribution of user;
Fig. 7 is user resources quota rewards and punishments distribution diagram;
The comparison diagram of Fig. 8 the inventive method and the usual distribution method service ability of resource quota.
Embodiment
The invention will be further described with embodiment below in conjunction with the accompanying drawings.
As shown in Figures 1 to 4, resource quota distribution method of the invention, first distribution, again sub-distribution and week are given
The flow chart that phase property is dynamically adjusted, Summary has detailed description, and no longer Ao Shu, only provides specific example herein
Son.
In the present embodiment, by taking the e-commerce system in medical field as an example, implement the resource quota of enhancing fairness
The step of distribution method, is as follows:
Step a:Resource quota application information is obtained by cloud computing system, the type of user resources quota application is judged,
This example starts to apply first.
Step b:User applies for resource quota first, implements the distribution first of resource quota, comprises the following steps:
Step b-1:Type, business demand and the scale of user's application system are obtained by cloud computing system, user is inquired about
Using corresponding resource quota top limit.In this example, user's application system is comprising the maximum concurrent user of 5 subsystems
Number reaches the e-commerce system of 50000 people, by taking CPU, internal memory, three kinds of resource types of cloud hard disk as an example, the maximum of resource quota
Limit is 200CPU, 400G internal memory, 5000G cloud hard disks.
Step b-2:The resource quota that user applies first is obtained by cloud computing system, the resource for comparing user's application is matched somebody with somebody
Whether volume is more than the top limit of user resources quota;If the resource quota of user's application is more than top limit, distribution is maximum
Limit, if the resource quota of user's application is less than top limit, distributes to the money of user's application as the resource quota of user
Source quota.
In this example, user applies for resource quota first, and initial time is 0, and service time is 480 hours, the money of application
Source quota is expressed as:
That is in 40 CPU, 112G of application
Deposit, 2600G cloud hard disks.
The resource quota of user's application is less than the application system resource quota top limit, then is actually allocated to user's application
Resource quota, i.e.,:
Q1(0,480)=(40,112G, 2600G).
Step c:When user's application change resource quota, i.e., when application increases or decreases resource quota, implementation divides again
Match somebody with somebody, comprise the following steps:
Step c-1:The 2nd application resource quota of user, application increase resource quota
It is allocated as follows:
Step c-1-1:The utilization rate U of the resource quota distributed first is obtained by cloud computing system1(0,480)=
(0.51,0.55,0.73);
Step c-1-2:If cycle time D=2160 hour, the weight shared by user's history resource quota utilization rate is calculated
W1=(0.69,0.69,0.69);
Step c-1-3:According to resource utilization U1And W1Calculate the credit factor C of user1=(0.51,0.55,0.73);
Step c-1-4:Set C0=(0.75,0.75,0.75), compares user credit factor C1In element whether be more than
A reference value C0In respective element, C1In element be respectively less than C0In element, calculate be actually allocated to user resource quota increase
Plus volume is
The 3rd application resource quota of user, application increases resource quota again
Continue to jump to following steps and be allocated:
Step c-2-1:User's history resource quota utilization rate U is obtained by cloud computing system1(0,480)=(0.51,
0.55,0.73), U2(480,360)=(0.45,0.42,0.51);
Step c-2-2:Calculate the weight W shared by these resource quota utilization rates1=(0.27,0.27,0.27), W2=
(0.8,0.8,0.8);
Step c-2-3:User credit factor C is calculated according to weight and resource quota utilization rate2=(0.46,0.45,
0.57);
Step c-2-4:Compare user credit factor C2In element whether be more than a reference value C0In respective element, C2In
Element be respectively less than C0In element, calculating the actual resource quota increase volume that obtains of the application of user the 3rd time isActive user's resource quota is Q3(840,960)=(72,
133G,2849G)。
Step c-3:User's the 4th application resource quota, application reduces resource quota
Cloud platform system discharges the corresponding resource quota of user, and user's real resource quota is changed into Q4(1800,2400)=(62,
113G,2749G)。
Step d:The resource quota service time of the 4th distribution, more than D=2160 hours, 2160 is reached when service time
When, periodicity is adjusted user resources quota by cloud computing system, is comprised the following steps:
Step d-1:Jump to step c-1-1 and obtain user's history resource quota utilization rate, U1(0,480)=(0.51,
0.55,0.73), U2(480,360)=(0.45,0.42,0.51), U3(840,960)=(0.37,0.53,0.55), U4
(1800,2160)=(0.86,0.84,0.66);Then each resource quota utilization rate proportion W is calculated1=(0.16,
0.16,0.16), W2=(0.38,0.38,0.38), W3=(0.53,0.53,0.53), W4=(1.0,1.0,1.0);And according to
History resource quota utilization rate and weight calculation user credit factor C4=(0.63,0.66,0.61).
Step d-2:Compare the credit factor C of user4With a reference value C0The size of middle respective element, C4In element it is small
In a reference value C0In element, then into step d-3, according to the credit factor calculate adjustment after new resources quota.
Step d-3:Calculate the new resources quota after adjustment
Step d-4:It is being R=(r with resource quantity to obtain user by cloud computing system1,r2,r3)=(35,110G,
2200G), new resources quota (52,99G, 2236G) and the user after contrast adjustment resource quantity (35,110G,
CPU core number in the size of respective element in 2200G), new resources quota, the capacity of cloud hard disk be more than user with CPU core number and
Cloud hard-disk capacity, the capacity of internal memory is less than user with capacity, then distributes CPU core number, cloud hard-disk capacity in new resources quota, use
Family is being used as the resource quota for being actually allocated to user, i.e. Q with the capacity of memory source5=(52,110G, 2236G).
The advantage of the present invention is further illustrated below in conjunction with experiment and accompanying drawing 5-8.
Experiment one:The user credit factor is calculated and resource quota distributes experiment again
In the method for the invention, by taking cpu resource type as an example, C is made0=(0.75), α=0.4, D=2160 hours, Shen
Please the number of times of resource quota be i=20, application increase resource quota number is 100 CPU cores, resource quota utilization rate and clothes every time
The business time is as shown in table 1.
Table 1
According to the method for the invention, we according to user's history resource quota service condition calculate weight and credit because
Son, obtains the actual allocated resource quota increase volume of user.
Fig. 5 provides the credit factor of user and the variation diagram of resource quota utilization rate.As seen from the figure, the credit of user
Factor fluctuation and the variation tendency of resource quota utilization rate are essentially identical.I.e. as resource quota utilization rate rises, user credit
The factor is improved, and resource quota utilization rate declines, then the user credit factor is reduced.Several special points, the such as the 7th, 8,18 resources
The credit factor of user does not have the Long-term change trend of the quota utilization rate with nearest node during allocation of quota, because user
The credit factor it is related to all history resource quota utilization rates, with the resource quota utilization rate relations of neighbouring multiple nodes compared with
Greatly, because the resource quota utilization rate of neighbouring multiple nodes is higher, the small drop of nearest node resource quota utilization rate
The low credit Effects of Factors to user less, so the 7th, 8, the credit factor of 18 times do not match somebody with somebody with the resource of nearest node
The reduction of volume utilization rate and reduce.
Fig. 6 illustrates the actual allocated resource quota increase volume of user.As can be seen that the actual allocated resource of user
Quota increase volume is changed according to the credit factor of user, and the method for the invention is used according to user's history resource quota
Situation sets up the user credit factor, limits the distribution of user's resource quota next time.
Experiment two:The rewards and punishments distribution experiment of resource quota
Assuming that user resources quota utilization rate is always very low during being applied multiple times, it will be assumed that for the extremely low of a fixation
Value 0.3, is then drastically increased to also always very high during being applied multiple times after an extremely high value, it will be assumed that for the pole fixed
High level 0.85.In this case, the inventive method carries out punitive or incentive distribution to user resources quota.
Fig. 7 shows that the method for the invention implements the rewards and punishments of resource quota according to the different resource quota utilization rate of user
Distribution.As seen from the figure, if the resource quota utilization rate of user is if always very low in being applied multiple times, the credit of user because
Son will be gradually reduced, and the increase volume that user is allocated resource quota will be fewer and fewer;If on the contrary, the resource quota utilization rate of user
If always very high in being applied multiple times, its credit factor will be gradually increasing, and the resource quota increase volume that user is allocated will be more
Come more.
Experiment three:Service ability confirmatory experiment
Under the limited resource quota of cloud computing platform, by contrasting the inventive method and common resource quota distribution side
Method meets the service ability of user's request, verifies the advantage of the inventive method.In this experiment, it is assumed that cloud computing platform currently has
1000 idle CPU quotas are a number of user (enterprise) every time while applying for resource quota, application CPU core number,
The being serviced time is random number.We test 17 groups of different numbers of users altogether, every group of user design altogether 10000 groups it is different
CPU core number, being serviced time.
Fig. 8 shows that the inventive method and usual resource quota distribution method meet the probability statistics of user resources quota demand
Figure.As seen from the figure, when number of users is less (<15 people), two methods can guarantee that cloud computing platform can preferably expire
The demand of sufficient user resources quota;With increasing for number of users, the inventive method disclosure satisfy that the resource quota of more users is needed
Ask;When number of users increase to a certain extent (>25 people), two methods can not meet the resource quota demand of user.Generally,
The inventive method is ensureing that cloud computing platform meets more advantageous in user resources quota demand, can not only effectively estimate use
The demand of family resource quota, and resource quota is distributed using the evaluation mechanism of the user credit factor, enhance fairness.