Reliability modelling and optimization for microservice‐based cloud application using multi‐agent system

IET CommunicationsVolume 16, Issue 10 p. 1182-1199 ORIGINAL RESEARCHOpen Access Reliability modelling and optimization for microservice-based cloud application using multi-agent system Zheng Liu, Zheng Liu orcid.org/0000-0002-3390-7894 Department of Computer Science and Engineering, East China University of Science and Technology, No. 130 Meilong Road, Xuhui District, Shanghai, ChinaSearch for more papers by this authorHuiqun Yu, Corresponding Author Huiqun Yu [email protected] Department of Computer Science and Engineering, East China University of Science and Technology, No. 130 Meilong Road, Xuhui District, Shanghai, China Correspondence Huiqun Yu, Department of Computer Science and Engineering, East China University of Science and Technology, No. 130 Meilong Road, Xuhui District, Shanghai, China. Email: [email protected] Guisheng Fan, Department of Computer Science and Engineering, East China University of Science and Technology, No. 130 Meilong Road, Xuhui District, Shanghai, China. Email: [email protected]Search for more papers by this authorGuisheng Fan, Corresponding Author Guisheng Fan [email protected] Department of Computer Science and Engineering, East China University of Science and Technology, No. 130 Meilong Road, Xuhui District, Shanghai, China Correspondence Huiqun Yu, Department of Computer Science and Engineering, East China University of Science and Technology, No. 130 Meilong Road, Xuhui District, Shanghai, China. Email: [email protected] Guisheng Fan, Department of Computer Science and Engineering, East China University of Science and Technology, No. 130 Meilong Road, Xuhui District, Shanghai, China. Email: [email protected]Search for more papers by this authorLiqiong Chen, Liqiong Chen School of Computer Science and Information Engineering, Shanghai Institute of Technology, No. 100 Haiquan Road, Fengxian District, Shanghai, ChinaSearch for more papers by this author Zheng Liu, Zheng Liu orcid.org/0000-0002-3390-7894 Department of Computer Science and Engineering, East China University of Science and Technology, No. 130 Meilong Road, Xuhui District, Shanghai, ChinaSearch for more papers by this authorHuiqun Yu, Corresponding Author Huiqun Yu [email protected] Department of Computer Science and Engineering, East China University of Science and Technology, No. 130 Meilong Road, Xuhui District, Shanghai, China Correspondence Huiqun Yu, Department of Computer Science and Engineering, East China University of Science and Technology, No. 130 Meilong Road, Xuhui District, Shanghai, China. Email: [email protected] Guisheng Fan, Department of Computer Science and Engineering, East China University of Science and Technology, No. 130 Meilong Road, Xuhui District, Shanghai, China. Email: [email protected]Search for more papers by this authorGuisheng Fan, Corresponding Author Guisheng Fan [email protected] Department of Computer Science and Engineering, East China University of Science and Technology, No. 130 Meilong Road, Xuhui District, Shanghai, China Correspondence Huiqun Yu, Department of Computer Science and Engineering, East China University of Science and Technology, No. 130 Meilong Road, Xuhui District, Shanghai, China. Email: [email protected] Guisheng Fan, Department of Computer Science and Engineering, East China University of Science and Technology, No. 130 Meilong Road, Xuhui District, Shanghai, China. Email: [email protected]Search for more papers by this authorLiqiong Chen, Liqiong Chen School of Computer Science and Information Engineering, Shanghai Institute of Technology, No. 100 Haiquan Road, Fengxian District, Shanghai, ChinaSearch for more papers by this author First published: 13 March 2022 https://doi.org/10.1049/cmu2.12371Citations: 2AboutSectionsPDF ToolsRequest permissionExport citationAdd to favoritesTrack citation ShareShare Give accessShare full text accessShare full-text accessPlease review our Terms and Conditions of Use and check box below to share full-text version of article.I have read and accept the Wiley Online Library Terms and Conditions of UseShareable LinkUse the link below to share a full-text version of this article with your friends and colleagues. Learn more.Copy URL Share a linkShare onFacebookTwitterLinkedInRedditWechat Abstract In the process of the continuous development of the Internet of Things, cloud computing has been applied in many fields, how to guarantee the quality of service, such as low latency, high bandwidth, high reliability etc., has become a challenging problem. This paper proposes a method to model and optimize reliability for microservice-based cloud applications using multi-agent system (MAS), thus maximizing the reliability of cloud computing and dynamically scheduling microservices to minimize the delay within the budget. Firstly, a dynamic microservice scheduling scheme is proposed to provide efficient computing services by using MAS. A hierarchical cloud computing model is formed by predicated Petri net (PrT net) and the properties of constructed model are analysed. Secondly, agents have been utilized to describe the essential characteristics of microservice scheduling process in the cloud applications. The partial critical path (PCP) aims to maximize the reliability of cloud applications under the limitation of budget and meet the user-defined deadline. Finally, the proposed PCPRO algorithm has been applied to cloud environment, which is suitable for different scientific workflows in the cloud computing environment. The effectiveness of this method is verified by simulation, the experiment results show the effectiveness of the proposed method. 1 INTRODUCTION As a new computing mode, cloud computing has attracted extensive attention and application. It allows users to access the shared configurable computing resource pool through the network. These resources can be quickly provisioned and published by service providers with minimal management workload. Flexible resources can be used to execute computationally intensive applications, achieving flexible allocation of resources, centralized scheduling and dynamic extension of [1]. Cloud users expand or reduce their cloud service usage by paying no more than their total usage and duration, to fully meet their own business and customer needs. For cloud providers, the flexibility of on-demand ordering and service use reduces the burden of establishing their own computing hardware infrastructure. In addition, by transferring the computing intensive tasks of cloud applications to different cloud servers, the response time of services can be reduced [2]. However, although service providers have made great efforts to ensure that cloud technology maintains a high level of quality of service (QoS) while fulfilling its commitments, it still faces imminent challenges. For example, as the amount of data entering the ECS (Elastic Compute Service) increases, the requested application needs to be processed in a limited time. The more service requests, the lower the bandwidth and the longer the transmission time, which leads to the congestion of ECS [3]. Therefore, emerging cloud applications require more computing and storage resources, and their resource allocation should be properly managed and optimized. Cloud providers need to make a trade-off between performance and efficiency, and provide services to customers in an effective time to meet the needs of resource scarcity with better quality of service (QoS). For the sake of sustainability, this is an issue of great concern to cloud providers and researchers. Microservice architecture style is usually organized around business capabilities and priorities. Different from the traditional single application development method, deploying microservices is a mode of using multiple service instances on each host. When using this mode, you can configure one or more physical or virtual hosts and run multiple service instances on each host [4]. In the microservice architecture, the solution is decoupled by decomposing the functions into discrete services. Cloud applications that use microservices as the main architecture type are distributed systems with many microservices. However, this distributed system has its disadvantages, that is, the interaction mode between individuals of the low-level subsystem is preset by the high-level system according to the task, and the "top-down" analysis method is adopted. Therefore, it lacks flexibility and is difficult to model complex large-scale systems in practice. Multi agent system (MAS) is a collection of multiple agents. In multi-agent system, how to cooperate with tasks in complex environment has become an important prerequisite for these applications. Multi-agent system has a wide range of task areas and higher efficiency. For complex problems, agents can cooperate to complete a single task that cannot be completed. Multi-agent system is a typical resource scheduling mode in distributed environment, which helps to improve system performance, fault tolerance and robustness [5]. Multi-agent system is suitable for solving the resource allocation and mutual cooperation process of microservices. With the characteristics of on-demand use, high scalability and low maintenance cost of cloud computing platform, more and more services are deployed to the cloud platform. However, the huge scale, complex structure and highly dynamic characteristics of cloud computing have brought many challenges to reliability design. Failure is no longer an accident. In the cloud environment, the failure may be caused by many reasons, such as hardware failure, software error and external interference [6]. In addition, the increase in the number of cloud users leads to more requests being forwarded to the server, which may increase the possibility of device failure. The reliability optimization of cloud applications has become a challenging research problem. With the rapid development of cloud service, the emerging microservice breaks through the constraints of single application architecture and is more suitable for cloud environment. At present, many cloud applications are constructed with microservices in the overall architecture, but there is no clear standard in the design idea and the structure is relatively complex. Cloud application based on microservice architecture has the characteristics of fine granularity and loose coupling. However, its small, autonomous and service dependent characteristics pose a challenge to the reliability design of cloud applications [7]. To solve the above problems, a scheduling scheme of multi-agent system is proposed to optimize the reliability of cloud applications through flexible resource combination. In this paper, our contributions are as follows: Firstly, a workflow driven microservice architecture in cloud environment is introduced. The basic elements in the architecture are defined with syntax and semantics, such as microservices, cloud applications and agents. The autonomy and collaboration of hierarchical microservice architecture (MAS-HMSAN) model based on multi-agent system are used to model different components of cloud application. The properties of constructed model are analysed by using the related theories of Petri nets. Secondly, a reliability optimization (PCPRO) algorithm based on partial critical path is proposed. The algorithm identifies some critical paths (PCP) in workflow according to the dependencies between tasks. Tasks with high dependency are placed together under budget and deadline constraints. Through the cooperation between agents, the optimal allocation of resources for the purpose of improving reliability is completed. Finally, experiments on scientific workflow verify the effectiveness of the proposed algorithm. The experimental results show that under the premise of given deadline and budget, the PCPRO algorithm based on partial critical path can maximize the reliability of cloud applications, and is suitable for different scientific workflows in cloud environment. The rest is organized as follows. Firstly, Section 2 summarizes the existing works. Next, Sections 3 and 4 introduce the research methodology and model the MAS-based cloud applications. Then, this paper proposes an algorithm for the deadline-aware reliability optimization strategy in Section 5. Section 6 shows experiments while Section 7 concludes the paper. 2 RELATED WORK Several microservice deployment strategies on cloud computing platforms are studied. Filip et al. [8] propose a new model for the planning of microservices in a heterogeneous cloud environment. The model uses specific mathematical formulas to describe an architecture that includes heterogeneous machines that can handle different microservices. Considering the uncertainty of microservice requests, Song et al. [9] propose a new programming model, which uses domain specific language (DSL), through which developers declaratively specify the collection of microservices and how they call each other. Samanta et al. [10] propose a dynamic microservice scheduling scheme for MEC. The author designs the microservice scheduling framework mathematically and also discussed the computational complexity of the scheduling algorithm. Sattari et al. [11] present a hybrid resource discovery solution for fog, with IETF CoRE Resource Directories, which are used on the peripherals as containerized microservices and facilitate their on-demand deployment. Using various methods, Ray et al. [12] propose an active mechanism for microservice placement and migration based on enhanced learning. The placement of containerized microservices on clouds plays an essential role. Considering the workload and uncertainty, Zhao et al. [13] develop a cost-conscious elastic microservice distribution algorithm. The algorithm equals the compromise between system costs and QoS. Ahvar et al. [14] present a dynamic energy and carbon emission-efficient application placement method for cloud servers. This method solves the problems of first placing applications on cloud servers and optimizes placement by migration. In Ref. [15], a task scheduling algorithm called two-stage task scheduling cost optimization is proposed, which can effectively meet the deadline. In Ref. [16], combined with the global computing in the cloud and the distributed computing at the edge, a two-step multi-objective optimization strategy is proposed. The global optimization model and online local optimization model are adopted to achieve different objectives in two steps. Yao et al. [17] use the greedy algorithm in task scheduling to meet task completion requirements and minimize the cost of the cloud computing system. A maximum allowable delay optimization model considering both average delays and delay jitter is proposed to solve the MTD minimization problem [18]. Ma et al. [19] propose a cloud-assisted mobile cloud computing framework, which enhances the system's computing power by renting cloud resources. Many heuristics have been developed for workflow scheduling with the agent to balance cloud computing. Villari et al. [20] provide an orchestration agent that starts from the ad hoc OpenStack-based heat orchestration template (HOT) service list of cloud computing distributed services and generates several hot microservice lists, including the instructions for the use of each relevant fog calculator. Thean et al. [21] present the implementation of an based MQTT broker cluster using a light container orchestration framework and a cluster of individual computers. An intermediate layer of cluster servers is developed to complement and support the collective processing of distributed MQTT brokers. Sarkar et al. [22] provide that the Cloud Agent needs an intelligent implementation engine that can automatically deploy the selected cataloguing IT services from a range of available agent container hosting systems to the container environment with the best performance. Tusjunt et al. [23] propose a method to extract existing SOA services from BPEL streams and reconstruct them into a number of related micro-services using decomposition patterns. The proposed case study proposes how the services based on the business domain profile, the vocabulary from a particular business scenario must be redesigned. Kotb et al. [24] propose an agent collaboration framework based on workflow network to realize the collaboration between fog computing devices and form a collaborative Internet of things service delivery system. Compared with traditional energy optimization methods, MAS describes different types of agent-based architectures, analyses the role of the environment, and introduces how MAS identifies the characteristics of the environment to adapt to the environment [25]. Jakóbik et al. [26] propose empirically evaluate the effectiveness of MAS-CM using the evolutionary driven implementation of independent batch scheduler and fast flow framework. Haghshenas et al. [27] propose a centralized distributed low overhead fault aware dynamic virtual machine integration strategy to minimize the energy consumption of large-scale data centres. The formal method of cloud application oriented to microservices is a research hotspot. Mazlami et al. [28] propose a formal microservice extraction model, which allows algorithm recommendation of candidate microservices in reconstruction and migration scenarios. The formal model is implemented in a web-based prototype. The paradigm shift requires a new formal approach to system verification and testing of applications in production infrastructure. Camilli et al. [29] introduce a method for continuous design to runtime verification of microservice based applications. This paper describes envisaged approach, the stages of ongoing work and future challenges. Bósa et al. [30] discusses the architecture and formal model of some software solutions. The proposed solution is a novel and unified client-side cloud interaction method. Through this method, the cloud service owner can fully control the use of its services when each user subscribes. Semantics is based on the idea that the possible world can be regarded as having an internal structure to represent the belief independent characteristics of the world and the respective belief states of agents in a modular way [31]. IMWSC (Interaction Module for Web Service Composition) gives formal semantics through CCS (Calculus of Communicating System), which is a process algebra that can be used for concurrent system modelling. The application of the model is further studied in a case study [32]. Bosa [33] according to a new formal method, a high-level formal model of cloud service architecture is given. This method combines the advantages of software engineering method with good mathematical foundation (called abstract state machine) and mobile agent calculus (called environment calculus). Wakrime et al. [34] propose to model and validate web service composition using formal method based on satisfiability (SAT). The autonomy and synergy of multi-agent systems have been studied by scholars from many disciplines. Although the research results of multi-agent system have achieved remarkable results, there are no general theories and methods in the fields of microservice architecture and cloud applications, such as multi-agent system network optimization and complex dynamic network modelling. In order to achieve this goal, this paper proposes a modelling method of cloud application based on multi-agent system in cloud environment. This method performs workflow tasks autonomously, asynchronously and adaptively through agent cooperation, which can effectively meet the scheduling requirements of cloud tasks. 3 RELIABILITY REQUIREMENT OF CLOUD COMPUTING Cloud application based on microservice architecture is a distributed system running on multiple processes or services. The microservice instance is executed in a process. In a process, each task is assigned a dedicated thread. Every request has a dedicated thread associated with it. Since tasks run separately in microservices in the form of threads, in order to realize the "divide and rule" of microservice architecture [36]. Each microservice has a local database. Using the connection pool through the configurable number of connections can not only achieve high throughput, but also protect the database. The database connection cannot be shared across multiple processes, but the interaction between multiple microservices can be realized through inter-process communication (IPC). Cloud applications typically need to integrate multiple dependent operations to realize complex business logic. Therefore, cloud applications can be modelled using dependent workflow. Each microservice corresponds to a separate agent, which allocates thread resources through workflow segmentation and agent cooperation [35]. Figure 1 designs a workflow driven microservice architecture in a cloud environment. FIGURE 1Open in figure viewerPowerPoint Workflow-driven microservice architecture in cloud environment Workflow tasks constitute the basic elements of cloud applications. Each task requires specific computing resources, such as the CPU and database shown in Figure 1. Developers only need to deploy tasks into microservices without considering complex communication protocols. Each task has the execution time and its parent tasks, which constitute a directed task graph. In a given task graph, a task without a parent task is called an entry task tkentry, and a task without a child task is called an exit task tkexit. Since our algorithm needs an entry task and an exit task, we always add two virtual tasks, tkentry and tkexit, at the beginning and end of the workflow respectively. The execution time of these entry and exit tasks is zero. Definition 1.The task to be executed in the cloud application is 4 tuples: TASK = (execT, rR, relations, transParent), where: execT represents the execution time of the task and the number of total tasks is |TK|; rR = (rCPU, rRAM, rStorage) represents the required computing resource for the task, where rCPU, rRAM, and rStorage are the required CPU, memory and storage; relations = {parallel, sequence, selection, loop} is the relationship function between tasks, which is used to describe the execution process of the system, mainly considering sequence (>), selection (+), parallel relationship (|) and loop (◎); transParent = {PARENT, transData}, where PARENT is the set of the parent tasks and transData represents the transfer data from the parent task. The difference between microservice architecture and monolith architecture lies in "divide and rule", that is, to clarify the module or function boundary by dividing services. The running environment, dependencies and system libraries of each microservice instance are packaged together, deployed independently and run in a process [37]. The process of the microservice instance provides special threads for each task request. Multiple threads in the same process share the resources of the process, such as CPU, memory and database. In the same process, the local database can be shared among multiple threads. For different processes, the interaction between multiple microservices can be realized through IPC (Inter-Process Communication). Definition 2.The microservice is defined as 6 tuples: MS = (type, pR, BW, ratio, λ, threads), where: type defines the basic configuration of microservice. For each type of microservice, the cost rate cr has been identified. The number of total microservices is |MS|; pR = (pCPU, pRAM, pStorage) is the set of provided computing resource; BW represents the bandwidth of microservice; ratio is the duty cycle, which is an attribute of microservice; λ is the failure rate, which mainly considers the failure rate λ1 during microservice execution and λ2 during data transmission; threads is a set of tasks, which is executed in the microservice. The number of threads is |TD|. Each agent has independent decision-making ability to judge according to its current state. Each agent obtains the tasks to be performed, and then assigns them to the microservice according to the current state [38]. In each microservice, each task is assigned to a thread as a resource. The local database of microservices can realize cross thread connection, that is, multiple threads share the same database connection in microservices. The amount of CPU and other resources required by the task shall be limited by the computing resources provided by the microservice. Agents can cooperate with each other. For example, if the existing computing platform is overloaded, the overloaded tasks can be migrated to the idle platform [39]. Definition 3.The agent is a triple tuple: AGENT = (TASK, MS, sess), where: TASK (execT, rR, relations, transParents) is the set of tasks, which is the deployed by agent for microservice; MS = (type, tR, BW, ratio). Each microservice should be deployed in the container in one agent; sess: TASK * MS → MS. The task can be added to the threads, meanwhile the computing resource rR is required. Concurrently, the task can be removed from the threads and the computing resource rR is released. Workflow driven microservice architecture in cloud environment includes a series of microservice collections. Cloud applications extend computing resources to computing nodes. Cloud users apply for and release resources according to the needs of applications, and perform tasks on the specified nodes. Agents in the cloud environment collaborate to optimize reliability within budget constraints [40]. Definition 4.The cloud application is composed of microservice, which can be defined as 5 tuples: CA = (MS, calcTT, calcST, D, B, R), where: MS = (type, pR, BW, ratio, threads) is a set of microservices for cloud application, which has been defined in Definition 2; calcTT: TASK ⨉ TASK→ N* indicates the transfer time function between two tasks. It depends on the deployment of the microservice where the workflow task is located and the transmission data between workflow tasks; calcST: TASK ⨉ MS → N* is to calculate the service time for TASK deployed in MS. The service time depends on the execution time execT for TASK and the threads of the MS; D is the deadline required to complete the whole workflow driven cloud application; B is the total budget for providing services for cloud applications; MAS-based cloud application modelling. Aiming at the reliability requirements of cloud applications, this section describes the hierarchical microservice architecture (MAS-HMSAN) model based on multi-agent system, then analyses and verifies the properties of the model. PrT net syntax and semantics Focusing on the reliability requirement of the cloud computing, this section firstly gives the syntax and execution semantics to describe the hierarchical cloud computing structure and basic components. Then, a hierarchical cloud computing model is formed and lays the foundation for system analysis and verification. As a graphical modelling tool and a formal model with rich mathematical foundation, Petri net can be widely used to describe and study systems with concurrent, asynchronous and distributed characteristics. Therefore, Petri net is very suitable to describe distributed embedded loosely coupled systems. Some basic concepts of system operation are introduced below. Definition 5.A 6 tuples Σ = (N, IO, D, AT, AF, M0) is called primary service net (PSN), where: N = (P, T, F) is a basic Petri net, where P, T, F denote the finite set of place, transition, and arc; IO⊂P is a particular set called the Σ interface; D is a non-empty finite individual set, fD and fS are given as predicate sets and symbol sets, respectively; AT: T→fD, for t∈T, the free variable in AT(t) must be a directed arc free variable with t as one end; AF: F→fS, if (p, t)∈F or (t, p)∈F, then AF(p, t) or AF(t, p) is the sum of n-ary symbols and is null by default; M: P→fS is the marking of Σ, p∈P, the initial marking M0(p) does not contain any free variables. PSN is mainly used to model the execution process of available microservice instances. The state, possible change, and the parameter of available microservice instances are described by place, transition, and interface, respectively. For any x∈(P∪T), set •x = {y|y∈(P∪T)∧(y, x)∈F} and x• = {y|y∈(P∪T)∧(x, y)∈F} correspond to the input and output of x, respectively. For any ti∈T, the input/output arc of transition ti and the set of free variables in AT (ti) are denoted as FV (ti). Definition 6.A 6 tuples Ω = (Σ, Γ, TI, TA, PI, PA) is called an MAS-hierarchical microservice architecture net (HMSAN). Σ is a PSN, which describes the basic structure of Ω. Γ = {Γi|i∈N*} is a finite set of pages, PSN or HMSAN. If Ni = (Pi, Ti, Fi), then ∀Γi, Γj∈Γ, (Pi∪Ti∪Fi)∩(Pj∪Tj∪Fj) = Ø. TI⊂T is a collection of alternative nodes, where each page corresponds to a substitute node. TA: TI→Γ is the page allocation function to assign specific pages for each substitute node. PI⊂P is a set of interface nodes that describe the substitute nodes' input and output locations. PA is a port mapping function. The purpose is to map the interface node of the substitute node to the interface of the corresponding page. The MAS-HMSAN net is used to model the execution process of microservice instances. In order to distinguish symbols, interface nodes and optional transitions are marked with upper case letters, the other places and transitions are marked with lower case letters. Besides, the input and output interface are symbolized with superscript I and superscript O, respectiv