In Function-as-a-Service (FaaS) serverless, large applications are split into short-lived stateless functions. Deploying functions is mutually profitable: users need not be concerned with resource management, while providers can keep their servers at high utilization rates running thousands of functions concurrently on a single machine. It is exactly this high concurrency that comes at a cost. The standard Linux Completely Fair Scheduler (CFS) switches often between tasks, which leads to prolonged execution times. We present evidence that relying on the default Linux CFS scheduler increases serverless workloads cost by up to 10X. In this article, we raise awareness and make a case for rethinking the OS-level scheduling in Linux for serverless workloads composed of many short-lived processes. To make serverless more affordable we introduce a hybrid two-level scheduling approach that relies on FaaS characteristics. Short-running functions are executed in FIFO fashion without preemption, while longer-running functions are passed to CFS after a certain time period. We show that tailor-made OS scheduling is able to significantly reduce user-facing costs without adding any provider-facing overhead.
翻译:在函数即服务(FaaS)无服务器架构中,大型应用被拆分为短时无状态函数。函数部署对双方皆有利:用户无需关注资源管理,而提供商可通过单台机器并发运行数千个函数保持服务器高利用率。正是这种高并发性带来了成本问题。标准Linux完全公平调度器(CFS)频繁切换任务,导致执行时间延长。我们提供的证据表明,依赖默认Linux CFS调度器会使无服务器工作负载成本最高增加10倍。本文旨在提高业界认知,论证有必要针对由大量短生命周期进程构成的无服务器工作负载,重新思考Linux操作系统级调度机制。为降低无服务器计算成本,我们提出一种基于FaaS特性的混合双层调度方法:短时运行函数以先进先出(FIFO)方式非抢占式执行,而长时运行函数在特定时段后移交CFS处理。研究表明,定制化的操作系统调度能显著降低用户端成本,且不会增加提供商端开销。