Sitemap
Olivier Bierlaire

Olivier Bierlaire

DevOps Coder, Canva founding team in Sydney. I joined Elastic to work in releasing team, around CI area. I'm interested in sustainability in cloud computing.

Carbon Aware Cloud

5 min readMar 7, 2023

--

Microsoft recently announced that Xbox will now be “Carbon Aware”. It will download updates during periods of low carbon intensity on the power grid.

Can we imagine doing the same for cloud infrastructure? Can we imagine a carbon-aware cloud? Public cloud providers are constantly improving their environmental impact by, for example, saving water or building solar plants. However, the virtual machines we spin up or the computing tasks we trigger are completely up to us. And there is room for improvement.

What is the problem with data centres?

According to the International Energy Agency, data centres consume between 220 and 320 terawatt-hours (TWh) of electricity, which is around one per cent of the world’s electricity demand in 2021. Data centres account for around 0.3% of all global CO2 emissions. While this number may seem small, it can be compared to the total emissions of countries like France, the UK or Australia!

Projections published by Nature suggest that the electricity demand of Information and Communications Technology (ICT) will jump to 20% of global electricity. To put this in perspective, ICT currently has the same carbon footprint as the aviation industry, and data centres account for 20% of it according to the Shift Project. This share is only expected to grow!

Press enter or click to view image in full size
Energy Forecast of Information and Communication Technology (ICT) will accelerate in 2020s and that data centres will take a larger slice: 20.9% of projected electricity demand — Nature
Source: Nature
Distribution of energy consumption per source for the production and use of digital devices in 2017. Data centers : 19% [Source: The Shift Project 2018, as of Andrae & Edler 2015]

First, measure your cloud carbon footprint

There are tools available to analyse the carbon footprint of your cloud infrastructure. Major public cloud providers have released tools for this purpose:

Various open-source initiatives, like Cloud Carbon Footprint, can analyse your cloud provider bill, get resource usage, and estimate carbon emissions.

Other tools, like Scaphandre, rely on monitoring agents to measure the electric consumption of your machines.

There are many methodologies to estimate the power consumption of your cloud resources. Basically, if you know the underlying models of the CPU, memory, disk, or GPU, you need to multiply it by their usage per cent over time, and you will have the power consumption in kilowatt-hours (kWh).

Having power consumption is the most difficult part. Once you have it, there are various methods to estimate CO2 emissions from it.

Press enter or click to view image in full size
Formula : SCI = ((E * I) + M) per R
SCI formula — Green Software Foundation

The key part is multiplying your power consumption (E) by the carbon intensity of the electricity consumed (I).

Get Olivier Bierlaire’s stories in your inbox

Join Medium for free to get updates from this writer.

But, what’s the carbon intensity of the electricity? Cloud providers might provide some net value, taking into account their effort to offset carbon (basically net-zero according to Google), but realistically electricity used by data centres comes from the regional grid. So, depending on where the data centre is located, electricity can be more or less “clean”:

Press enter or click to view image in full size
Carbon Intensity per Country in 2022
Source : OurWorldData.org/energy

We can even get a real-time value from projects like Electricity Maps

Press enter or click to view image in full size
Screenshot of Electricity Map showing Carbon emissions of electricity per country in realtime
Electricity Maps

Then, reduce your cloud carbon footprint

Once you know how to measure your carbon footprint, it’s time to take action! The first thing that comes to mind is making software more energy efficient. However, on the infrastructure level, some choices can be made.

Move to an Hyperscaler provider

Moving to a hyperscaler cloud provider can have a significant impact. Public cloud providers, such as AWS, GCP, and Azure, are constantly working to lower energy bills by improving water cooling, among other things.

Choose your region wisely

According to Google, hosting in Paris can result in a carbon footprint as low as 59 gCO2eq/kWh, while in Frankfurt it can jump to 269. By choosing a “greener” region in the same neighbourhood, the impact on carbon footprint can be massive!

Press enter or click to view image in full size
Worlmap showing “Spatial Shifting” of servers being moved from a region to a greener one
Spatial Shifting — Green Software Foundation

Follow the sun

Carbon intensity varies a lot during the day because of renewable energy which depends on weather conditions. During a windless night, carbon intensity is worse than during a windy and sunny day!

Press enter or click to view image in full size
Graph showing energy mix emtting 120 gCO2/kWh then later 350
Variability of Carbon intensity over time — Green Software Foundation

Scheduling a heavy task, like machine learning, where it’s daylight can be a powerful way to reduce the carbon footprint of asynchronous tasks.

Leverage Infrastructure as Code (IaC)

Infrastructure as Code (IaC) tools like Terraform enable infrastructure automation. Your infrastructure is described in a machine-readable file, which can be analysed and generated (templates, variables). Changing the region of your infrastructure could be as simple as changing the value of a variable.

By reading these Terraform files, tools like Carbonifer can compute the size and number of virtual machines in your infrastructure and estimate the carbon footprint in gCO2eq/h.

Press enter or click to view image in full size
Screenshot of Carbonifer tool which reads Terraform files and estimate carbon emissions of this infrastructure if deployed
Carbonifer estimation of carbon emission of Terraform project — Carbonifer

Integrating such a tool with your Continuous Integration (CI) could raise alerts when you reach a threshold of CO2 emission estimation for any planned changes to your infrastructure (thanks to GitOps).

Accept a loss of quality

There is virtually no limit to the performance of your software, regardless of the cost of money. Having more and bigger machines can ensure customer satisfaction with features like Ultra HD streaming and instant responsiveness. However, during a dark, cold winter when electricity relies on fossil fuels, it may not make sense to prioritise these features. Cloud companies could reduce their quality of service slightly to remain within their climate commitments. Tools could be developed to resize “autoscaling groups” when the carbon intensity of the cloud is high.

Carbon Aware Cloud

Although there is not yet a fully integrated solution for a carbon-aware cloud, various tools, automation and methodologies can help in the following ways:

  • Estimate the CO2 emissions of a deployment
  • Analyse the Carbon Footprint of an existing infrastructure
  • actively pilot your infrastructure according to the carbon intensity of the grid

By changing the hosting region, selecting a better time of day, or accepting a lower quality and automating these actions, there are ways to reduce our cloud carbon footprint.

--

--

Olivier Bierlaire
Olivier Bierlaire

DevOps Coder, Canva founding team in Sydney. I joined Elastic to work in releasing team, around CI area. I'm interested in sustainability in cloud computing.