In recent years, with the rapid popularization of the fifth-generation mobile communication network and the continuous development of mobile Internet applications, the number of intelligent terminal devices has shown rapid growth. More and more services are sinking to the edge, which brings about the explosive growth of data volume on edge devices and the sharp rise in computing power demand. Compared with traditional cloud data centers, characterized by centralized data, centralized computing power, and a stable network environment, edge scenarios are distributed, dynamic, and resource-constrained. At the same time, there are strict requirements on the response time of applications in particular scenarios such as autonomous driving, telemedicine, and augmented reality. Completing data processing and application response locally on edge devices has become an increasingly urgent requirement in edge computing scenarios, reducing bandwidth resource usage, protects user data privacy, and effectively improves application response speed and user experience. With the development of lightweight virtualization technology and the maturity of microservice architecture, deploying containerized applications on edge devices has become a mainstream application mode in edge scenarios. Compared with the traditional monolithic application, the microservice architecture has the characteristics of loose coupling, which enables the application to be created, updated, and terminated independently and conveniently. However, the challenge of deploying microservice applications in edge scenarios comes from the contradiction between the latency sensitivity of applications and the limited node resources. Existing container orchestration tools do not fully consider the coupling relationship between applications in microservice scheduling and resource allocation. The resource application is not accurately evaluated during the cluster scaling process, resulting in unnecessary cross-node communication and waste of resources.
Therefore, this paper proposes a microservice orchestration model for edge scenarios, which can realize microservice scheduling based on spectral clustering and resource allocation based on a sliding window mechanism under the constraints of multi-dimensional indicators. Graphs depict the dependencies between microservices, and then spectral clustering is used to map microservices to edge nodes, significantly reducing the cross-node communication traffic between microservices. At the same time, in the process of cluster scaling under the constraints of multiple indicators, the resource request volume of the application is accurately analyzed, and the sliding window mechanism is used for more fine-grained resource allocation, which improves the resource utilization rate while ensuring the quality of service. The main work and innovations of this paper include the following points:
- Design and implement a microservice scheduling algorithm based on spectral clustering (MSSC). In the edge scenario, the application based on microservice architecture is equivalent to a group of different sample objects dispersed to each cluster node. There is a complex business logic relationship between microservices, which can be a form of similarity between microservices. Microservices exchange information with each other through cross-node communication or intra-node communication. At this time, unreasonable microservice scheduling may increase the cluster’s overall cross-node communication overhead and the application response time. This paper proposes a microservice scheduling algorithm based on spectral clustering in response to this situation. The main idea is to use the degree of interaction between microservices to measure the closeness of the relationship between microservices and then map microservices to nodes. Map the connections between microservices as edges, and the weights of the edges represent the size of the data flow interacting between microservices, map the entire application into a weighted phase-free graph, and convert the scheduling problem into a graph segmentation problem. The nodes in the graph are divided by the spectral clustering algorithm, and different clusters correspond to other nodes. Finally, the microservices are scheduled to corresponding nodes based on the clustering results to minimize the overall cross-node communication overhead of the cluster and effectively reduce the response delay of the application. The experimental results show that compared with the traditional method, the proposed MSSC algorithm increases the intra-node traffic ratio by 2.7 times, decreases the inter-node communication traffic by 17.7%, and reduces the minimum, average and maximum of the application response time by 37.8%, 10.7%, and 26.6%, respectively.
- A dynamic allocation algorithm for microservice resources under the constraints of multi-dimensional indicators is designed and implemented. Improving resource utilization is essential for technological progress, especially when resources are limited in edge scenes. Currently, mainstream container orchestration platforms have implemented general resource allocation algorithms but have not been effectively optimized for edge application scenarios. This paper first introduces the principle of the existing microservice resource allocation algorithm, quantitatively analyzes the resource utilization efficiency, and finds that resources can be further compressed under the premise of ensuring service quality. The dynamic resource allocation algorithm based on the sliding window mechanism under the constraint of the dimension index can effectively compress the resource application amount through the dynamic allocation of resources under the premise of ensuring the specified service quality so that the physical nodes can carry more services under the same access pressure, effectively improved resource utilization. At the same time, the sliding window mechanism implemented by the time series database can effectively reduce the system turbulence caused by changes in cluster resource allocation. Experiments show that, while ensuring that the total number of processed requests and the response time is unchanged during the cluster scaling process, the average memory requirements for processing a single request on two high-load microservice applications are generally equivalent to 19.4% and 45.8% of the HPA mechanism.
- A simulated heterogeneous edge cluster is built. Through the analysis and processing of the Alibaba open source microservice dataset, the flow characteristics in the production environment are simulated to implement pressure measurement on the cluster. To verify the algorithm’s performance in the edge scenario, we adopt the combination of the virtual machine and Raspberry PI to build the simulated edge heterogeneous cluster. The Google open source microservice application Online Boutique is used as the test object, and the distributed test platform Locust simulates the traffic characteristics in the natural environment.
Authors
Ning Li, Yusong Tan, Xiaochuan Wang, Bao Li and Jun Luo.