# US 2021/0334107 A1 · PREDICTING EXECUTION DURATION FOR USER-DEFINED FUNCTIONS ON FUNCTION-AS-A-SERVICE (FaaS) CLOUD COMPUTING PLATFORMS

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0334107 A1
- Document ID: US20210334107A1
- Status: Published application
- Kind: A1
- Application number: 16/857,530
- Filed: 2020-04-24
- Published: 2021-10-28
- Earliest claimed: 2020-04-24
- Assignees: Red Hat, Inc.
- Applicants: Red Hat, Inc.
- Inventors: Aviel Yosef; Boaz Shuster
- Web page: https://patentgrep.com/patent/US20210334107A1

## CPC

- G06F 9/445: Program loading or initiating (bootstrapping G06F9/4401; security arrangements for program loading or initiating G06F21/57)
- G06F 9/542: {Event management; Broadcasting; Multicasting; Notifications}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Predicting execution duration for user-defined functions on function-as-a-service (FaaS) cloud computing platforms is disclosed herein. In one example, a processor device of an FaaS cloud computing platform detects an event that triggers execution of a user-defined function, and automatically fetches an environmental metric that represents a current attribute or condition of the operating environment in which the user-defined function will execute. The processor device then calculates a predicted execution duration for the user-defined function based on the environmental metric, and compares the predicted execution duration to an execution duration threshold. If the predicted execution duration exceeds the execution duration threshold, the processor device prevents execution of the user-defined function by the FaaS cloud computing platform. If the predicted execution duration does not exceed the execution duration threshold, the processor device may initiate execution of the user-defined function. In this manner, the FaaS cloud computing platform's computing resources may be conserved.

## Claims

### Claim 1

A method, comprising:
detecting, by a processor device of a function-as-a-service (FaaS) cloud computing platform, a first event triggering execution of a user-defined function;
automatically fetching, by the processor device, a first environmental metric;
calculating, based on the first environmental metric, a first predicted execution duration for the user-defined function;
determining that the first predicted execution duration for the user-defined function exceeds an execution duration threshold; and
responsive to determining that the first predicted execution duration for the user-defined function exceeds the execution duration threshold, preventing execution of the user-defined function by the FaaS cloud computing platform.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
detecting, by the processor device, a second event triggering execution of the user-defined function;
automatically fetching, by the processor device, a second environmental metric;
calculating, based on the second environmental metric, a second predicted execution duration for the user-defined function;
determining that the second predicted execution duration for the user-defined function does not exceed the execution duration threshold; and
responsive to determining that the second predicted execution duration for the user-defined function does not exceed the execution duration threshold, initiating execution of the user-defined function by the FaaS cloud computing platform.

### Claim 3 (depends on 1)

The method of claim 1, further comprising receiving, by the processor device, a service access attribute corresponding to a monitoring service providing the first environmental metric.

### Claim 4 (depends on 3)

The method of claim 3, wherein the monitoring service comprises an application programming interface (API) provided by the FaaS cloud computing platform.

### Claim 5 (depends on 3)

The method of claim 3, wherein the service access attribute comprises one of a Uniform Resource Locator (URL), authentication information, and an access parameter.

### Claim 6 (depends on 5)

The method of claim 5, wherein the access parameter comprises a metric identifier corresponding to the first environmental metric.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
receiving, by the processor device, an execution duration calculation algorithm;
wherein calculating the first predicted execution duration for the user-defined function comprises executing the execution duration calculation algorithm using the first environmental metric.

### Claim 8 (depends on 1)

The method of claim 1, wherein the first environmental metric comprises one of a currently available network bandwidth, a current network latency, a current availability of a data source for the user-defined function, a current processor load level for the FaaS cloud computing platform, and a currently available memory level for the FaaS cloud computing platform.

### Claim 9 (depends on 1)

The method of claim 1, wherein the execution duration threshold comprises a timeout interval specified by the FaaS cloud computing platform.

### Claim 10 (depends on 1)

The method of claim 1, wherein the FaaS cloud computing platform comprises one of Amazon Web Services (AWS) Lambda, Google Cloud Functions, IBM Cloud Functions, and Microsoft Azure.

### Claim 11

A computing device of a function-as-a-service (FaaS) cloud computing platform, comprising a memory and a processor device coupled to the memory, the processor device to:
detect a first event triggering execution of a user-defined function;
automatically fetch a first environmental metric;
calculate, based on the first environmental metric, a first predicted execution duration for the user-defined function;
determine that the first predicted execution duration for the user-defined function exceeds an execution duration threshold; and
responsive to determining that the first predicted execution duration for the user-defined function exceeds the execution duration threshold, prevent execution of the user-defined function by the FaaS cloud computing platform.

### Claim 12 (depends on 11)

The computing device of claim 11, wherein the processor device is further to:
detect a second event triggering execution of the user-defined function;
automatically fetch a second environmental metric;
calculate, based on the second environmental metric, a second predicted execution duration for the user-defined function;
determine that the second predicted execution duration for the user-defined function does not exceed the execution duration threshold; and
responsive to determining that the second predicted execution duration for the user-defined function does not exceed the execution duration threshold, initiate execution of the user-defined function by the FaaS cloud computing platform.

### Claim 13 (depends on 11)

The computing device of claim 11, wherein the processor device is further to receive a service access attribute corresponding to a monitoring service providing the first environmental metric.

### Claim 14 (depends on 13)

The computing device of claim 13, wherein the monitoring service comprises an application programming interface (API) provided by the FaaS cloud computing platform.

### Claim 15 (depends on 13)

The computing device of claim 13, wherein the service access attribute comprises one of a Uniform Resource Locator (URL), authentication information, and an access parameter.

### Claim 16 (depends on 15)

The computing device of claim 15, wherein the access parameter comprises a metric identifier corresponding to the first environmental metric.

### Claim 17 (depends on 11)

The computing device of claim 11, wherein the processor device is further to:
receive, by the processor device, an execution duration calculation algorithm;
wherein to calculate the first predicted execution duration for the user-defined function is to execute the execution duration calculation algorithm using the first environmental metric.

### Claim 18 (depends on 11)

The computing device of claim 11, wherein the first environmental metric comprises one of a currently available network bandwidth, a current network latency, a current availability of a data source for the user-defined function, a current processor load level for the FaaS cloud computing platform, and a currently available memory level for the FaaS cloud computing platform.

### Claim 19 (depends on 11)

The computing device of claim 11, wherein the execution duration threshold comprises a timeout interval specified by the FaaS cloud computing platform.

### Claim 20

A computer program product stored on a non-transitory computer-readable storage medium and including computer-executable instructions to cause a processor device of a function-as-a-service (FaaS) cloud computing platform to:
detect an event triggering execution of a user-defined function;
automatically fetch an environmental metric;
calculate, based on the environmental metric, a predicted execution duration for the user-defined function;
determine that the predicted execution duration for the user-defined function exceeds an execution duration threshold; and
responsive to determining that the predicted execution duration for the user-defined function exceeds the execution duration threshold, prevent execution of the user-defined function by the FaaS cloud computing platform.
