Function Instance Launch Using Memory Snapshots for Faster Cold Starts
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Function as a service (FaaS) systems experience significant cold start latency due to the time required to create and execute a microVM, which includes operations such as copying container images, setting up the environment, and loading function files, leading to increased latency in function execution.
Innovation Solution
Parallelize the execution of operations by accessing a memory snapshot and primary code segments of a previous function instance to launch a new function instance, reducing the need to create a new microVM from a full function code package, thereby accelerating the cold start process.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If a new microVM is created from scratch for each function execution, then the function execution environment is fully initialized and reliable, but cold start latency increases significantly
Solution Approach 1:
The system performs preliminary actions by creating and initializing microVMs in advance during warm periods, storing them as pre-warmed images. When a cold start is needed, the system retrieves these pre-initialized images instead of creating microVMs from scratch, thereby reducing cold start latency while maintaining execution reliability.
Solution Approach 2:
The system creates copies of pre-initialized microVM images and stores them in a registry for rapid retrieval. Instead of recreating the entire microVM environment during cold start, the system copies pre-warmed images from storage, significantly reducing the time required to initialize the execution environment while preserving full functionality.
2Reliability
If the complete function code package is loaded into memory during startup, then all necessary code is available for execution, but the startup time increases due to the large data volume
Solution Approach 1:
The function code package is segmented into critical essential code segments that must be loaded immediately and non-critical segments that can be loaded later. During cold start, only the essential segments are loaded into memory to enable immediate execution, while other segments are loaded on-demand during runtime, reducing initial startup time while ensuring all code is eventually available.
Data Source
AI summary
Examples described herein relate to launching a function instance based on data related to a previously launched instance of the function and prior to receipt of a portion of the data. In some examples, the memory snapshot is taken during launch of the previously launched instance of the function. In some examples, the first code segments are loaded into memory of a runtime environment during the launch of the previously launched instance of the function in a life cycle execution of the previously launched instance of the function.


