Function parallelism in a runtime container of a function-as-a-service (faas) system
Abstract
A method includes generating a runtime container to execute a first instance of a function, the runtime container comprising a set of resources allocated to execute the function. A consumption of the set of resources by the first instance of the function is determined. In response to receiving a second request to execute a second instance of the function, it is determined whether the runtime container can execute an additional instance of the function based on the consumption of the set of resources by the first instance of the function. In response to determining that the runtime container can execute an additional instance of the function, the second instance of the function is initiated within the runtime container, wherein the first instance of the function and the second instance of the function execute at least partially concurrently within the runtime container.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A method comprising:
generating a runtime container to execute a first instance of a function, the runtime container comprising a set of resources allocated to execute the function; determining, by a processing device, a consumption of the set of resources by the first instance of the function; and in response to receiving a second request to execute a second instance of the function:
determining whether the runtime container can execute an additional instance of the function based on the consumption of the set of resources by the first instance of the function; and
in response to determining that the runtime container can execute an additional instance of the function, initiating the second instance of the function within the runtime container, wherein the first instance of the function and the second instance of the function execute at least partially concurrently within the runtime container.
2 . The method of claim 1 , wherein the first instance of the function is isolated in memory from the second instance of the function to prevent the first instance of the function from interfering with execution of the second instance of the function.
3 . The method of claim 1 , wherein generating the runtime container comprises:
allocating the set of resources to the runtime container based on the first instance of the function, wherein the first instance of the function defines the set of resources; and instantiating the runtime container based on the allocated set of resources.
4 . The method of claim 1 , wherein determining the consumption of the set of resources by the first instance of the function comprises:
determining a first consumption of the set of resources by the runtime container; determining a second consumption of the set of resources by the runtime container and the first instance of the function during execution of the first instance of the function; and determining the resource consumption of the first instance of the function as a difference between the first consumption of the set of resources and the second consumption of the set of resources.
5 . The method of claim 1 , wherein determining whether the runtime container can execute an additional instance of the function comprises:
determining, based on the set of resources allocated to the runtime container and the consumption of the set of resources by the first instance of the function, that the set of resources allocated to the runtime container are sufficient to support execution of the second instance of the function and the first instance of the function concurrently.
6 . The method of claim 1 , wherein the set of resources comprise a set number of processing cycles, a set amount of memory, and a set amount of networking capabilities.
7 . The method of claim 1 , wherein the first instance of the function and the second instance of the function are each executed as a Java thread.
8 . A system comprising:
a memory; and a processing device operatively coupled to the memory, the processing device to:
generate a runtime container to execute a first instance of a function, the runtime container comprising a set of resources allocated to execute the function;
determine a consumption of the set of resources by the first instance of the function;
and
in response to receiving a second request to execute a second instance of the function:
determining whether the runtime container can execute an additional instance of the function based on the consumption of the set of resources by the first instance of the function; and
in response to determining that the runtime container can execute an additional instance of the function, initiating the second instance of the function within the runtime container, wherein the first instance of the function and the second instance of the function execute at least partially concurrently within the runtime container.
9 . The system of claim 8 , wherein the first instance of the function is isolated in memory from the second instance of the function to prevent the first instance of the function from interfering with execution of the second instance of the function.
10 . The system of claim 8 , wherein to generate the runtime container, the processing device is to:
allocate the set of resources to the runtime container based on the first instance of the function, wherein the first instance of the function defines the set of resources; and instantiate the runtime container based on the allocated set of resources.
11 . The system of claim 8 , wherein to determine the consumption of the set of resources by the first instance of the function, the processing device is to:
determine a first consumption of the set of resources by the runtime container; determine a second consumption of the set of resources by the runtime container and the first instance of the function during execution of the first instance of the function; and determine the resource consumption of the first instance of the function as a difference between the first consumption of the set of resources and the second consumption of the set of resources.
12 . The system of claim 8 , wherein to determine whether the runtime container can execute an additional instance of the function, the processing device is to:
determine, based on the set of resources allocated to the runtime container and the consumption of the set of resources by the first instance of the function, that the set of resources allocated to the runtime container are sufficient to support execution of the second instance of the function and the first instance of the function concurrently.
13 . The system of claim 8 , wherein the set of resources comprise a set number of processing cycles, a set amount of memory, and a set amount of networking capabilities.
14 . The system of claim 8 , wherein the processing device executes each of the first instance of the function and the second instance of the function as a Java thread.
15 . A non-transitory computer-readable medium having instructions stored thereon which, when executed by a processing device, cause the processing device to:
generate a runtime container to execute a first instance of a function, the runtime container comprising a set of resources allocated to execute the function; determine a consumption of the set of resources by the first instance of the function; and in response to receiving a second request to execute a second instance of the function:
determining whether the runtime container can execute an additional instance of the function based on the consumption of the set of resources by the first instance of the function;
and
in response to determining that the runtime container can execute an additional instance of the function, initiating the second instance of the function within the runtime container, wherein the first instance of the function and the second instance of the function execute at least partially concurrently within the runtime container.
16 . The non-transitory computer-readable medium of claim 15 , wherein the first instance of the function is isolated in memory from the second instance of the function to prevent the first instance of the function from interfering with execution of the second instance of the function.
17 . The non-transitory computer-readable medium of claim 15 , wherein to generate the runtime container, the processing device is to:
allocate the set of resources to the runtime container based on the first instance of the function, wherein the first instance of the function defines the set of resources; and instantiate the runtime container based on the allocated set of resources.
18 . The non-transitory computer-readable medium of claim 15 , wherein to determine the consumption of the set of resources by the first instance of the function, the processing device is to:
determine a first consumption of the set of resources by the runtime container; determine a second consumption of the set of resources by the runtime container and the first instance of the function during execution of the first instance of the function; and determine the resource consumption of the first instance of the function as a difference between the first consumption of the set of resources and the second consumption of the set of resources.
19 . The non-transitory computer-readable medium of claim 15 , wherein to determine whether the runtime container can execute an additional instance of the function, the processing device is to:
determine, based on the set of resources allocated to the runtime container and the consumption of the set of resources by the first instance of the function, that the set of resources allocated to the runtime container are sufficient to support execution of the second instance of the function and the first instance of the function concurrently.
20 . The non-transitory computer-readable medium of claim 15 , wherein the processing device executes each of the first instance of the function and the second instance of the function as a Java thread.Join the waitlist — get patent alerts
Track US2022350668A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.