Hybrid scheduling system of FaaS platform based on KVM virtualization

By adopting a hybrid scheduling system based on KVM virtualization on the FaaS platform, using user-state schedulers and lightweight virtualization technology to achieve dynamic allocation and scheduling of tasks, the problem of low execution efficiency of the FaaS platform in a high concurrency environment is solved, resource utilization and task execution efficiency are improved, and user service costs are reduced.

CN119781972AActive Publication Date: 2025-04-08EAST CHINA NORMAL UNIV
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411865670.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-04-08
Estimated Expiration
2044-12-18

AI Technical Summary

Technical Problem

The existing FaaS platform is difficult to maintain ideal execution efficiency in a high concurrency environment, resulting in degradation of application performance, increased tail delay and extended execution time, thereby increasing user service costs.

Method used

A hybrid scheduling system based on KVM virtualization is adopted, including pre-execution processors, task detectors, task distributors and load balancers. Through user-state schedulers and lightweight virtualization technology, dynamic allocation and scheduling of tasks are realized, adapting to changes in task characteristics, and optimizing resource utilization and task execution efficiency.

Benefits of technology

It improves the resource utilization rate and task execution efficiency of the FaaS platform in a high concurrency environment, reduces the average task execution time, alleviates the problem of excessive charging of users by the platform, and provides a flexible and efficient adaptive scheduling solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119781972A_ABST
    Figure CN119781972A_ABST
Patent Text Reader

Abstract

The invention discloses a hybrid scheduling system of a FaaS platform based on KVM virtualization, and the system is based on a lightweight user mode scheduling mechanism, and realizes task scheduling and dynamic load balancing through cooperative work of four core modules including a pre-execution processor, a task detector, a task distributor and a load balancer. The pre-execution processor analyzes mixed execution time of different task types under different scheduling methods, and provides data support for scheduling decisions; the task detector monitors submitted tasks in the system in real time and judges task types; the task dispatcher makes a distribution decision in combination with the preprocessing information, the task characteristics and the real-time load proportion; the load balancer ensures load balance among the scheduling sets through real-time load monitoring, and overload of the single-core set is avoided. According to the method, the average task execution time of the FaaS platform in a high-concurrency scene can be shortened, the resource utilization rate and the task execution efficiency are improved, and an efficient and reliable solution is provided for server-free calculation task scheduling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of software development, and in particular relates to a hybrid scheduling system of a FaaS platform based on KVM virtualization. Background Art

[0002] Serverless computing has received widespread attention and application due to its highly simplified resource management and powerful computing capabilities, especially in the fields of distributed computing and cloud services. Among them, Function as a Service, as a key mode in serverless computing, allows developers to deploy single-function applications in a completely decoupled environment without having to worry about the management and maintenance of the underlying servers. The serverless computing model significantly simplifies the complexity of application deployment and management, allowing developers to focus on the implementation of business logic, thereby improving overall development efficiency. However, with the widespread use of FaaS platforms such as AWS Lambda, Google Cloud Functions, and Microsoft Azure Functions, these platforms often find it difficult to maintain ideal execution efficiency when executing high-concurrency function instances. This leads to decreased application performance, increased tail latency, and longer execution time, which directly increases the user's service costs.

[0003] Taking the commonly used FaaS computing platform Firecracker as an example, Firecracker allows thousands of short-life function instances to be executed simultaneously on a bare metal server with only 96 CPU cores, which means that a single physical core can manage hundreds of concurrent tasks. The execution time of FaaS functions is usually a few milliseconds to a few seconds, and about half of the functions take about one second to execute. And it uses kernel-based virtual machines to provide virtual CPUs for isolated user environments to execute tasks. Firecracker uses the default Linux completely fair scheduler algorithm. However, in FaaS computing, short tasks account for the majority, and CFS is not optimized for FaaS computing, which amplifies the overall average execution time of tasks in the platform. At the same time, the Linux scheduler CFS is insensitive to workloads and frequently switches contexts, resulting in long waiting times for short functions, which in turn makes the turnaround time far exceed its actual service time, causing the cloud to overcharge users. Therefore, there is an urgent need for a more flexible and customizable scheduling strategy to improve the performance of FaaS computing.

[0004] Compared with Linux kernel scheduling, user-space scheduling overcomes the inherent defects of kernel-space scheduling and grants scheduling authority directly to user space. Compared with kernel-space scheduling, user-space schedulers are usually implemented by applications or thread libraries. Context switching usually only requires saving and restoring user-space context (such as register status), and does not involve kernel-level information such as CPU status and memory management. User-space scheduling is performed in user-level space, and there is no need to switch to kernel mode every time, avoiding mode switching and the overhead of a large number of system calls, thereby reducing switching overhead. User-space scheduling has made significant breakthroughs in adaptability and performance, which helps to improve the efficiency of advanced applications such as FaaS computing. FaaS platforms that use lightweight virtualization technologies such as Firecracker can achieve high concurrency on a single node.

[0005] In summary, the completely fair scheduling method provided by the Linux kernel is not suitable for high-concurrency, multiple short-task execution scenarios, which limits the overall task execution efficiency in the FaaS platform. Therefore, with the help of the user-mode scheduler, a scheduling system that can improve resource utilization and task execution efficiency in the case of adaptive task feature changes is needed to meet the performance requirements of the FaaS platform in a high-concurrency environment. Summary of the invention

[0006] The purpose of the present invention is to provide a hybrid scheduling system for a FaaS platform based on KVM virtualization, aiming to improve the resource utilization and task execution efficiency of the FaaS platform in a high concurrency environment and meet the real-time changing task feature requirements.

[0007] The specific technical solution for achieving the purpose of the present invention is: A hybrid scheduling system for a FaaS platform based on KVM virtualization, the system comprising: a pre-execution processor, a task detector, a task distributor, and a load balancer; The preprocessing executor applies different user-state scheduling algorithms on a single physical machine according to the existing user-state scheduling system, collects the execution time information of each task under each user-state scheduling algorithm, divides the task types according to the resource intensity of the task and sets different proportions of the number of each task in the preprocessing stage, executes the divided multiple tasks under different user-state scheduling algorithms, and counts the execution time result information of each task under different proportions of different user-state schedulers, so as to provide execution time data for the subsequent real-time task scheduling of the task distributor; The task detector is used to monitor the newly submitted task requests in the system in real time, determine the resource intensity of the current task, and find out whether the currently submitted task has been executed in the platform. If the current task has been executed in the FaaS platform, the resource intensity of the current task is directly obtained according to the information recorded in the preprocessing executor, and then distributed to the corresponding optimal user-mode scheduling set; if the current task has not been executed in the FaaS platform, the task is directly distributed to the Linux default CFS scheduling set. The task detector reads the IO information, Mem information and CPU information of the current task by combining the metrics.fifo pipeline in Firecracker, and classifies the current task in combination with the task type classification basis in the preprocessing executor, and records its specific classification category to provide classification support for the task distribution of the subsequent task distributor; at the same time, a globally unique task ID and submission timestamp are allocated, where: The pre-execution processor and the task detector implement task submission; The task distributor realizes real-time task distribution; according to the current task type recorded in the task detector and the real-time task information in each set recorded in the real-time task ratio monitoring module in each set, the current task is calculated and added to the corresponding core in sequence, and the execution time results under different task ratios recorded in the pre-processing executor are referred to to obtain the optimal value and perform actual task allocation; once the task is allocated to the specified scheduling set, the execution time information, the allocated process identifier and the scheduling set information in the structure are updated; The load balancer is responsible for recording the end time of each completed task distributed by the task distributor, and calculating the specific execution time of each task by calculating the difference between the task end time and the task start time; by counting the total execution time of the current time window of each scheduling set, calculating the average execution time of each scheduling set in the current time window, and providing data support for the dynamic adjustment of the scheduling set; averaging the task execution time of all sets, increasing the size of the set that exceeds the average execution time, and reducing the size of the set with a small average execution time, thereby realizing dynamic scaling of the set and preventing overload of a single set.

[0008] Furthermore, the existing user-state scheduling system applies different user-state scheduling algorithms on a single physical machine. Specifically, the existing user-state scheduling system has the ability to partition processor cores on a single physical machine through centralized scheduling, and can apply different user-state scheduling algorithms to each core set, that is, to achieve global coexistence of multiple user-state scheduling algorithms; by dividing into multiple sets, different user-state scheduling algorithms are executed in different sets.

[0009] Furthermore, the data structure of the current task includes: a globally unique task identifier for uniquely identifying each task; a submission timestamp for recording the time when the task is submitted; an execution time and an end time for tracking the execution cycle of the task; a process identifier for identifying the specific process of task execution; a predefined task type identification for classification according to task type; a scheduling set identifier for indicating the core set to which the current task belongs; when the task detector detects the currently submitted task, it assigns a task identifier to the current task and records the task timestamp and task type.

[0010] Furthermore, the real-time task ratio monitoring module in each set records the information on the number of tasks being executed in each core set in the corresponding time window, monitors the number ratio of tasks of different task types, and is used to calculate the execution time result after adding the current task to be assigned to each core, thereby providing real-time scheduling data support for task distributor scheduling.

[0011] The hybrid scheduling system proposed in the present invention can flexibly adjust resource allocation and scheduling strategies according to the dynamic changes of task characteristics in a high-concurrency environment. The pre-execution processor collects historical task execution data and uses the cosine similarity algorithm to match the optimal scheduling strategy, thereby improving the efficiency of task execution. The task detector identifies the resource requirements of new tasks in real time, and the task distributor combines real-time load information to achieve dynamic and balanced distribution of tasks. The load balancer supports the dynamic scaling capability of the system by monitoring and adjusting the load of the core set, preventing the overload of a single set and ensuring the overall stability of the system.

[0012] The present invention reduces the average execution time of tasks on the existing FaaS platform in a high-concurrency, multi-task environment and alleviates the problem of excessive charges on users by the platform, and provides a flexible and efficient adaptive scheduling solution with good practical value and application prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 This is a diagram of the overall architecture of hybrid scheduling according to an embodiment of the present invention; Figure 2 This is a distribution diagram of a user-mode scheduling processor core set according to an embodiment of the present invention; Figure 3 is a classification diagram of pre-execution tasks in an embodiment of the present invention; Figure 4 is a real-time task classification detection diagram of an embodiment of the present invention; Figure 5 is a real-time task request queue scheduling diagram of an embodiment of the present invention; Figure 6 This is a diagram of the dynamic adjustment of the real-time task set interval according to an embodiment of the present invention. DETAILED DESCRIPTION

[0014] In combination with the technical solution of the present invention and the specific description provided below, a specific implementation of a FaaS platform hybrid scheduling system based on KVM virtualization will be described in detail. This implementation aims to demonstrate how the various modules of the system work together through a specific execution process to achieve efficient task scheduling and collection adjustment.

[0015] The system of the present invention works like this, and its process comprises the following steps: Task submission: In the task submission phase, the system sets up a pre-execution processor and a task detector. Pre-execution processor S101: It is used to collect the execution results of various task types under different user-mode scheduling algorithms before task execution. By analyzing the execution performance of different tasks under different proportional skews, the optimal scheduling strategy is formed to provide data support for subsequent scheduling decisions.

[0016] Task detector: responsible for real-time monitoring of newly submitted task requests, identifying task types, and assigning a globally unique task ID and submission timestamp to each task. For tasks that have already been executed on the platform, their resource-intensive properties are directly obtained based on the information recorded in the pre-execution processor, and they are assigned to the corresponding optimal user-mode scheduling set. If the task is submitted for the first time, it is initially assigned to the Linux default CFS scheduling set; by combining Firecracker's metrics.fifo pipeline, the CPU, memory, I / O and other resource usage information of the task is read, and combined with the task type classification basis in the pre-execution processor, the tasks are classified and recorded.

[0017] Task execution: During the task execution phase, the system includes a task dispatcher. Task dispatcher: Makes task dispatch decisions in real time based on the optimal scheduling strategy provided by the pre-execution processor, the task type identified by the task detector, and the real-time load of each core set. By dynamically allocating tasks, balanced task distribution is achieved, improving resource utilization and task execution efficiency. Once a task is assigned to a specified scheduling set, the task dispatcher will update the execution time, process identifier, and scheduling set in the task structure to ensure the accuracy of task scheduling.

[0018] Collection adjustment: During the collection adjustment phase, the system includes a load balancer. Load balancer: Continuously monitors the load of each core collection and records the execution time of each task. By calculating the execution time of the task, the average execution time of each scheduling collection in the current time window is counted to provide data support for the dynamic adjustment of the scheduling collection. According to the average execution time of different collections, the size of the collection is dynamically adjusted, the resources of the collection with a long average execution time are increased, and the resources of the collection with a short average execution time are reduced to achieve elastic scaling of resources. By balancing the load between the scheduling collections, the overload of a single collection is prevented, and the stability and reliability of the system are guaranteed. Example

[0019] This embodiment is a hybrid scheduling system based on the FaaS platform of KVM virtualization. The system block diagram is shown in Figure 1 In the figure, M is the real-time task ratio monitoring module. The system is based on a lightweight user-mode scheduling mechanism, see Figure 2 , this mechanism allows the core interval to be divided into multiple sets, and a single set has an exclusive user-mode scheduling method, supports the use of different scheduling algorithms under different physical cores, that is, multiple global user-mode scheduling algorithms coexist, and different user-mode scheduling algorithms are executed in different sets by dividing multiple sets. The system mainly includes four core components, namely, pre-execution processor, task detector, task distributor and load balancer. The pre-execution processor is used to pre-execute multiple task types before the real-time task is executed, analyze the execution results of each task under different scheduling methods, match the optimal scheduling strategy through the collected information, and provide data support for subsequent scheduling decisions; the task detector is used to monitor the newly submitted task requests in the system in real time, identify the task type, and assign a globally unique task ID and submission timestamp to provide support for subsequent task distribution; the task distributor makes task distribution decisions in real time according to pre-processing information, task characteristics and real-time task load ratio to achieve dynamic task allocation; the load balancer ensures load balance between scheduling sets by continuously monitoring the load of each core set, supports dynamic resource scaling, prevents single set overload, and ensures overall stability and reliability.

[0020] The preprocessor executor sets various task types at different skew ratios before the real-time task is executed, and collects the execution time results of each task under various user-mode scheduling algorithms, see Figure 3In the task pre-execution stage, specific tasks are divided into the serverless platform, and the resource usage information and execution time results of the executed tasks are recorded through metrics.fifo. The specific task division in this stage includes the division of known task types, the division of multiple tasks with different proportions under the same concurrency number, and the execution of different combinations under different user-mode schedulers, and the actual execution time of each task is recorded. The resource information used during the execution of known types of tasks is recorded through metrics.fifo to provide data support for the subsequent division of real-time tasks. Its statistical time results and task type division information are counted in the pre-execution data.

[0021] The task detector is used to determine the resource intensiveness of real-time tasks, see Figure 4 , using the characteristics of the serverless platform, the executed tasks will be recorded by the platform. By finding out whether the currently submitted task has been executed in the platform, the real-time tasks can be quickly classified according to the pre-execution data. If the current task has been executed on the FaaS platform, the resource intensity of the current task is directly obtained according to the information recorded in the preprocessor; if the current task has not been executed in the FaaS platform, the task is directly distributed to the Linux default CFS scheduling collection. The task detector reads the IO information, Mem information and CPU information of the current task by combining the metrics.fifo pipeline in Firecracker, and classifies the current task according to the task type classification basis in the preprocessor to obtain the current task classification result. This process involves updating the data structure. Its data structure contains: a globally unique task identifier, which is used to uniquely identify each task; a submission timestamp, which is used to record the time when the task is submitted; an execution time and an end time, which are used to track the execution cycle of the task; a process identifier, which is used to identify the specific process of the task execution; a predefined task type identification, which is used to classify according to the task type; a scheduling collection identifier, which is used to indicate the core collection to which the current task belongs. When the task detector detects the current submitted task, it assigns a task identifier to the current task and records the task timestamp and task type.

[0022] The task distributor, see Figure 5 The task distributor is based on the current task type recorded in the task detector and monitors the real-time task ratio in each set through the module M (see Figure 1)Monitor the number of real-time tasks in each core set in the time window and summarize the ratio of all queue tasks. Calculate the ratio of tasks in each set after adding the current task to the corresponding core interval. Use cosine similarity to match the optimal execution time under multiple task ratios recorded in the preprocessor. Quickly obtain the optimal execution time result of the current task in each set, find the minimum value of the optimal time obtained in each set and assign it to the execution interval queue, waiting for the user-mode scheduling algorithm in the set interval to schedule. Once the task is assigned to the specified scheduling set, update the execution time information, the assigned process identifier, and the scheduling set information in the structure.

[0023] The load balancer, see Figure 6 , the load balancer records the end time of each completed task, and calculates the specific execution time of each task in the platform by calculating the difference between the task end time and the task start time. By counting the total execution time of the current time window of each scheduling collection, the average execution time of each scheduling collection in the current time window is calculated. The load balancer compares the maximum difference of the collection average time with the collection interval adjustment threshold. If the maximum difference exceeds the adjustment threshold, it means that the adjustment of the collection interval can make up for the cost of the adjustment interval. The overall collection interval is redistributed according to the proportion of the average execution time of each collection. If it does not exceed, the original interval allocation is used for execution. By unifying the average execution time of tasks in all collections, increasing the number of cores of collections with long average execution time, and reducing the size of collections with small average execution time, dynamic scaling of collections can be achieved.

Claims

1. A hybrid scheduling system for a FaaS platform based on KVM virtualization, characterized in that: The system includes: a pre-execution processor, a task detector, a task distributor and a load balancer; The preprocessing executor applies different user-state scheduling algorithms on a single physical machine according to the existing user-state scheduling system, collects the execution time information of each task under each user-state scheduling algorithm, divides the task types according to the resource intensity of the task and sets different proportions of the number of each task in the preprocessing stage, executes the divided multiple tasks under different user-state scheduling algorithms, and counts the execution time result information of each task under different proportions of different user-state schedulers, so as to provide execution time data for the subsequent real-time task scheduling of the task distributor; The task detector is used to monitor the newly submitted task requests in the system in real time, determine the resource intensity of the current task, and find out whether the currently submitted task has been executed in the platform. If the current task has been executed in the FaaS platform, the resource intensity of the current task is directly obtained according to the information recorded in the preprocessing executor, and then distributed to the corresponding optimal user-mode scheduling set; if the current task has not been executed in the FaaS platform, the task is directly distributed to the Linux default CFS scheduling set. The task detector reads the IO information, Mem information and CPU information of the current task by combining the metrics.fifo pipeline in Firecracker, and classifies the current task in combination with the task type classification basis in the preprocessing executor, and records its specific classification category to provide classification support for the task distribution of the subsequent task distributor; at the same time, a globally unique task ID and submission timestamp are allocated, where: The pre-execution processor and the task detector implement task submission; The task distributor implements real-time task distribution; according to the current task type recorded in the task detector and the real-time task information in each set recorded in the real-time task ratio monitoring module in each set, the current task is calculated and added to the corresponding core in sequence, and the optimal value is obtained according to the execution time results under different task ratios recorded in the preprocessing executor, and the actual task allocation is performed; once the task is assigned to the specified scheduling set, the execution time information, the assigned process identifier and the scheduling set information in the structure are updated; The load balancer is responsible for recording the end time of each completed task distributed by the task distributor, and calculating the specific execution time of each task by calculating the difference between the task end time and the task start time; by counting the total execution time of the current time window of each scheduling set, calculating the average execution time of each scheduling set in the current time window, and providing data support for the dynamic adjustment of the scheduling set; averaging the task execution time of all sets, increasing the size of the set that exceeds the average execution time, and reducing the size of the set with a small average execution time, thereby realizing dynamic scaling of the set and preventing overload of a single set.

2. The hybrid scheduling system of the FaaS platform based on KVM virtualization according to claim 1 is characterized in that: The existing user-state scheduling system applies different user-state scheduling algorithms on a single physical machine. Specifically, the existing user-state scheduling system has the ability to partition processor cores on a single physical machine through centralized scheduling, and can apply different user-state scheduling algorithms to each core set, that is, to achieve global coexistence of multiple user-state scheduling algorithms; by dividing into multiple sets, different user-state scheduling algorithms are executed in different sets.

3. The hybrid scheduling system of the FaaS platform based on KVM virtualization according to claim 1 is characterized in that: The data structure of the current task includes: a globally unique task identifier for uniquely identifying each task; a submission timestamp for recording the time when the task is submitted; an execution time and an end time for tracking the execution cycle of the task; a process identifier for identifying the specific process of task execution; a predefined task type identification for classification according to task type; a scheduling set identifier for indicating the core set to which the current task belongs; when the task detector detects the currently submitted task, it assigns a task identifier to the current task and records the task timestamp and task type.

4. The hybrid scheduling system of the FaaS platform based on KVM virtualization according to claim 1, characterized in that: The real-time task ratio monitoring module in each set records the number of tasks being executed in each core set in the corresponding time window, monitors the ratio of the number of tasks of different task types, and is used to calculate the execution time result after adding the current task to be assigned to each core, providing real-time scheduling data support for task distributor scheduling.

Citation Information

Patent Citations

  • Distributed task scheduling method and device, electronic equipment and computer readable storage medium

    CN115878273A

  • Data storage method, server and storage medium

    CN116737075A

  • Task scheduling system and method for relieving server-free computing cold start problem

    CN117331648A

  • Hierarchical multi-core real-time scheduler

    CN117724811A

  • Scalable function as a service platform

    US20190377604A1