AWS Lambda is a serverless event-driven compute service, part of a category of cloud compute offerings sometimes called Function-as-a-service (FaaS). When we first released AWS Lambda, functions were limited to 250MB of code and dependencies, packaged as a simple compressed archive. In 2020, we released support for deploying container images as large as 10GiB as Lambda functions, allowing customers to bring much larger code bases and sets of dependencies to Lambda. Supporting larger packages, while still meeting Lambda's goals of rapid scale (adding up to 15,000 new containers per second for a single customer, and much more in aggregate), high request rate (millions of requests per second), high scale (millions of unique workloads), and low start-up times (as low as 50ms) presented a significant challenge. We describe the storage and caching system we built, optimized for delivering container images on-demand, and our experiences designing, building, and operating it at scale. We focus on challenges around security, efficiency, latency, and cost, and how we addressed these challenges in a system that combines caching, deduplication, convergent encryption, erasure coding, and block-level demand loading. Since building this system, it has reliably processed hundreds of trillions of Lambda invocations for over a million AWS customers, and has shown excellent resilience to load and infrastructure failures.
翻译:AWS Lambda是一种无服务器事件驱动计算服务,属于云计算产品中"函数即服务"(FaaS)类别的一部分。最初发布AWS Lambda时,函数仅支持250MB的代码与依赖包,以简单压缩归档形式封装。2020年,我们推出了对最大10GiB容器镜像作为Lambda函数部署的支持,使客户能够将更大规模的代码库和依赖集引入Lambda。在支持更大软件包的同时,仍需满足Lambda的快速扩展(单个客户每秒新增多达15,000个容器,聚合吞吐量更高)、高请求率(每秒数百万次请求)、大规模并发(数百万独立工作负载)以及低启动延迟(最低50毫秒)等目标,这带来了巨大挑战。本文阐述了为优化容器镜像按需交付而构建的存储与缓存系统,及其从设计、构建到大规模运维的实践经验。我们重点探讨了安全性、效率、延迟与成本方面的挑战,以及如何通过融合缓存、去重、收敛加密、纠删码和块级按需加载的系统方案应对这些挑战。自该系统上线以来,已为超过一百万个AWS客户可靠处理了数万亿次Lambda调用,展现出对负载波动和基础设施故障的卓越韧性。