Serverless functions energy use depends on language runtime and environment

Profiling the Energy Consumption of Serverless Functions with Joule Profiler

Software Engineering

Summary

Serverless computing lets programs run on demand without managing servers but involves several software layers before your code runs. The authors studied how these layers and programming languages affect energy use. They found that the choice of programming language and its runtime have the biggest impact on energy efficiency, more than the server environment itself. Their experiments also show that the server environment matters mostly for short-lived functions and interacts with the runtime used. They share tools and data so others can compare energy use for serverless setups.

What this means in practice

  • For cloud platform engineers: Optimize serverless function deployments by selecting energy-efficient language runtimes and suitable execution environments for short-lived tasks.
  • For data center operators: Reduce operational energy costs by adjusting serverless infrastructure configurations based on workload durations and function runtimes.

Authors

Jérémy Woirhaye, François Gibier, Anderson Andrei Da Silva, Francescomaria Faticanti, Thomas Ledoux, Romain Rouvoy

Abstract

Cloud providers and customers have widely adopted serverless computing as a convenient paradigm for deploying and executing functions on demand. To do so, serverless platforms require provisioning an appropriate execution environment before a single line of the function's code runs. These environments consist of several layers, such as container engines, hypervisors, unikernels, and programming language runtimes. While the literature has investigated the performance of these serverless platforms, it treats functions as black boxes, and the community lacks key insights into the environmental impacts of packaging applications as serverless functions. This paper therefore empirically studies the energy efficiency of serverless functions deployable on serverless platforms. We design an experimental benchmarking environment that lets stakeholders explore the impacts of the various layers involved in executing serverless functions. We use it to evaluate 1,401 configurations, combining 9 execution environments, 7 language-runtime configurations, 11 workloads, and 3 input sizes, to answer three research questions: Are the most popular programming languages for serverless functions the most energy-efficient? What factors most affect their energy efficiency? What are the most energy-efficient configurations to deploy them? Our results show that one should first choose the programming language, then the language runtime, and only then the execution environment, which matters only for short-lived functions and whose best choice depends on the runtime. Our benchmarking environment, experimental artifacts, raw measurements, and analysis code are publicly available.