Serverless functions run differently on various CPUs affecting cost and speed

Same Function, Different CPU: Quantifying Hardware Heterogeneity in Commercial FaaS Platforms

Distributed, Parallel, and Cluster Computing

Summary

Cloud platforms run the same serverless functions on different types of CPUs without telling users, causing big differences in how fast and cheaply these functions run. The authors measured how much this hidden hardware variety affects performance on major providers like AWS and Google Cloud. They found that on some platforms, the CPU type alone can explain almost all the speed differences, while others have extra factors. Because pricing is based on run time, slower CPUs can cost users up to three times more for the same function.

What this means in practice

  • For cloud platform engineers: Design better scheduling policies that reduce performance and cost variability by accounting for hidden CPU differences across function instances.
  • For serverless application developers: Optimize and benchmark functions by testing across different CPU types to avoid unexpected slowdowns and higher costs on cloud FaaS platforms.

Authors

Jonas Heisterberg, Natalie Carl, Trever Schirmer, David Bermbach

Abstract

Serverless computing, particularly Function-as-a-Service (FaaS), abstracts operational concerns such as scaling, scheduling, and resource management from users. This abstraction, however, conceals a heterogeneous hardware fleet on which function execution environments are scheduled behind a unified function interface. Consequently, otherwise identical invocations may run on different CPU types that differ in performance, a hardware lottery that users can neither see nor control. Since the resulting variability is entangled with other sources, such as noisy neighbors or diurnal effects, its contribution to overall performance variability and how this contribution differs across providers remain unclear. In this paper, we systematically study hardware heterogeneity and its impact on function performance across four widely used commercial FaaS platforms, covering regional, configurational, and temporal differences. Using variance decomposition, we find that CPU heterogeneity alone explains 4 % to 97 % of the performance variance on AWS Lambda and Google Cloud Run Functions. On Azure Functions, in contrast, we identify a platform-level mechanism that produces bimodal execution durations and overshadows CPU effects. We observe that the CPU composition on AWS Lambda shifts within a single week. Additionally, we reveal that on Google Cloud Run Functions and Alibaba Function Compute, the availability of instruction set extensions such as SHA-NI differs between CPU types, widening the performance gap further. Since all platforms bill by duration, performance gaps between CPU types translate directly into cost, with invocations on the slowest CPU type costing up to three times as much as those on the fastest.