An Adaptive Microservice Scheduling System Optimized for Data I / O

By embedding compiler sampling code into the microservice system, data access paths are monitored and optimized in real time, solving the storage I/O latency problem affected by the data source location and improving the data access efficiency and performance of large application systems.

CN114281512BActive Publication Date: 2025-11-14SHANGHAI FUDIAN INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111665645.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2025-11-14
Estimated Expiration
2041-12-31

AI Technical Summary

Technical Problem

In large-scale AI application scenarios such as smart parks and smart cities, the data I/O efficiency of microservice systems is affected by the location of the data source, resulting in high storage I/O latency and making it difficult to optimize in complex network environments.

Method used

By embedding compiler-based storage I/O sampling code into microservices, the storage I/O status can be monitored and analyzed in real time. The running position of microservices can be dynamically calculated and adjusted to optimize data access paths. Dynamic rescheduling can be performed using a scheduler to reduce storage read and write latency.

Benefits of technology

It effectively shortens the data path, improves the data access efficiency of microservice systems, reduces storage I/O latency, and enhances the operating performance of large and complex application systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114281512B_ABST
    Figure CN114281512B_ABST
Patent Text Reader

Abstract

This invention provides a technique for microservice scheduling and improving data read / write efficiency based on runtime state analysis. Microservice systems have become one of the fundamental technology platforms for building large-scale, complex applications. By encapsulating modular information processing units in a lightweight virtual machine manner, high fault tolerance is achieved. Various application functions are orchestrated through service mesh to realize stable large-scale, complex application systems. Microservices often need to access multiple data sources or data lake systems, and the location of data has a critical impact on data read / write efficiency. For example, in a distributed storage system, having the execution node of a microservice coincide with or be close to the data storage node will greatly improve data processing efficiency. Addressing the efficiency problem of microservices in data-intensive scenarios in large-scale applications, this invention proposes a technique based on analyzing the runtime state of data read / write operations to determine the optimal location for microservice scheduling and execution. By shortening the data path, data I / O efficiency is effectively improved, enhancing the performance of building large-scale, data-intensive application systems based on microservices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of information technology, and in particular relates to an adaptive microservice scheduling method optimized for data I / O. It is mainly used to improve the operating performance of microservice-based application systems in complex cloud computing and edge computing environments, especially to reduce storage I / O latency. Background Technology

[0002] Smart parks and smart cities, as typical large-scale artificial intelligence application scenarios, involve a large amount of complex and demanding data I / O. In particular, the complex configuration of computing, storage, and network environments means that I / O rates are significantly affected by the location of the application running and the data source. The collaborative approach of cloud computing and edge computing makes shortening data paths and improving I / O speed the primary computational adjustment for improving the operational efficiency of data-intensive and communication-intensive application systems. Microservices 1 It provides a modular standard for building application systems and has high availability characteristics, and has been widely adopted as an implementation method for building large-scale application systems.

[0003] Microservices for AI computing often need to access multiple data sources or data lake systems. The location of data has a critical impact on data I / O efficiency. For example, in a distributed storage system, having the execution node of a microservice coincide with or be close to the data storage node will greatly improve data processing efficiency. This invention improves the efficiency of microservice operation by using a dynamic sampling mechanism to obtain statistical data on the frequency and capacity of microservice I / O to data sources, and dynamically adjusting the data path according to the data channels of its operating environment, thereby shortening the data path and reducing I / O latency. Summary of the Invention

[0004] This invention provides a technique for microservice scheduling and improving data read / write efficiency based on runtime state analysis. Microservice systems have become one of the fundamental technology platforms for building large-scale, complex applications. By encapsulating modular information processing units in a lightweight virtual machine manner, high fault tolerance is achieved. Various application functions are orchestrated through service mesh to realize stable large-scale, complex application systems. Microservices need to access multiple data sources, and the location of data is a key factor affecting data read / write efficiency. Data access in large-scale, complex application systems involves structured databases, unstructured databases, object storage, file storage, etc., and various data sources can be implemented through centralized storage systems or distributed data platforms. Therefore, data locality often becomes a key to application performance optimization, especially in distributed storage systems built in a network environment, where shortening I / O channel latency is crucial for improving storage access efficiency. Addressing the efficiency problem of microservices in data-intensive scenarios in large-scale applications, this invention proposes a technique based on analyzing the runtime state of data read / write operations to determine the optimal location for microservice scheduling and execution. By shortening the data path, it effectively improves data I / O efficiency, thereby enhancing the performance of building large-scale, data-intensive application systems based on microservices.

[0005] To achieve the above objectives, this invention utilizes compiler technology. 3 This invention embeds storage I / O-related sampling points into microservices and sends the sampling information to the microservice scheduler. The scheduler analyzes storage read / write efficiency and searches for more optimized microservice execution locations, thereby reducing storage read / write latency. The scheduling optimization process occurs during the operation of the microservice-based application and automatically re-decides decisions when the operating environment changes, ensuring that the application system's storage access costs are always kept at an optimized level. This invention is applicable to cloud-edge collaborative environments, i.e., operating environments with complex configurations of computing performance, communication, and storage I / O rates.

[0006] This invention comprises three parts: 1. Storage I / O sampling code implantation based on compiler technology; 2. The scheduler analyzes the storage I / O status of the microservice-based system at runtime and calculates the optimal memory access location by obtaining storage I / O information through the sampling code; 3. Dynamic scheduling is performed based on the optimal memory access location, placing the microservice in the location with the best memory access efficiency, and dynamically triggering the recalculation and scheduling of the memory access location by changing the runtime environment. Attached Figure Description

[0007] Figure 1 Sampling code injection;

[0008] Figure 2 An example of calculating optimized task scheduling strategies based on a value model (i.e., optimized allocation of microservices);

[0009] Figure 3This is a flowchart of the operation execution process;

[0010] Figure 4 This is a flowchart illustrating the effect. Detailed Implementation

[0011] This invention is implemented through static code analysis and implantation, runtime storage I / O state analysis, and microservice rescheduling. Static code analysis and implantation analyzes microservice code through compiler plugins, primarily focusing on implanting sampled code in the storage operation-related code (API) sections. The microservice scheduling system collects storage I / O state statistics at runtime, searches for the optimal execution location for the microservice, and performs online rescheduling. When the runtime environment changes, the storage location is recalculated and rescheduled; here, a change in the runtime environment refers to a change in the storage read / write location (e.g., a scenario where an application microservice switches from one object store to another).

[0012] Compiler-based memory I / O sampling code implantation

[0013] The compiler scans the microservice program and inserts a sampling function before each storage I / O operation, such as... Figure 1 As shown. Each time the sampling function is called, it updates the count for the storage I / O address. If the count reaches the threshold, it sends statistical information to the scheduling center, including the count content and the addresses involved in reading and writing.

[0014] The pseudocode execution steps of the sampling function are as follows: Figure 3 As shown:

[0015] The URL represents the device ID, and the size represents the traffic count.

[0016] The counting information includes the number of storage read / write operations and the volume of data read / written. The condition that triggers the sending of statistics to the scheduler also includes the read / write data volume reaching a capacity threshold. Both the read / write count threshold and the read / write data volume threshold apply to a specific type of storage (represented by a URL), therefore a global table is needed to maintain them. Storage types include local disk read / write, SAN read / write, NAS read / write, object storage read / write, and database access, etc.

[0017] For microservices implemented in different programming languages, different types of compilers can be used to analyze and inject code based on source code, intermediate code, or binary code. Sampling functions are attached to the microservice implementation as a separate function library.

[0018] Language type Analysis and sampling code implantation methods C / C++ Analyze the binary file and insert sampling function calls Java Analyze the bytecode file and insert sampling function calls. Python Analyze the source code file and insert sampling function calls.

[0019] Calculate the optimal memory access location and perform dynamic scheduling based on the optimal memory access location:

[0020] The optimal memory access location is determined by searching the cluster for the node with the lowest memory access cost for microservice a. If that node is already occupied, the search continues for the remaining node with the lowest memory access cost. The scheduler obtains the storage access information for microservice a by collecting sampled information, including a list S = {s0, s1, … s} of the storage accessed by a. N The frequency of accessing the storage system in the access list is F={f0, f1, … f}. N} and data capacity V = {v0, v1, … v N The weight of each item stored in memory is calculated using F and V when calculating memory access costs. The algorithm for calculating the optimal memory location is represented as follows: Figure 4 As shown.

[0021] Input: Current microservice 'a', compute cluster 'cluster'

[0022] Output: the best running node for 'a'

[0023] The algorithm calculates the storage I / O operation cost of microservice 'a' on each node in the computing cluster to find the optimal node, i.e., the node with the lowest storage I / O operation cost. If the optimal node cannot be successfully allocated, the algorithm searches for the next best node.

[0024] The function SC(a, node) for calculating the cost of storage I / O operations can be expressed as: SC(a, node) = Sum 1..N (Channel_Cost(s i ,node) * w i ), s i This corresponds to the storage system list being accessed by 'a' only being able to access the i-th storage, w i This indicates the corresponding weight. Channel_Cost represents the cost of accessing data between storage and nodes. The definition of the Channel_Cost function needs to be set based on empirical values ​​from the user's actual deployment scenario. Sum represents summation.

[0025] w i The calculation is represented as w i = (f i * r / Sum 1..N (f i ) + v i * (1 - r) / Sum 1..N (v i )) / 2; r represents a value greater than 0 and less than or equal to 1. It can be seen that the calculation of weight takes into account both storage access frequency and data read / write volume, and r is used to define the ratio between frequency and capacity.

[0026] Figure 2 An example of calculating the optimal memory access location through dynamic optimization is given. In the diagram, microservice B has memory access operations on both nodes 1 and 2 (memory access traffic is expressed by the thickness of the data flow lines). The data traffic to the remote node (node ​​2) is greater than that to the local node (node ​​1). Therefore, the calculated optimal execution location is node 1.

[0027] Dynamically triggering recalculation and scheduling of memory access locations by changing the runtime environment:

[0028] The above scheduling arrangement searches for the optimal running node in the compute cluster based on the current cost of microservice accessing storage. The cluster includes cloud compute nodes and edge compute nodes; therefore, the location closest to the data is usually the optimal running node, and this location is relatively fixed. Potential microservice rescheduling only occurs in two situations:

[0029] 1. Changes in the cluster environment: This includes the addition of new compute nodes, whose memory access costs may be lower than those of currently running nodes, or the current nodes becoming unavailable; or changes in the access costs of the storage system, requiring a recalculation of the overall memory access costs.

[0030] 2. The storage status of the microservice itself changes: some storage is no longer accessed, or new storage access is added, so the storage access cost needs to be recalculated.

[0031] For the two scenarios mentioned above, the cluster scheduler needs to recalculate the memory access cost of each microservice and arrange for rescheduling to ensure that the microservice is always in an optimized memory access state.

Claims

1. An adaptive microservice scheduling method optimized for data I / O, characterized in that, include: Embed compiler-based storage I / O sampling code in microservices to collect the storage lists accessed by the microservices, the access frequency of each list, and the data capacity. The collection process involves obtaining statistical information about microservice storage I / O through runtime sampling, including storage I / O read / write frequency and data volume. The read / write frequency and data volume are obtained through runtime sampling statistics, and the sampling triggering conditions include: (1) The number of reads and writes to the same memory address reaches the threshold; (2) The read / write data capacity of the same storage address reaches the threshold; The scheduler analyzes the storage I / O status of the microservice-based system by sampling the code to obtain storage I / O information, calculates the optimal memory access location, and constructs a memory access cost model: SC(a, node) = Sum 1..N (Channel_Cost(s) i ,node)*w i ), where a is the microservice to be scheduled, s i w represents the i-th storage system accessed by microservice a. i Based on access frequency f i and data volume v i The calculated weights, Channel_Cost(s) i (node) represents the access cost between the storage system and the computing node; The weight w i The calculation formula is: w i =(f i *r / Sum 1..N (fi) + v i *(1-r) / Sum 1..N (v) i )) / 2, where r is used to define the ratio between frequency and capacity; The optimal memory access location is calculated based on the memory access cost model. Dynamic scheduling is performed based on the optimal memory access location to arrange microservices in the location with the best memory access efficiency. The recalculation and scheduling of the memory access location are dynamically triggered by changes in the runtime environment. The scheduler triggers a recalculation of storage I / O-based operating costs based on changes in the runtime environment state, and reschedules microservices to the updated optimal running position. Changes in the runtime environment that trigger changes to the location of microservices include adding or removing computing, network, and storage devices from the computing cluster, as well as changes in how the microservices access storage data sources.

2. The adaptive microservice scheduling method for data I / O optimization according to claim 1, characterized in that... The compiler performs static analysis on the microservice code and incorporates dynamic information sampling capabilities. The compiler scans the microservice program and inserts a sampling function before each storage I / O operation, performing analysis and code implantation in the form of source code, intermediate code, or binary code.

3. The adaptive microservice scheduling method for data I / O optimization according to claim 1, characterized in that the scheduler... The system dynamically assigns running locations to microservices based on storage I / O operating costs. During dynamic scheduling, the node with the lowest storage access cost is selected first. If the node cannot be successfully allocated, the next best node is selected.

Citation Information

Patent Citations

  • Micro-service online distribution method and system based on coupling degree

    CN112148484A