Speeding up FaaS Warm Starts with Memory Restoration Templates
Abstract
Function-as-a-Service (FaaS) is a cloud-native model where small pieces of application logic execute as isolated functions within virtual machines (VMs). Cloud Service Providers (CSPs) aim to maximize the number of VMs per system. However, idle VMs, i.e., VMs without active functions, continue to consume memory, limiting overall VM density. Rather than using prior disk-based snapshotting solutions to reduce memory usage, we propose to place the pages of an idle VM in a compressed memory pool. Doing so, however, incurs high execution latency upon new invocations due to page decompression during on-demand page faults. To address this, we propose MRT. MRT generates memory restoration templates from the learned sequence of pages that incur page faults during a warm start and uses them to bulk-restore pages using Intel's In-Memory Analytics Accelerator (IAA), avoiding costly on-demand faults. MRT lowers single-instance function execution latency from 2.63× to 1.62× relative to a hot start, eliminating 62% of the overhead that on-demand page-fault-based restoration adds over a hot start. MRT further reduces the memory footprint of an idle FaaS VM instance by 57% (geometric mean) by placing its pages in the compressed memory pool, allowing CSPs to host more active VMs per system. At scale, MRT reduces 95th- and 99th-percentile function execution latency by 70% and 58%, respectively, relative to on-demand IAA decompression.