Faast: An Efficient Serverless Framework Made Snapshot-based Function Response Fast
Yongshu Bai, Zhihui Yang, Feng Gao · 2024
Recent years have seen the rapid popularity of serverless computing, benefiting from its seamless scalability and pay-as-you-go charging model. Despite recent efforts to enhance function cold-start performance by utilizing snapshot and working set mechanisms, the existing methods still suffered considerable overheads in end-to-end response time as functions' inputs varied. In this paper, we propose Faast, a novel solution designed to improve function response time by enhancing virtual machine snapshot-based startup while guaranteeing function execution performance. Our system introduces a preparation phase to generate a lightweight working set, which excludes stale pages that do not require loading from snapshot files for each function to expedite startup. Additionally, Faast facilitates network connectivity for the snapshot by implementing NAT within the virtio-net device model bypassing the time-consuming network namespace setup. To guarantee execution performance, a divergent page fault handling mechanism is designed to address page faults related to stale and non-stale pages separately, effectively mitigating sluggish disk I/O accesses. Faast also incrementally adapts the working set file across various function invocations to bolster functions' resilience to diverse inputs. Extensive experiments demonstrate that Faast reduces function end-to-end time by up to 63% compared to the state-of-the-art.