Skip to main content
. 2021 May 31;21(11):3800. doi: 10.3390/s21113800
Algorithm 1 Algorithm for fuzzy-based microservice computing resource scaling (FMCRS)
Initialization:
Edge computing nodes set: Mi={1, 2, 3, , M}, 0<iM;
CPU usage for edge node set: Micpu, iM;
Memory usage for edge node set: Mimem, iM;
Microservices set: Ni={1, 2, 3, , N}, 0<iN;
CPU usage for microservice set: Kicpu, iN;
Memory usage for microservice set: Kimem, iN;
Gaussian membership function of fuzzy interference system with standard deviation σ and mean value μ;
microservice scaled CPU extent set: Srcpu=, rN;
microservice scaled Memory extent set: Srmem=, rN.
1: For Each microservice iNDo
2: For each Kicpu and KimemDo
3:   Calculate Gaussian membership values according to (2) and (3), respectively;
4:   Optimize Gaussian membership function according to (5), (6), and (7), respectively;
5:   Calculate Srcpu and Srmem according to (4);
6:   ifSrcpu<(1Micpu) and Srmem<(1Mimem) then
7:     Run horizontal scaling;
8:   else
9:     Calculate the priority of microservice according to (8);
10:     Run vertical scaling;
11:   end if
12:  end for
13: end for
Output: Microservices with the scaled computing resources.