Automatic Scaling Mechanism of Intermodal EDI System under Green Cloud Computing
Algorithm 1
XEDI’s automatic expansion algorithm.
name: autoScalingUp
input: none
output: none
Define variable I: Expansion index; Define variable scalingStrategy: Capacity expansion policy: Non-predictive capacity expansion if the value is 0, predictive capacity expansion if the value is not 0; Define a collection<POD>: POD collections that need to be expanded; Define a collection<EXPOD>: A collection of pods with poor performance; Define a collection<POP>: POD optimization solution set;
Main-loop {
retrieve XEDI context from CAT as XEDI.C; //Get the XEDI context from CAT
//Calculate the average message processing time and average throughput of XEDI
;
if ( and ) {
//POD nodes with normal throughput but abnormal message processing time
for (step i from 1 to 3) {
for (each XEDI pod in step i from K8S) {
retrieve pod. C;
// Calculate the average data processing time and average throughput of POD
;
if ( and ) {
add this unhealthy pod to collection<EXPOD>;
}}}
report collection<EXPOD> to CAT as performance exception; //Report exception triggers to CAT
enter next loop;
}
If (scalingStrategy = = 0) {
//According to formulas (2) and (3), qi = 1, the responsive capacity expansion index based
//on mixed load rate is calculated
;
} else {
//According to formulas (5)–(7), the predictive expansion index was calculated
;
}
if (I > Imax) {
//Enter the expansion process and get the POD set of XEDI
for (each XEDI pod in K8S) {
retrieve pod. C;
//Avoid frequent POD scaling by cooling-off time
if (currentTime-pod. lastScalingTime < pod. C. ) {
enter next loop;
}
//Calculate POD expansion index
If (scalingStrategy = = 0) {
//According to formulas (2) and (3), qi = 1, the response expansion index based on
//mixed load rate was calculated
;
} else {
//According to formulas (5)–(7), the predictive telescopic index is calculated
;
}
//Make scaling decisions
if () {//Calculate and update POD expansion metrics
If (scalingStrategy = = 0) {
//In response mode, qi = 1 is calculated according to formulas (2) and (3) to calculate //data grouping processing time and throughput,
//Queue wait time and response metrics for CPU and memory utilization
update pod context (
);
} else {
//Predictive mode, according to formulas (4)–(6), calculate data grouping //processing time, throughput, Queue wait times and predictors of CPU and //memory utilization
update pod context (
);
}
add this pod to collection<POD>;
}}
//Calculate configuration optimizations for POD collections that need to be scaled up
for (each pod in collection<POD>) {
//POD optimization scheme is calculated by queuing theory system
compute PodOptimizationPlan(pop) for pod by queue system;
add this pop to collection<POP>;
}
//Confirm whether K8S resources meet the expansion conditions
if (R not adequate for collection<POP> scaling-up) {
//When the available resources are used up, try to apply for resources from the container
//cloud and preempt dynamically when the resources are insufficient try to apply resource
//increment as ;
if ( == 0) {
//Performance is abnormal and additional computing resources cannot be
//requested from the container cloud report resource exhausted exception to
//CAdvisor;
enter next loop;
}
;; //Update total resources
}
//Allocate resources for POD according to Algorithm2
call XDRF algorithm for collection<POP> with Rc By XTuning. Scheduler;
}
If () {
//Normal performance without expansion, according to the Algorithm 3 asynchronous