Method, medium and system for query processing
By moving network applications to hardware accelerators in edge computing and combining the fault tolerance and resource efficiency of serverless computing platforms, the problem of poor performance of serverless platforms is solved, and application performance improvement and cost savings are achieved.
Patent Information
- Application Number
- CN202111279903.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-28
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2041-10-28
AI Technical Summary
Existing serverless platforms are based on the assumption that hardware and requests are isomorphic, resulting in poor performance and difficulty in effectively utilizing hardware accelerators such as SmartNIC, resulting in performance bottlenecks and high costs for network processing tasks.
By moving part or all of network-related applications to hardware accelerators, such as SmartNIC, in edge computing, combined with the fault tolerance and resource efficiency of serverless computing platforms, traffic distributors, workload predictions, and auto-scaling engines are used to optimize computing resource allocation and use.
It has achieved a 75% improvement in application performance and a 60% cost saving, and effectively utilized the heterogeneity of hardware accelerators to improve the performance and efficiency of edge computing.
Smart Images

Figure CN115208879B_ABST
Abstract
Description
Background Art
[0001] Edge computing is changing the way data is manipulated, processed, and delivered to millions of devices around the world. The explosive growth of Internet-connected devices (e.g., Internet of Things devices (IoT)) and new applications that require real-time computing capabilities continue to drive edge computing systems. Despite the growing demand for edge computing, computing resources remain limited because the computing performance of the current generation of hardware has stagnated while network performance continues to grow exponentially. The widening gap between network performance and computing performance can be addressed, at least in part, by using hardware accelerators such as smart network interface cards (SmartNICs).
[0002] In recent years, a lot of research has been conducted on SmartNICs to explore application and network offloading; however, most of these efforts are limited to ad hoc networking and application offloading to remove the burden of specific network processing tasks (e.g., encryption, firewall processing, Transmission Control Protocol (TCP) offloading, etc.) from the host operating system. BRIEF DESCRIPTION OF THE DRAWINGS
[0003] The embodiments described herein are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings in which like references indicate similar elements.
[0004] Figure 1 is a block diagram conceptually depicting various functional units of an architecture in which a heterogeneous cluster of container orchestration platforms can be distributed across host servers and hardware accelerators according to an embodiment.
[0005] Figure 2 is a flow chart illustrating a high-level process according to an embodiment.
[0006] Figure 3A is a block diagram illustrating the interaction between a workload prediction process and a control system according to an embodiment.
[0007] Figure 3B is a block diagram illustrating a feedback control loop according to an embodiment.
[0008] Figure 4 is a flow chart illustrating a proactive autoscaling process according to an embodiment.
[0009] Figure 5 is a flow chart illustrating a workload prediction process according to an embodiment.
[0010] Figure 6 is a flow chart illustrating a training process according to an embodiment.
[0011] Figure 7is a graph illustrating parameter tuning of a proportional-integral (PI) controller according to an embodiment.
[0012] Figure 8 is a flow chart illustrating custom pod scaling according to an embodiment.
[0013] Fig. 9 is a flow chart illustrating a query process according to an embodiment.
[0014] Fig.10 is a block diagram of a computer system according to an embodiment. DETAILED DESCRIPTION
[0015] The embodiments described herein generally relate to edge acceleration by partially or fully offloading network-related applications to hardware accelerators. There has been a large amount of research on SmartNICs to explore application and network offloading; however, these efforts are mostly limited to ad hoc network and application offloading to remove the burden of specific network processing tasks (e.g., encryption, firewall processing, Transmission Control Protocol (TCP) offloading, etc.) from the host operating system.
[0016] While advances in SmartNICs promise to provide high computing power close to network packets at a lower cost than multiple servers at the edge, leveraging and offloading applications on SmartNICs is very challenging due to the various configurations and constrained nature of their platforms. At the same time, most serverless platforms do not take advantage of the heterogeneity of hardware resources and the resource requirements of applications. This is because current serverless platforms are designed based on the assumption that hardware and requests are homogeneous. This assumption leads to suboptimal performance of serverless platforms.
[0017] To illustrate this problem, consider a simple example involving two serverless functions A and B that take 2 seconds and 10 seconds respectively to run on a SmartNIC and 1 second and 5 seconds respectively to run on a host operating system (OS). Assuming the overhead associated with the host OS's network stack is 2 seconds, the response time of functions A and B is actually 3 seconds (for function A) and 7 seconds (for function B) if the functions are running on the host OS, and 2 seconds (for function A) and 10 seconds (for function B) if the functions are running on a SmartNIC. Therefore, in this case, it is better to offload function A to run on the SmartNIC to bypass the network stack overhead.
[0018] In various embodiments described herein, the fault tolerance and resource efficiency of the serverless computing platform are utilized to achieve edge acceleration. Since the granularity of deployment is at the function level of serverless computing, it may be more effective to use serverless computing than to try to push heavy virtual machines or containers onto hardware accelerators. As described in further detail below, a platform is provided that realizes edge acceleration by partially or completely transferring network-related applications to the SmartNIC core based on the specific edge use case discussed. Empirical data show that the proposed architecture described herein has the potential to improve application performance by about 75% and save about 60% of costs. Non-limiting examples of application types that can be transferred include analytical applications (e.g., analytical applications of directed acyclic graphs composed of a set of subtasks), key-value storage, microservices, network functions, and other serverless functions / workloads. Non-limiting examples of serverless computing platforms or frameworks that can be used in various embodiments include open source solutions (e.g., OpenFaas, OpenWhisk, OpenLambda, Knative Serving, Fission) and commercial solutions (e.g., Amazon Lambda, Microsoft Azure Functions, and Google Cloud Functions).
[0019] In the context of various examples described herein, the platform includes a traffic distributor module, a workload prediction module, and a scaling engine that can implement one of three different autoscaling methods (e.g., a queue-based autoscaler, a custom pod scaler, or a control theory-based autoscaler). The traffic distributor module can be used to divide traffic based on the computing power of each server and the SmartNIC at the heterogeneous edge environment in question. The workload prediction module can use the workload history in the window to predict future workloads. Based on this, a queue-based autoscaler can be used to scale the number of replicas up / down in the SmartNIC and host OS accordingly. Alternatively, a custom pod scaler or a control theory-based autoscaler can be employed. For example, a custom pod scaler can scale the number of pods up / down using a custom metric. As further described below, a control theory-based autoscaler can scale the number of replicas up / down based on a target value of a performance metric and a measured value of a performance metric. Reference is made below. Figure 1 The various components of the example system architecture are further described.
[0020] According to one embodiment, a query is received at a cluster of a container orchestration platform. The query may be a Hypertext Transfer Protocol (HTTP) request received from a client accessing a serverless workload function. The cluster may be a heterogeneous cluster distributed across a first processing resource of a host system and a second processing resource of a hardware accelerator of the host system (e.g., a SmartNIC based on a system on chip (SoC)), and may include a master node and multiple worker nodes. The master node may be executed on a first processing resource or a second processing resource, and a first worker node among multiple worker nodes may be executed and run a first instance of an application on a second processing resource. The query may then be directed to a master node or one of the multiple worker nodes.
[0021] Although some embodiments of the present disclosure are described herein with reference to utilizing the compute and storage capacity of one or more system-on-chip (SOC)-based SmartNICs in a serverless framework, it should be noted that various embodiments of the present disclosure are applicable to other types of hardware accelerators, including but not limited to field programmable gate array (FPGA)-based SmartNICs, application-specific integrated circuit (ASIC)-based SmartNICs, coprocessors, graphics processing units (GPUs), tensor processing units (TPUs), other data processing units (DPUs), and the like.
[0022] In the following description, many specific details are set forth in order to provide a thorough understanding of the exemplary embodiments. However, it is apparent to those skilled in the art that the embodiments described herein may be practiced without these specific details. In other examples, well-known structures and devices are shown in block diagram form.
[0023] the term
[0024] The terms "connected" or "coupled" and related terms are used in an operational sense and are not necessarily limited to direct connections or couplings. Thus, for example, two devices may be coupled directly, or via one or more intermediate media or devices. As another example, devices may be coupled in such a way that information may be transferred between them while not sharing any physical connection with each other. Based on the disclosure provided herein, one of ordinary skill in the art will appreciate that there are various ways of connecting or coupling according to the foregoing definitions.
[0025] If the specification states that a component or feature "may," "could," or "might" include or have a property, that particular component or feature is not required to include or have that property.
[0026] As used in the description herein and in the claims that follow, the meanings of “a,” “an,” and “the” include plural references unless the context clearly dictates otherwise. Additionally, as used in the description herein, the meaning of “in” includes “in” and “in,” unless the context clearly dictates otherwise.
[0027] The phrases "in an embodiment," "according to one embodiment," etc. generally mean that the particular feature, structure, or characteristic following the phrase is included in at least one embodiment of the present disclosure, and may be included in more than one embodiment of the present disclosure. Importantly, such phrases do not necessarily refer to the same embodiment.
[0028] "Serverless framework" generally refers to a serverless computing platform or architecture that provides serverless computing. Non-limiting examples of existing serverless framework products include open source solutions such as OpenFaas, OpenWhisk, OpenLambda, Knative Serving, Fission, and commercial solutions such as Amazon Web Services (AWS) Lambda, Microsoft Azure Functions, and Google Cloud Functions.
[0029] "Performance metrics" generally refer to metrics related to applications running within a serverless framework that can be measured or observed. Non-limiting examples of performance metrics include QoS metrics (e.g., packet loss, bit rate, error rate, throughput, transmission delay, delay variation, availability, jitter, latency, etc.), SLA (service level agreement) metrics (e.g., query response time, request arrival interval, service availability, defect rate, security performance, data rate, throughput, jitter, mean time between failures, mean time to repair, mean time to recovery, etc.) or other application performance metrics (e.g., average response time, error rate, application instance count, request rate, application CPU / memory / bandwidth utilization, application availability, garbage collection, number of concurrent users, used / available resources, etc.). Although the embodiments described herein use query or transaction response time as an example target performance metric, those skilled in the art will appreciate that the methods described herein are applicable to a variety of other performance metrics. Similarly, although the embodiments described herein consider an example feedback control loop in which the goal is to keep 90% of the target response time measurements / observations below a specified threshold (referred to herein as the target value of the performance metric), other percentages may also be used.
[0030] A “feedback control system” or “feedback control loop” generally refers to a system that includes a controller in which the performance of an application running within a serverless framework is measured or observed, and some parameter or characteristic of the serverless framework (e.g., the number of replicas of a particular application running) is adjusted based at least in part on the measured or observed performance.
[0031] "Replica" generally refers to the unit of replication employed by the autoscaling capabilities of a serverless computing platform to provision or de-provision resources to accommodate the workload that an application is experiencing or is expected to experience. Some serverless computing platforms run containers directly, so containers are the unit of replication for such serverless computing platforms. Other serverless computing platforms, such as Kubernetes, may package one or more containers into a higher-level construct called a "pod," so pods are the unit of replication for such serverless computing platforms.
[0032] Figure 1 is a block diagram conceptually depicting various functional units of architecture 100 according to an embodiment, in which a heterogeneous cluster of container orchestration platforms (e.g., cluster 130) can be distributed across host servers (e.g., host server 110) and hardware accelerators (e.g., hardware accelerator 120).
[0033] According to one embodiment, the container orchestration platform can be any available lightweight distribution of Kubernetes that is compatible with the host server, including but not limited to K8s, K3s, KubeEdge, etc.
[0034] In the context of various embodiments described herein, novel techniques for predicting, distributing, and scheduling workloads within a heterogeneous cloud platform (e.g., a heterogeneous edge environment) containing heterogeneous worker machines / nodes (e.g., servers and hardware accelerators (e.g., SmartNICs)) with various computing capabilities are described. Although in the context of this example, for simplicity, only a single host server and a single hardware accelerator are shown, it is to be understood that a heterogeneous edge environment may include any number of host servers, each of which includes one or more hardware accelerators.
[0035] In the context of this example, a heterogeneous cluster (e.g., a Kubernetes cluster) including a master node (e.g., master node 112) and worker nodes (e.g., worker nodes 113a-n and worker nodes 123a-n) is distributed across host servers and hardware accelerators. Depending on the specific implementation, the master node (e.g., Kubernetes master node) can be deployed on a hardware accelerator, and more or fewer worker nodes can run on the host server or hardware accelerator. Similarly, more worker machines can be part of cluster 130.
[0036] The cluster 130 also includes an application programming interface (API) gateway 140 that represents an entry point to the cluster 130. The API gateway 140 can implement an API (e.g., a Representational REST API over Hypertext Transfer Protocol (HTTP)). Queries initiated by a client (not shown) can first arrive at the API gateway 140 in the form of an HTTP request that calls an API method, for example, corresponding to various serverless functions implemented within the cluster 130.
[0037] The traffic distributor 141 can run on the API gateway 140 and distribute traffic according to the computing power of each worker machine (server) in the heterogeneous edge environment. Contrary to the traditional architecture in which the host server and its (multiple) SmartNICs together represent the worker machines (servers) of the container orchestration platform cluster, in various embodiments described herein, the host server and its (multiple) hardware accelerators can each act as a separate worker machine (server) or node of the cluster 130.
[0038] Assume that queries arrive at the API gateway at an arrival rate of λ (queries per second), and assume that each host OS and hardware accelerator has μ i The service rate (queries per second) represents how to n The queuing problem of distributing received client queries among n worker machines (servers) with corresponding arrival rates (queries per second) can be solved by a queuing model involving one or more cases, including a deterministic queuing model (e.g., a D / D / 1 queue) and a non-deterministic queuing model (e.g., an M / M / 1 queue), where arrivals are determined by a Poisson process and job service times have an exponential distribution, as described below. Since the service rate can represent the performance of the corresponding host OS or hardware accelerator, in this way, the adopted queuing model can take into account the respective computing capabilities of the worker machines.
[0039] For D / D / 1 queues, where the service time and arrival time are deterministic at each queue, the sojourn time can be minimized by using a proportional scheduler as shown below:
[0040]
[0041] Next, assuming M / M / 1 queues at each server (worker machine), traffic can be distributed as follows to make the sojourn time in each queue equal:
[0042] λ1-μ1=λ2-μ2=…=λ n -μ n Equation #2
[0043] In other words, traffic can be distributed among N servers as follows:
[0044]
[0045] Where i = 1, ..., N
[0046] In an embodiment where the hardware accelerator represents a SmartNIC, traffic (e.g., representing queries or transactions received from a client (not shown) accessing a serverless workload function via API gateway 140) can enter and leave a particular server via the hardware accelerator. The hardware accelerator may include a performance monitoring engine (e.g., performance monitoring engine 124), a packet parsing engine (e.g., packet parsing engine 125), and a workload predictor (e.g., workload predictor 126). The packet parsing engine can process incoming packets and store information in a log database (e.g., history database 117) for use by the workload predictor. The performance monitoring engine can monitor the service rates of the hardware accelerator and the host server, respectively, and can send the results to the workload predictor and orchestrator (e.g., orchestrator 114) to facilitate decisions about the optimal number of replicas. Refer to the following Figure 3A and Figure 5 1 to describe non-limiting examples of workload prediction processing that may be performed by a workload predictor.
[0047] In one embodiment, the host server includes: an orchestrator; a scheduler (e.g., scheduling engine 116) operable to schedule workloads on worker nodes; a local resource monitoring engine (e.g., resource monitoring engine 115) operable to provide input about local resource utilization to the scheduler, log database, and scaler. In the context of this example, the scheduler and scaler are collocated with the master node. The scaler can scale up / down the number of replicas (e.g., pods) using various methods described herein.
[0048] Figure 2 is a flow chart illustrating high-level processing according to an embodiment. In box 210, an API call is received at an API gateway (e.g., API gateway 140). In box 220, a traffic distribution function implemented within the API gateway distributes traffic between multiple worker machines of a heterogeneous cluster (e.g., cluster 130) of a serverless framework, wherein one or more hardware accelerators (e.g., hardware accelerator 120) of a host server (e.g., host server 110) can each independently represent or act as a worker machine or node of the cluster. According to one embodiment, traffic distribution is performed based on the respective computing capabilities of the nodes of the cluster by implementing an appropriate queuing model (e.g., represented by equations #1-3 above) that takes into account the potentially different service rates of the nodes.
[0049] At block 230 , inbound traffic associated with a query is received at a SmartNIC (eg, hardware accelerator 120 ) associated with a host server (eg, host server 110 ).
[0050] In response to receiving the incoming traffic, the performance monitoring information may be updated at block 240. In one embodiment, the performance monitoring performed on the SmartNIC includes tracking service rate and arrival rate for use in evaluating queuing models (e.g., Equations #1-#3 above) and / or performing workload prediction.
[0051] At block 250 , a log database (eg, history database 117 ) may be updated with information to facilitate workload prediction, including information regarding query arrival times, service rates, and arrival rates, among other information.
[0052] In box 260, future workloads can be predicted based on historical information stored in the log database. According to one embodiment, in order to proactively allocate the correct number of replicas to meet the service level agreement (SLA), future workload requirements can be predicted in advance. The prediction module (e.g., workload predictor 126) can use a variety of different training and / or prediction methods to predict workload bursts in order to mitigate the impact of container cold start latency. Non-limiting examples of models that can be used include support vector regression (SVR) prediction models and deep learning models. In one embodiment, the prediction model is based on past observations of workloads in windows of size W time units. The window size can be dynamically adjusted based on workload changes observed over time. For example, the training window size can be increased in response to the workload change in the current window being less than a first threshold (e.g., 10%), and the training window size can be reduced when the workload change is greater than a second threshold (e.g., 20%). Workload prediction can be performed locally on the host server, or can be offloaded to the SmartNIC to reduce the load on the host OS and facilitate the availability of early prediction results so that up / down scaling decisions can be made quickly. Refer to the following Figure 3A and Figure 5 to provide further description of an example of a workload prediction process that may be performed by a workload predictor.
[0053] At block 270, autoscaling may be performed. According to one embodiment, a queue-based autoscaler is employed that performs autoscaling based on a predicted arrival rate of the workload, a current number of replicas, and a current service rate of the replicas. In one embodiment, after dividing the traffic among the multiple queues, the number of replicas at each queue may then be appropriately scaled up / down based on a queue-based autoscaling algorithm. In one embodiment, the queue-based autoscaling algorithm is based on the predicted arrival rate of the workload at time t (i.e., λ t ), the current number of copies (r t ) and the current service rate (μ) of the replicas at each server / SmartNIC t ). Based on the foregoing, the system utilization can be expressed as follows:
[0054]
[0055] Then, the probability of the queue being idle can be calculated as follows:
[0056]
[0057] The queue length is:
[0058]
[0059] And, the expected waiting time on the queue is:
[0060] T q =L q / λ t Equation #7
[0061] Then, given the current number of replicas and the system service time (T s ), the system delay can be calculated as:
[0062] T=T q +T s Equation #8
[0063] If the system's latency (T) + 2δ (where 2δ takes into account the autoscaling startup latency) is greater than the target SLA latency, the number of replicas may be scaled up. Alternatively, if the system's latency (T) + δ is less than the target SLA latency, the number of replicas may be scaled down. In one embodiment, to reduce the time complexity of autoscaling, a binary search algorithm may be used to determine the optimal number of replicas to search a latency table of pre-computed queue latency values for various numbers of replicas by comparing the target SLA latency to pre-computed values. For purposes of completeness and not limitation, a pseudo-code example of an example autoscaling algorithm ("Algorithm 1") that may be implemented by the autoscaling module is as follows:
[0064] Algorithm #1 – Example Autoscaling Algorithm
[0065] 1. Input: Job arrival rate λ t , the service rate μ of each server and / or SmartNIC t and the startup delay δ of the container.
[0066] 2. Output: The new number of copies R k
[0067] 3. Pre-calculate the latency of the replica range:
[0068] 4.for r t =1 to MaxReplicas do
[0069] 5.
[0070] 6.
[0071] 7.
[0072] 8.T q =Lq / λ t
[0073] 9. T=T q +T s
[0074] 10.end
[0075] 11.if T+2δ>TargetSLA then
[0076] 12. Scale up to the minimum replica from the precomputed table, where
[0077] T+2δ≤TargetSLA;
[0078] 13.end
[0079] 14.if T+δ <TargetSLA then
[0080] 15. Scale up to the smallest replica from the precomputed table,
[0081] Where T+δ≥TargetSLA;
[0082] 16.End
[0083] To reduce the time complexity of Algorithm 1, the for loop in Algorithm 1 can be pre-calculated and a lookup table can be used to increase the automatic scaling time.
[0084] You can use various alternative autoscaling approaches to queue-based autoscalers that work to meet target latency, including custom pod autoscalers that use custom metrics and scale the number of pods up / down based on predefined thresholds, or refer to the following Figure 3B Describes a control-theoretic based autoscaler.
[0085] In box 280, orchestration is performed to direct queries to the master node or the worker node based on the traffic distribution determined at the API server and to achieve the number of replicas / pods output by the implemented autoscaling method (e.g., queue-based autoscaling, customized pod scaling, or control theory-based autoscaling).
[0086] Figure 3A 338 and the workload prediction processor 333. Figure 1 126. Depending on the particular implementation, workload prediction may be performed on a host server (e.g., host server 110) or one of the hardware accelerators (e.g., hardware accelerator 120). In general, workload prediction processor 333 performs an estimate of future workload, and control system 338 generates output 339 to dynamically and automatically scale the number of replicas of the application in question.
[0087] In one embodiment, control system 338 can be a feedback control system that determines the optimal amount of resources to allow the application to handle the estimated future workload. Based on the amount of resources expected to be consumed by the future workload and the computing power of the replicas, control system 338 can determine the number of replicas based on this.
[0088] In one embodiment, an approach based on active control theory may be employed, wherein a prediction model (e.g., a machine learning prediction model 335) facilitates handling fluctuating resource usage patterns. The input 331 of the workload prediction processor 333 may include one or more of a target performance metric, a previous number of replicas used at a previous time, and a past value of the target performance metric at a previous time. The output 337 of the workload prediction processor 333 may be in the form of an estimate of the number of future requests received at or by a future time. The output 337 may then be used as an input to a control system 338 to determine an output 339 of the control system 338. According to one embodiment, the output 339 is a recommended number of replicas for an application deployed on a worker node (e.g., worker node 113a-n and worker node 123a-n) of a cluster (e.g., cluster 130) to accommodate the workload represented by the estimated future requests.
[0089] According to one embodiment, the control system 338 includes a controller and is part of a feedback control loop. Non-limiting examples of controllers include proportional integral derivative (PID) controllers and proportional integral (PI) controllers. A PI controller is a special case of a PID controller in which the differential (D) of the error is not used. Figure 3B More details are provided regarding feedback control loops that may be used according to embodiments.
[0090] Turning now to the machine learning prediction model 335, in one embodiment, for example, as described above, in order to proactively deploy a sufficient number of replicas to maintain compliance with the SLA, the future workload requirements of the application are predicted in advance. Those skilled in the art will appreciate that many machine learning techniques, including but not limited to support vector regression (SVR) models and deep learning models (e.g., deep neural networks (DNNs)), can be trained to make predictions based on historical observations. Depending on the specific implementation, various classical machine learning techniques may be suitable for use as the machine learning prediction model 335.
[0091] In a serverless framework, since any delay in the prediction phase will affect performance as it adds more delay to the container startup latency, prediction time may be a factor to consider when choosing an appropriate machine learning prediction model. Since empirical data shows that for predicting cloud workloads, the SVR model is the most accurate among machine learning algorithms (partly due to the training and prediction overhead of DNNs), the various examples provided herein are described with reference to the use of the SVR model. According to one embodiment, a radial basis function (RBF) SVR kernel is used to train the machine learning prediction model 335 to predict workload bursts. In alternative embodiments, various other SVR kernels may be used, including but not limited to linear, polynomial, and sigmoid SVR kernels.
[0092] Figure 3B is a block diagram illustrating a feedback control loop 300 according to an embodiment. The feedback control loop 300 represents a non-limiting example of processing that may be performed by the scaling engine 118 in an embodiment supporting a control theory based autoscaler.
[0093] A linear feedback control system typically includes a controller that applies a correction to a controlled variable based on the difference between a desired value (called a setpoint) and a measured value (called a process variable). In the context of this example, feedback control loop 300 includes PI controller 340, serverless framework 342 (which can run within a container orchestration platform), and monitoring process 344.
[0094] According to one embodiment, the PI controller 340 dynamically changes the number 349 of copies of the application based on the target value 341 of the performance metric and the measured value 343 of the performance metric. For example, the PI controller 340 can receive as input the difference or error 345 between the target performance metric 341 and the performance metric 343 measured by the monitoring processor 344. According to one embodiment, the monitoring processor 344 continuously monitors the performance metric 343 during each prediction time window. Although the embodiments described herein consider an example monitoring processor that samples the performance metric of interest once during the time window W, other monitoring rates may also be used. In addition, as described below, the size of the predefined time window can be dynamically increased or decreased depending on various factors (e.g., changes in the workload of the current observation window).
[0095] For purposes of illustration, the various examples described herein will use call rate (e.g., queries per second) as an example of a measurement of workload, and a given percentile response time (e.g., 90th percentile response time) as a target performance metric 343. Notably, as noted above, the methods described herein are not limited to any particular performance metric, but are generally applicable to any desired SLA or QoS metric. Furthermore, the target performance metric may represent a function of a logical condition or a combination of multiple SLA or QoS metrics. Similarly, while for purposes of illustration, examples of the presented methods relate to keeping 90 out of 100 (90%) query response times below a threshold (e.g., specified by an SLA), other ratios / percentages and / or thresholds may be employed and may be initially configured and / or adjusted based on various external or internal sources (e.g., user input, configuration files, SLAs, etc.).
[0096] According to one embodiment, the serverless framework 342 is viewed as a dynamic system controlled by the output of the PI controller 340. For purposes of illustration, an example will now be described where the performance metric 343 output by the dynamic system is the response time (Res(k)) and the number of replicas (R(k)) is the input to the dynamic system. In this example, the goal is to dynamically scale the number of replicas so that a threshold value (e.g., 90%) of the observed response time is maintained at a target value (reference value (Res ref ) or higher than the target value. In other words, the reference value (Res ref ) indicates a value below which the target value observation failed with a given percentage. Continuing with this example, the PI controller 340 may be represented as follows:
[0097] R(k)=R(k-1)+(K p +K I )E(k)-K p E(k-1) Equation #9
[0098] in,
[0099] E(k)=Res ref -Res(k) Equation #10
[0100] And among them,
[0101] k represents the time to calculate the new number of replicas.
[0102] R(x) represents the number of replicas at time x.
[0103] E(x) represents the error in the response time at time x.
[0104] Resref is a response time value below which a given percentage (eg, 10%) of target value observations fail.
[0105] Res(k) is the response time at time k.
[0106] Kp represents the proportional gain and is one of the tuning parameters of the controller.
[0107] KI stands for integral gain, which is another tuning parameter of the controller.
[0108] According to various embodiments, the parameters of the PI controller 340 are tuned to provide stability and avoid jitter associated with the new number of copies output by the PI controller 340. In one embodiment, the tuning method described in JG Ziegler and NB Nichols, "Optimal Settings of Automatic Controllers," trans. ASME, 1942 ("Ziegler-Nichols Method"), which is incorporated herein by reference in its entirety for all purposes, is used to adjust the K in Equation #9 by first replacing I Set to zero, then increment the proportional gain (K p ) until it reaches the response time and starts to oscillate (see, for example, Figure 7 )’s final gain K u , to find P I The tuning parameters of controller 340. Let K u is the gain, T u is the oscillation period. Then, K in equation #9 p Set to K u Fraction (e.g., 0.45K u ), K I Set to K u and T u The fraction of the function (for example, 0.54K u / T u). The new number of copies (R(k)) resulting from this calculation is then rounded to the nearest integer to avoid fractional values. As will be appreciated by those skilled in the art, other tuning methods may be used. For example, as an alternative to the Ziegler-Nichols tuning method, the tuning values may be determined by the TLC tuning rules created by Tyreus and Luyblen.
[0109] Although equations #9 and #10 (above) are expressed with reference to a particular target performance metric (i.e., response time) in order to provide a specific example, those skilled in the art will appreciate that the desired target performance metric may be used to represent the response time (Res(k)) in equation #10, and the reference value of the desired target performance metric may be used to represent the response time reference value (Res(k)) in equation #10. ref ), these equations can be used for any desired target performance metric.
[0110] Although the various parameter tuning and performance metric monitoring examples provided herein are described with reference to a PI controller, because a PI controller is a special case of a PID controller, those skilled in the art will understand that these examples are equally applicable to a PID controller.
[0111] In various examples described herein, each worker node (e.g., worker nodes 113a-n and worker nodes 123a-n) may include or be associated with at least one processing resource (e.g., one or more central processing unit cores, graphics processing units, microcontrollers, microprocessors, application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), etc.), memory resources (e.g., random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), etc.), and storage resources (e.g., storage devices such as hard drives, solid-state drives, flash memory, etc.). The various functional units described herein (e.g., orchestrator 114, resource monitoring engine 115, scheduling engine 116, scaling engine 118, performance monitoring engine 124, packet parsing engine 125, workload predictor 126, workload prediction processor 333, control system 338, PI controller 340, and monitoring processor 344) and the following references Figure 4-Figure 6 and Figure 8-Figure 9 The processes described by the flowcharts of can be implemented in the form of executable instructions stored on a machine-readable medium and executed by a processing resource and / or other type of processing circuitry. For example, some or all aspects of the processes can be performed by one or more virtual or physical computer systems in various forms, such as a host server 110, a hardware accelerator 120, or a processor as described below. Fig.10 Describe the computer system.
[0112] Figure 4 is a flow chart illustrating an active autoscaling process according to an embodiment. In various examples described herein, a server (e.g., host server 110 and / or one or more hardware accelerators 120, individually or in combination) may implement one of three different autoscaling methods (e.g., a queue-based autoscaler, a custom pod scaler, or a control theory-based autoscaler). In the context of this example, a non-limiting example of an active autoscaling method utilizing a control theory-based autoscaler is described.
[0113] At block 410 , a target performance metric (eg, latency) is received for an application running within a serverless framework.
[0114] At block 410, a target performance metric is received for an application running within a serverless framework of a private cloud. According to one embodiment, the target performance metric represents a QoS metric or a specific performance metric (e.g., latency) specified by an SLA. Alternatively, the target performance metric may represent a function of a logical condition or combination of multiple SLAs and / or QoS metrics. For example, a goal of the proactive autoscaling process may be to keep a certain predetermined or configurable threshold number of every 100 measurements of the performance metric in question above or below another predetermined or configurable threshold (e.g., a threshold specified by an SLA), as the case may be.
[0115] At block 420, a machine learning prediction model is trained. According to one embodiment, the RBF SVR kernel is used to train a machine learning prediction model based on time series workload information (e.g., historically observed workload information or past workload information for a time window up to and including the current time). Figure 6 to provide further details about the example training process.
[0116] At block 430, a serverless workload observation for the application is obtained. According to one embodiment, the observation is a measurement obtained by calling an application programming interface (API) exposed by the serverless framework. Figure 3B As described, in one embodiment, as part of a feedback control loop, the monitoring processor continuously monitors the value of the performance metric in question and maintains the measured / observed value within a predefined time window. As further described below, in one embodiment, the size of the predefined time window can be dynamically increased or decreased depending on various factors (e.g., workload changes in the current observation window).
[0117] At block 440, a future serverless workload is predicted for the application in question at a future time. According to one embodiment, the prediction is performed by providing a feature vector in the form of monitored workload information obtained within a predefined time window to a trained machine learning prediction model. In one embodiment, the workload prediction represents a prediction of the number of queries per second (QPS) that the application is expected to receive at a future time as of the current time within the monitoring window. As an alternative to the number of queries per second, other workload characteristics (e.g., CPU / memory / network bandwidth utilization) may be predicted over time. See below for more information. Figure 5 An example of workload prediction processing is further described.
[0118] At box 450, a feedback control system is used to determine a recommended number of replicas. According to one embodiment, the feedback control system receives as input information about an expected future workload for the application during a future time frame, and outputs a number of replicas for the application at a future time based on the future workload prediction, a target value for a particular performance metric, and a current value for the particular performance metric. For example, the feedback control system determines an optimal amount of resources that will enable the application to process multiple transactions, queries, or requests predicted by the machine learning prediction model to be received at a future time, while meeting the application performance goals. The number of replicas can then be calculated based on the determined amount of resources and other factors (e.g., the computing power of the replicas). According to one embodiment, by replacing the response time (Res(k)) in equation #10 with the desired target performance metric, and replacing the reference value for the response time (Res(k)) in equation #10 with the reference value for the desired target performance metric. ref ), Equations #9 and #10 can be used for the desired target performance metric.
[0119] At block 460, the serverless framework is caused to scale the number of replicas supporting the application to the recommended number of replicas determined in block 450. According to one embodiment, a feedback control system may be incorporated into or otherwise directly control (e.g., by being granted appropriate permissions / access) the auto-scaling functionality implemented by the serverless framework.
[0120] Figure 5 is a flowchart illustrating a workload prediction process according to an embodiment. As described above, according to various embodiments, different training and / or prediction methods may be utilized to facilitate prediction of workload bursts. The workload prediction algorithm described in the context of this example represents a workload prediction algorithm that may be implemented by Figure 1 This is a non-limiting example of a process performed by workload predictor 126.
[0121] For the purpose of completeness and not limitation, a pseudo-code example of a workload prediction algorithm (“Algorithm 2”) is referenced below: Figure 5 A more general description is provided afterwards.
[0122] In one embodiment, the workload forecast represents the workload for d units of time in the future at time t during a default window of size W, and the machine learning model is periodically retrained with a new set of workload observations. As will be appreciated by those skilled in the art, the coefficient of determination of the prediction model decreases the more future predictions are attempted. Therefore, by executing the prediction process more frequently, more accurate predictions can be achieved. In one embodiment, the workload prediction process is executed every W seconds, where W can be changed dynamically, as further described below.
[0123] According to one embodiment, the default window size (W) is between about 10 and 90 seconds, and the prediction time interval (d) is between about 1 and 15 seconds. In the context of Algorithm #2 (below), W is 30 seconds and d is 5 seconds. In general, the default window size should be selected to be large enough so that there are enough workload samples for training, but not too large so that it can respond quickly to bursty workloads. The selection of an appropriate default window size (W) and prediction time interval (d) should also consider the container (function) startup time, because starting a new container requires time to initialize the container (e.g., setting up various Linux namespaces for networks, file systems, etc.). For example, if W and d are shorter than starting a new container, the newly started container may not be ready to serve expected future requests in a timely manner. Empirical data shows that the startup time of an ordinary container is approximately between 6 and 7 seconds.
[0124] According to one embodiment, a machine learning prediction model for predicting future workload is based on past observations of workload in a window of size W time units. For example, a workload prediction for a future time t+d can be performed by training an SVR model using observed / monitored workload information during a window of size [tW, t]. The trained SVR model can then be used to perform regression predictions for a future time t+d. In some embodiments, the window size changes dynamically based on workload changes over time. For example, when the workload change in the current window is relatively low (as indicated by a threshold), the training window size can be increased, and once the workload change reaches or exceeds another threshold, the training window size can be reduced.
[0125] According to one embodiment, the workload prediction processor may access a window 510 of time series workload information. For example, the time series workload information (X) may be in the form of an array, a circular buffer, or other suitable data structure, and may include workload observations for each time unit (e.g., one second) taken from time Wt to time t.
[0126] At block 520, a workload variability measure is determined for the current window. According to one embodiment, the workload variation for the current window is a function of the maximum observed workload and the minimum observed workload during the current window. For example, the workload variability measure may be calculated by dividing the difference between the maximum observed workload and the minimum observed workload by the minimum observed workload, as shown below with reference to Algorithm #1.
[0127] At decision block 530, a determination is made as to whether the workload variability measure is greater than or equal to a first threshold. If so, processing branches to block 540; otherwise, processing continues to decision block 550. According to one embodiment, the first threshold is between approximately 0.15 and 0.25 (meaning that the workload varies between approximately 15% and 25%). In the context of Algorithm #2 (below), the first threshold is 0.2.
[0128] At block 540, due to the relatively high degree of workload variation during the current window, the window (W) is reduced to capture fewer workload observations. According to one embodiment, W is reduced by a factor of between approximately 1.5 and 2.5. In the context of Algorithm #2 (below), the factor is 2.
[0129] At decision block 550, a determination is made as to whether the workload variability metric is less than or equal to a second threshold. If so, processing branches to block 560; otherwise, processing continues to decision block 570. According to one embodiment, the second threshold is between approximately 0.5 and 0.15 (meaning that the workload varies between approximately 5% and 15%). In the context of Algorithm #2 (below), the second threshold is 0.1.
[0130] At block 560, due to the relatively low degree of workload variation during the current window, the window (W) is expanded to capture additional workload observations. According to one embodiment, W is increased by a factor of between approximately 1.5 and 2.5. In the context of Algorithm #2 (below), the factor is 2.
[0131] At decision block 570, determine whether the current time is beyond the end of the current window. If so, processing continues to block 580; otherwise, processing branches to block 590.
[0132] At block 580, a machine learning prediction model is trained for the next window. Depending on the particular implementation, the machine learning prediction model may be based on an SVR model or a deep learning model. According to one embodiment, an RBF SVR kernel is used to train the machine learning prediction model. In alternative embodiments, various other SVR kernels may be used, including but not limited to linear, polynomial, and sigmoid SVR kernels. Figure 6 to provide further details about the example training process.
[0133] At block 590, the prediction of the machine learning prediction model is output. According to one embodiment, the prediction represents the predicted future workload at time t+d, where t is the current time. For example, the machine learning prediction model may predict that the application will receive Z QPS at time t+d. For the purpose of completeness and not limitation, a pseudo-code example of an example of a workload prediction algorithm ("Algorithm 2") is presented below:
[0134] Algorithm #2 – Example Workload Prediction Algorithm
[0135] 1. Input: Feature vector: Monitored workload information (X) during a window of size W.
[0136] 2. Output: predicted future workload at time t+d, where t is the current time.
[0137] 3. Set the default window size: W = 30 seconds;
[0138] 4. Save the current time: prev t =t;
[0139] 5.if then
[0140] 6.W = W / 2;
[0141] 7.else if then
[0142] 8.W = 2W;
[0143] 9.if t>prev t +W, then
[0144] 10. SVR-Train(X[tW,t]); -- see for example Algorithm #2 (below)
[0145] 11. output = SVR-Predict(X[t+d]); - see for example Algorithm #1
[0146] 12.prev t =t;
[0147] Figure 6 is a flowchart illustrating a training process according to an embodiment. The training process described in the context of this example represents how a machine learning prediction model (e.g., Figure 3A Machine learning prediction models 335) to facilitate Figure 1 A non-limiting example of workload prediction performed by workload predictor 126 is shown in FIG.
[0148] According to one embodiment, the window 610 of time series workload information represents an input parameter of a machine learning prediction model training process or is otherwise available for a machine learning prediction model training process. As described above, the time series workload information (X) may be in the form of an array, a circular buffer, or other suitable data structure, and may include a workload observation value for each time unit (e.g., one second) taken from time Wt to time t.
[0149] At block 620, the minimum time difference between two consecutive workload rate direction changes from negative to positive or positive to negative is calculated.
[0150] At block 630, training data and corresponding test data are constructed. According to one embodiment, the observed workload (e.g., QPS) in the time interval [tW, t] at time t is used as training data, and the predicted future workload (e.g., QPS) at time t+d is used as test data. For example, the predicted QPS value can be compared with the actual QPS value observed at time t+d. The process can then be repeated in the next time interval of the next window of size W.
[0151] At block 640 , a feature vector is generated based on the training data.
[0152] At block 650, the feature vectors are cleaned. According to one embodiment, unusable data is removed, the feature vectors are normalized, and the feature vectors are made unitless.
[0153] The feature vectors are scaled at block 660. According to one embodiment, the features are scaled to a range of [-1, +1].
[0154] At block 670, a machine learning prediction model is trained based on the feature vector resulting from the dimensionality reduction resulting from performing a principal component analysis (PCA) algorithm. For completeness, a non-limiting pseudo-code example of the SVR training process is given below ("Algorithm #3"): Algorithm #3 - SVR Machine Training Procedure
[0155] 1. Input: time series workload information (X).
[0156] 2. Output: SVR model for predicting future d-second workload at time t during a window of size W.
[0157] 3. Calculate the minimum time difference (min) between two consecutive workload rate changes from negative to positive or vice versa. dist ).
[0158] 4. Construct training data from tW to t and corresponding test data for the next d seconds from t-W+d to t+d.
[0159] 5. Generate feature vectors based on training data, including such training data, their respective W, W / 2, ..., W = W / 2 n Moving average, where n>log2(W=min dist ), and the corresponding ground truth values from the training data.
[0160] 6. Clean the feature vector by normalizing, de-unitizing, and removing unusable data.
[0161] 7. Scale the features to [-1; +1].
[0162] 8. Use PCA for feature reduction.
[0163] 9. Get the support vector regression model: SvrModel = SVR (kernel = 'rbf', gamma = 'auto'). And train the model: SvrModel.fit (X train ,Y train ), where X train is a vector of time values, and the corresponding workload values are stored in the vector Y train middle.
[0164] Figure 7 is a graph showing parameter tuning of a proportional-integral (PI) controller according to an embodiment. In the context of this example, the number of replicas and the response time are represented on the y-axis, and time is represented on the x-axis. As described above, in one embodiment, by first replacing K in Equation #1 with I Set to zero and then increment the proportional gain (K p ), until it reaches a final gain K at which the response time begins to oscillate (e.g., as shown in graph 700). u , to perform tuning of the PI controller 240. At this point, in one embodiment, by substituting K of Equation #1 p Set to K u Fraction (e.g., 0.45K u ) to and K I Set to K u and T u The fraction of the function (for example, 0.54K u / T u ), K u and the oscillation period T u Can be used to determine the new number of replicas (R(k)). In the context of this example, by setting the new number of replicas (R(k)) to 4 as determined by equation #1, a stable response time of 1 unit of time is achieved.
[0165] Figure 8 is a flow chart illustrating custom pod scaling according to an embodiment. In various examples described herein, a server (e.g., host server 110 and / or one or more hardware accelerators 120, individually or in combination) may implement one of three different autoscaling methods (e.g., a queue-based autoscaler, a custom pod scaler, or a control theory-based autoscaler). In the context of this example, non-limiting examples of processes that may be performed by a custom pod scaler that may be implemented by scheduling engine 116 are described.
[0166] At decision block 810, a determination is made as to whether the metric evaluation timer has expired. If so, processing continues to block 820; otherwise, processing loops back to decision block 810. According to one embodiment, a backoff timer may be used to control the intervals at which various metrics are evaluated. The backoff timer may be set as needed by the system. As a non-limiting example, the dynamic behavior of the workload may be used to set the backoff timer. For example, if a number of queries per second changes by a predetermined or configurable percentage (e.g., 20%) within a time frame of W seconds, this may be represented as Then the backoff timer can be set to W.
[0167] At block 820, various metrics may be calculated / derived based on a set of available metrics, and corresponding SLA thresholds may be obtained. Non-limiting examples of calculated / derived metrics and a specific set of available metrics are described below. In one embodiment, the corresponding SLA thresholds may be determined empirically.
[0168] At decision block 830 , a determination is made as to whether the first metric (metric 1) is greater than the corresponding SLA threshold. If so, processing branches to block 860 ; otherwise, processing continues to decision block 840 .
[0169] At decision block 840 , a determination is made as to whether the second metric (metric 2) is greater than the corresponding SLA threshold. If so, processing branches to block 860 ; otherwise, processing continues to decision block 850 .
[0170] At decision block 850 , it is determined whether the nth metric (metric n) is greater than the corresponding SLA threshold. If so, processing branches to block 860 ; otherwise, processing loops back to decision block 810 .
[0171] At block 860, the number of pods is scaled by a scaling factor. According to one embodiment, the scaling factor Δ is calculated as follows:
[0172]
[0173] According to one embodiment, a set of available metrics includes:
[0174] •gateway_functions_seconds, which indicates how many seconds each API gateway function call takes to run in an observation window of size Tr.
[0175] •gateway_function_invocation_total, which represents the count of the total number of API Gateway function invocations during the window period.
[0176] •gateway_service_count, which indicates the number of replicas (e.g., pods) of a specific function.
[0177] • http_request_duration_second, which indicates the number of seconds each HTTP request runs during the window period; and
[0178] •http_requests_total, which represents a count of the total number of HTTP requests received during the window period.
[0179] In one embodiment, the calculated / derived metrics include:
[0180]
[0181]
[0182]
[0183] The first calculated / derived metric (θ c ) represents how many seconds each function call takes to run in an observation window of size Tr. The second calculated / derived metric (Ω c ) is calculated by dividing the function call count by the number of function replicas, indicating how many function calls each replica will handle on average. The third calculated / derived metric (ψ c ) represents the average time taken to serve each HTTP request.
[0184] Fig. 9 is a flow chart showing query processing according to an embodiment. In various examples described herein, the novel architecture promotes the performance of edge acceleration by leveraging the fault tolerance and resource efficiency of a serverless computing platform. For example, a heterogeneous cluster (e.g., cluster 130) can be distributed across one or more host servers (e.g., host server 110) and one or more hardware accelerators (e.g., hardware accelerator 120) of (multiple) host servers, thereby allowing serverless functions to be offloaded from (multiple) host servers to (multiple) hardware accelerators. This example provides an example of query processing in such an environment.
[0185] In box 910, a query is received at a cluster (e.g., cluster 130) of a container orchestration platform. The query can initially be received at an API gateway (e.g., API gateway 140) that serves as an entry point to the cluster. In one embodiment, the cluster is a heterogeneous cluster of a serverless framework and further includes a host system and a hardware accelerator for the host system, wherein the host system and the hardware accelerator have different computing capabilities. The query can be an HTTP request received from a client accessing a serverless workload function implemented within the cluster. Contrary to traditional architectures in which a host server and its hardware accelerator are collectively considered a single worker machine of the cluster, in various embodiments, the host server and the hardware accelerator can each independently represent a separate worker machine or node of the cluster 130.
[0186] At block 920, queries are distributed among worker machines of the cluster based on a queuing model that takes into account the respective computing capabilities of the worker machines. For example, a traffic distributor (e.g., traffic distributor 141) can solve a queuing problem that represents how to distribute received client queries among worker machines for one or more cases including a deterministic queuing model (e.g., a D / D / 1 queue) and an M / M / 1 queuing model according to equations #1-#3 above.
[0187] In block 930, in response to the host system or the hardware accelerator receiving the query, the query is directed to the master node of the cluster or one of the plurality of worker nodes according to the traffic distribution determined at the API gateway. Depending on the particular implementation, a subset or all of the worker nodes of the cluster may be hosted by one or more hardware accelerators of the host system, thereby supporting partial or full offloading of application instances running on the worker nodes to one or more hardware accelerators. As described above, various scaling methods, including automatic scaling and custom pod scaling, may also be supported in the context of the novel system architecture.
[0188] The embodiments described herein include various steps, examples of which have been described above. As further described below, these steps may be performed by hardware components, or may be contained in machine executable instructions, which may be used to cause a general or special purpose processor programmed with the instructions to perform these steps. Alternatively, at least some of the steps may be performed by a combination of hardware, software, and / or firmware.
[0189] The embodiments described herein may be provided as a computer program product that may include a machine-readable storage medium having instructions tangibly embodied thereon that may be used to program a computer (or other electronic device) to perform a process. The machine-readable medium may include, but is not limited to, a fixed (hard) drive, a magnetic tape, a floppy disk, an optical disk, a compact disk read-only memory (CD-ROM) and a magneto-optical disk, a semiconductor memory (such as a ROM, a PROM, a random access memory (RAM), a programmable read-only memory (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM)), a flash memory, a magnetic or optical card, or other types of media / machine-readable media suitable for storing electronic instructions (e.g., computer programming code, such as software or firmware).
[0190] The various methods described herein may be implemented by combining one or more machine-readable storage media containing code according to the example embodiments described herein with appropriate standard computer hardware to execute the code contained therein. The apparatus for practicing the various exemplary embodiments described herein may involve one or more computing elements or computers (or one or more processors within a single computer) and a storage system containing or having network access to the computer program(s) encoded according to the various methods described herein, and the method steps of the various exemplary embodiments described herein may be performed by modules, routines, subroutines or sub-parts of a computer program product.
[0191] Fig.10 is a block diagram of a computer system according to an embodiment. Fig.10 In the example shown, the computer system 1000 includes a processing resource 1010 coupled to a non-transitory machine-readable medium 1020, which is encoded with instructions to perform the active automatic scaling method according to the private cloud embodiment. The processing resource 1010 may include a microcontroller, a microprocessor, (multiple) central processing unit cores, ASICs, FPGAs, and / or other hardware devices suitable for retrieving and / or executing instructions from the machine-readable medium 1020 to perform functions related to the various examples described herein. Additionally or alternatively, the processing resource 1010 may include electronic circuits for performing the functions of the instructions described herein.
[0192] The machine-readable medium 1020 may be any medium suitable for storing executable instructions. Non-limiting examples of the machine-readable medium 1020 include RAM, ROM, EEPROM, flash memory, hard disk drives, optical disks, etc. The machine-readable medium 1020 may be disposed within the computer system 1000, such as Fig.10As shown, in this case, the executable instructions can be considered to be "installed" or "embedded" on the computer system 1000. Alternatively, the machine-readable medium 1020 can be a portable (e.g., external) storage medium and can be part of an "installation package." The instructions stored on the machine-readable medium 1020 can be used to implement at least a portion of the methods described herein.
[0193] In the context of this example, machine-readable medium 1020 is encoded with a set of executable instructions 1030-1050. It is to be understood that some or all of the executable instructions and / or electronic circuitry included in one block may be included in different blocks shown or not shown in the figures in alternative implementations.
[0194] When executed, instruction 1030 causes processing resource 1010 to receive a query at a cluster of a container orchestration platform, the cluster comprising a host system and a hardware accelerator of the host system, each representing an independent worker machine of the cluster. In one embodiment, instruction 1030 may be used to execute Fig. 9 Frame 910.
[0195] When executed, instruction 1040 causes processing resource 1010 to distribute queries among worker machines in the cluster based on a queuing model that takes into account the computing capabilities of each worker machine. In one embodiment, instruction 1040 may be used to execute Fig. 9 Frame 920.
[0196] When executed, instruction 1050 causes processing resource 1010 to direct the query to the master node of the cluster or one of the multiple worker nodes in response to the host system or hardware accelerator receiving the query. In one embodiment, instruction 1040 may be used to execute Fig. 9 Frame 920.
[0197] In the foregoing description, many details are set forth to provide an understanding of the subject matter disclosed herein. However, it is possible to implement without some or all of these details. Other embodiments may include modifications and variations to the above details. The appended claims are intended to cover these modifications and variations.
Claims
1. A method for query processing, comprising: Receiving a query at a cluster of a container orchestration platform, wherein the cluster includes a host system and a hardware accelerator of the host system, each of the host system and the hardware accelerator functioning as an independent worker machine of the cluster, wherein the cluster further includes a master node and a plurality of worker nodes, wherein the master node executes on a first processing resource of the host system or a second processing resource of the hardware accelerator, and wherein a first worker node of the plurality of worker nodes executes and runs a first instance of an application on the second processing resource; Distributing queries among the worker machines based on a queuing model that takes into account the respective computing capabilities of the worker machines; and In response to the host system or the hardware accelerator receiving the query, the query is directed to the master node or one of the plurality of worker nodes according to the distribution.
2. The method according to claim 1, wherein: The hardware accelerator includes a smart network interface card (SmartNIC) based on a system on a chip (SOC), and wherein the direction of the query is performed by the SmartNIC.
3. The method according to claim 1, wherein: The applications include key-value stores or analytical applications.
4. The method according to claim 1, wherein: The container orchestration platform includes a lightweight distribution of Kubernetes.
5. The method according to claim 1, further comprising: monitoring a number of queries received and processed by the application; Maintaining historical data about the number of queries over a period of time; predicting future workloads of the applications; as well as The predicted future workload is adapted by scaling the number of instances of the application on the first of the plurality of worker nodes executing on the second processing resource or on the second of the plurality of worker nodes executing on the first processing resource.
6. The method according to claim 5, wherein: The adaptation also includes: periodically measuring a plurality of metrics for each instance of the application in the cluster; and In response to any metric of the plurality of metrics exceeding a corresponding performance metric, the number of instances of the application is scaled by a scaling factor.
7. A non-transitory machine-readable medium storing instructions that, when executed by a plurality of processing resources of a system comprising a host system and one or more hardware accelerators of the host system, cause the system to: The query is received at an application programming interface API gateway of a cluster of the container orchestration platform, wherein: The cluster includes the host system and the one or more hardware accelerators, and each of the host system and the one or more hardware accelerators acts as an independent worker machine of the cluster, wherein the cluster further includes a master node and a plurality of worker nodes, wherein the master node executes on a first processing resource of the host system or a second processing resource of the one or more hardware accelerators, and wherein a first worker node of the plurality of worker nodes executes and runs a first instance of an application on the second processing resource; Determining, by the API gateway, distribution of the query between the host system and the one or more hardware accelerators based on a queuing model that takes into account respective computing capabilities of the host system and the one or more hardware accelerators; and In response to the host system or the one or more hardware accelerators receiving the query, the query is directed to the master node or one of the plurality of worker nodes based on the distribution.
8. The non-transitory machine-readable medium of claim 7, wherein: A hardware accelerator of the one or more hardware accelerators includes a smart network interface card (SmartNIC) based on a system on a chip (SOC), and wherein the directing of the query is performed by the SmartNIC.
9. The non-transitory machine-readable medium of claim 7, wherein: The application includes a key-value store.
10. The non-transitory machine-readable medium of claim 7, wherein: The applications include analytical applications.
11. The non-transitory machine-readable medium of claim 7, wherein: The container orchestration platform includes a lightweight distribution of Kubernetes.
12. The non-transitory machine-readable medium of claim 7, wherein: Execution of the instructions further causes the system to: monitoring a number of queries received and processed by the application; Maintaining historical data about the number of queries over a period of time; predicting future workloads of the applications; as well as The predicted future workload is accommodated by scaling the number of instances of the application on the first worker node or the second worker node of the plurality of worker nodes executing on the plurality of processing resources.
13. The non-transitory machine-readable medium of claim 7, wherein execution of the instructions further causes the system to: periodically measuring a plurality of metrics for each instance of the application in the cluster; and In response to any metric of the plurality of metrics exceeding a corresponding performance metric, the number of instances of the application is scaled by a scaling factor.
14. A system for query processing, comprising: Multiple processing resources are associated with worker machines in a cluster of container orchestration platforms; as well as a non-transitory computer-readable medium coupled to the plurality of processing resources, storing therein instructions that, when executed by the plurality of processing resources, cause the system to: Receiving a query at an application programming interface API gateway of the cluster, wherein the worker machine comprises a host system and a plurality of hardware accelerators, wherein the cluster comprises a master node and a plurality of worker nodes, wherein the master node executes on a specific hardware accelerator of the host system or the plurality of hardware accelerators, and wherein a first worker node of the plurality of worker nodes executes and runs a first instance of an application on the specific hardware accelerator; Determining, by the API gateway, distribution of the query between the host system and the plurality of hardware accelerators based on a queuing model that takes into account respective computing capabilities of the host system and the plurality of hardware accelerators; and In response to the host system or the specific hardware accelerator receiving the query, the query is directed to the master node or one of the plurality of worker nodes based on the distribution.
15. The system of claim 14, wherein: The specific hardware accelerator includes a smart network interface card (SmartNIC) based on a system on a chip (SOC), and wherein the direction of the query is performed by the SmartNIC.
16. The system of claim 14, wherein: The application includes a key-value store.
17. The system of claim 14, wherein: The applications include analytical applications.
18. The system of claim 14, wherein: The container orchestration platform includes a lightweight distribution of Kubernetes.
19. The system of claim 14, wherein: Execution of the instructions further causes the system to: monitoring a number of queries received and processed by the application; Maintaining historical data about the number of queries over a period of time; predicting future workloads of the applications; as well as The predicted future workload is accommodated by scaling the number of instances of the application on the first worker node or the second worker node of the plurality of worker nodes executing on the plurality of processing resources.
20. The system of claim 19, wherein: Execution of the instructions further causes the system to: periodically measuring a plurality of metrics for each instance of the application in the cluster; as well as In response to any metric of the plurality of metrics exceeding a corresponding performance metric, the number of instances of the application is scaled by a scaling factor.
Citation Information
Patent Citations
Hardware accelerators and methods for offload operations
CN109690475A
Computing resource allocation method and device based on hybrid distribution architecture and storage medium
CN110704186A
Scheduling applications in a clustered computer system
US20160004567A1
An FPGA-as-a-service system for accelerated serverless computing
WO2020234792A1
