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<i≤M;
CPU usage for edge node set: Micpu, i∈M;
Memory usage for edge node set: Mimem, i∈M;
Microservices set: Ni={1, 2, 3, …, N}, 0<i≤N;
CPU usage for microservice set: Kicpu, i∈N;
Memory usage for microservice set: Kimem, i∈N;
Gaussian membership function of fuzzy interference system with standard deviation σ and mean value μ;
microservice scaled CPU extent set: Srcpu=∅, r∈N;
microservice scaled Memory extent set: Srmem=∅, r∈N.
1: For Each microservice i∈NDo
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<(1−Micpu) and Srmem<(1−Mimem) 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.