Toward a carbon-aware Cloud

A presentation at Devoxx Belgium in October 2023 in Antwerp, Belgium by Olivier Bierlaire

Slide 1

Slide 1

Toward a Carbon-Aware Cloud

Slide 2

Slide 2

Olivier Bierlaire @obierlaire carbonifer

Slide 3

Slide 3

“I have all my infra in the cloud, so I do not emit CO2.”

Slide 4

Slide 4

Voracious Datacenters 20-25 % electricity used by the digital sector 1.3 % total electricity worldwide, excluding crypto mining - IEA Sources: The Shift Projet Nature International Energy Agency Dr. Anders Andrae Arte

Slide 5

Slide 5

Voracious Datacenters Digital technologies now emit 4% of greenhouse gas emissions (GHG), and its energy consumption is increasing by 9% a year - The Shift Project Source: IEA 330 Mt CO2 8 % by 2030 ?

Slide 6

Slide 6

Why bothering? Regulations and Law Compliance ESG funds Recruitment and Staff Retention Customer retention Cost reduction

Slide 7

Slide 7

The GHG protocol Scope 1 : Direct emissions Scope 2 : Indirect emissions related purchased energy Scope 3 : Other indirect emissions ( value chain emissions) business travel raw material purchased services purchased …

Slide 8

Slide 8

Regulations CSRD Corporate Sustainability Reporting Directive 2024 for large companies 2026 for listed SMEs scope 1,2 and scope 3 SFDR Sustainable Finance Disclosure Regulation financial sector financed scope 3

Slide 9

Slide 9

Commitments CO2 Offset Compensation Removal Elimination: not emitting CO2 eliminating source of CO2

Slide 10

Slide 10

Commitments Carbon Neutral focus on offset Net Zero: focus on elimination offset the rest 100% Renewable powered by matched by

Slide 11

Slide 11

Measure cloud infrastructure

Slide 12

Slide 12

Powering your cloud public datacenter your “cloud infra”

Slide 13

Slide 13

Software Carbon Intensity gCO2eq / hour

Slide 14

Slide 14

Embodied Emissions

Slide 15

Slide 15

Use Emissions Energy of software/VM (kWh) Power usage effectiveness (PUE) exemple: 1.5 Carbon intensity of the grid ( gCO2eq / kWh ) Greenhouse Gas Emissions (gCO2eq/h) AWS t2.nano : 1 CPU / 0.5 Gb RAM 125g of CO2 per month in France 600g of CO2 per month in Germany

Slide 16

Slide 16

Available Data Average carbon intensity of regional grids (gCO2/kWh) Live carbon intensity: app.electricitymaps.com Power usage effectiveness (PUE) Amazon Web Services : 1.135 Google Cloud : 1.1, …

Slide 17

Slide 17

“less” available data Energy consumed by hardware CPU / GPU Model/type % usage Memory Storage Network => Estimations, Coefficients … Energy-mix “weather” predictions

Slide 18

Slide 18

Cloud Provider AWS Carbon Footprint Tool Google Cloud Carbon Footprint Microsoft Azure Sustainability Calculator

Slide 19

Slide 19

Cloud carbon footprint Cloud Carbon Footprint opensource sponsored by Toughworks read bills of AWS, GCP… Time usage of instance types… Estimate using ratios (50% usage CPU…) https://demo.cloudcarbonfootprint.org/

Slide 20

Slide 20

Climatiq https://www.climatiq.io/ commercial api gives CO2 for an estimation factor cloud computing instance any domain (transportation, freight) Lot of data sources

Slide 21

Slide 21

Boavizta https://www.boavizta.org/ opensource free api free dataset (hardware consumption….) gives CO2 for an instance type use: manufacture (embodied) use

Slide 22

Slide 22

Scaphandre https://hubblo.org/ opensource read power consumption of CPU No CO2 estimation Demo: https://metrics.hubblo.org/

Slide 23

Slide 23

Carbonifer https://github.com/carboniferio/carbonifer https://carbonifer.io opensource command line estimates Terraform project

Slide 24

Slide 24

Reduction

Slide 25

Slide 25

Reduction Green-coding / Software Ecodesign Migrate to Hyperscaler “net-zero” datacenter? Keep it to a minimum auto-scaling groups containers … Change region / zone

Slide 26

Slide 26

Hyperscalers Net-Zero by 2040 100% renewable energy by 2025 Net-Zero by 2030 50% emissions by 2030 (scope 1,2,3) on premise numerous underused servers Carbon Negative by 2030 50% emissions by 2030 (scope 1,2,3) cloud fewer highly used server Improvement: PUE (AC, ..) Hardware Lifespane Renewable energy

Slide 27

Slide 27

FinOps => GreenOps Autoscaling Groups Scheduled Scaling Serverless night Adapt infra to the demand less $ = less gCO2 day

Slide 28

Slide 28

Choose your region wisely

Slide 29

Slide 29

Follow the sun Renewable energy are weather sensitive (sun, wind…) day/night app.electricitymaps.com plan heavy asynchronous tasks according to energy mix of the grid

Slide 30

Slide 30

Carbon Awareness 500 20 gCO2/kWh gCO2/kWh Resize Move Schedule

Slide 31

Slide 31

Carbon Awareness Temporal Shifting Examples : Image/Video processing AI model traning Machine Learning DB indexing

Slide 32

Slide 32

Carbon Awareness Demand Shaping Examples : video quality CI server

Slide 33

Slide 33

Carbon Awareness 500 20 gCO2/kWh gCO2/kWh Spatial Shifting

Slide 34

Slide 34

Demo

Slide 35

Slide 35

Demo Global Load Balancer … eu-west-1 (ireland) … eu-west-3 (france) Autoscaling Groups … eu-central-1 (germany)

Slide 36

Slide 36

Demo … eu-west-1 (ireland) CO2 intensity API carbon-aware scaler … eu-west-3 (france) … eu-central-1 (germany)

Slide 37

Slide 37

Demo Ireland 61 gCO2/kWh France 112 gCO2/kWh Germany 405 gCO2/kWh carbon-aware scaler … eu-west-1 (ireland) eu-west-3 (france) eu-central-1 (germany)

Slide 38

Slide 38

Demo Ireland 65 gCO2/kWh France 31 gCO2/kWh Germany 357 gCO2/kWh carbon-aware scaler … eu-west-1 (ireland) eu-west-3 (france) eu-central-1 (germany)

Slide 39

Slide 39

Demo Ireland 156 gCO2/kWh France 31 gCO2/kWh Germany 357 gCO2/kWh carbon-aware scaler … eu-west-1 (ireland) eu-west-3 (france) eu-central-1 (germany)

Slide 40

Slide 40

Demo

Slide 41

Slide 41

Collect usage metrics Take-Away Estimate kWh Estimate Carbon Emissions (gCO2/h) Plan / Analyse / Correlate Actions: reduce, schedule according to grid CO2 Carbon-Awareness

Slide 42

Slide 42

Thank you Green Software Foundation Carbon Aware Cloud olivier@carbonifer.io @obierlaire Environment Variables