Slide 1

Slide 1 text

Charles Humble, Conissaunce Limited @charleshumble Writing Greener Software Even When You Are Stuck On-Prem

Slide 2

Slide 2 text

@charleshumble.bsky.social

Slide 3

Slide 3 text

@charleshumble.bsky.social Sulphur dioxide emissions https://ourworldindata.org/explorers/air-pollution?facet=none&uniformYAxis=0&country=GBR~USA~OWID_EUR&Pollutant=Sulphur+dioxide+ %28SO₂%29&Sector=From+all+sectors+%28Total%29&Per+capita=false 60 million t 1750 1800 1850 1900 1950 2000 2022 50 million t 40 million t 30 million t 20 million t 10 million t Europe United States United Kingdom

Slide 4

Slide 4 text

@charleshumble.bsky.social https://ourworldindata.org/ozone-layer?insight=the-initial-montreal-protocol-wouldn-t-have-been-successful-in-reducing-ozone-depleting- emissions-an-increase-in-ambition-from-subsequent-agreements-has-been-essential Ozone hole Emissions of the Ozone Depleting Substances (world) 200,000 tonnes 400,000 tonnes 600,000 tonnes 800,000 tonnes 1 million tonnes 1.2 million tonnes 1.4 million tonnes 1.6 million tonnes Methyl Chloroform Chlorofluorocarbons (CFCS) Carbon Tetrachloride Methly Bromide Hydrochloroflurocarbons (HCFCs) Haloms 1986 1990 1995 2000 2005 2010 2015 2021

Slide 5

Slide 5 text

@charleshumble.bsky.social https://www.epa.gov/climatechange-science/causes-climate-change The hockey stick 0.6 0.4 0.2 0.0 -0.0 -0.4 -0.6 -0.8 0 1 2 3 4 5 6 -1 -2 -3 -4 Temperature Anomaly (°C) Standardised PAGES2K 1000 1200 1400 1600 1800 2000

Slide 6

Slide 6 text

@charleshumble.bsky.social https://www.conissaunce.com/sustainability-ebook.html It may surprise you to learn that energy consumption from data centres has grown only modestly in recent years. Nevertheless, the International Energy Agency (IEA) suggests that estimated global data center electricity consumption in 2022 was 240 TWh to 340 TWh, accounting for around 1% to 1.3% of all global electricity demand.

Slide 7

Slide 7 text

@charleshumble.bsky.social The cost of low carbon technology • In the last decade, the price of solar energy has fallen by more than 90%. • The price of wind energy by more than 70%. • Battery costs have also tumbled. https://www.weforum.org/agenda/2021/10/how-cheap-can-renewable-energy-get/

Slide 8

Slide 8 text

@charleshumble.bsky.social The maturity matrix https://github.com/Green-Software-Foundation/green-software-maturity-matrix

Slide 9

Slide 9 text

@charleshumble.bsky.social The maturity matrix

Slide 10

Slide 10 text

@charleshumble.bsky.social The maturity matrix

Slide 11

Slide 11 text

@charleshumble.bsky.social What do scopes 1, 2 and 3 mean? The Greenhouse Gas Protocol categorises GHG emissions into three “scopes”. SCOPE 1 Direct Emissions from operations owned or controlled by the reporting organiszation, such as onsite fuel combustion or fleet vehicles DIRECT EMISSIONS SCOPE 2 Indirect emmissions related to emission generation or purchased energy, such as heat and electricity. In 2015, the Corportate Standard was updated with comprehensive Scope 2 guidance INDIRECT EMISSIONS SCOPE 3 INDIRECT EMISSIONS Other indirect emissions from other activities, including all emissions from an organisation’s supply chain, business travel for employees and the electricity customers may consume when using a product

Slide 12

Slide 12 text

@charleshumble.bsky.social What do scopes 1, 2 and 3 mean? The Greenhouse Gas Protocol categorises GHG emissions into three “scopes”. SCOPE 1 Direct emissions from operations owned or controlled by the reporting organisation, such as onsite fuel combustion or fleet vehicles DIRECT EMISSIONS SCOPE 2 Indirect emissions related to emission generation or purchased energy, such as heat and electricity. In 2015, the Corporate Standard was updated with comprehensive Scope 2 guidance INDIRECT EMISSIONS SCOPE 3 INDIRECT EMISSIONS Indirect emissions from other activities, including all emissions from an organisation's supply chain, business travel for employees and the electricity customers may consume

Slide 13

Slide 13 text

@charleshumble.bsky.social What do scopes 1, 2 and 3 mean? The Greenhouse Gas Protocol categorises GHG emissions into three “scopes”. SCOPE 1 Direct emissions from operations owned or controlled by the reporting organisation, such as onsite fuel combustion or fleet vehicles DIRECT EMISSIONS SCOPE 2 Indirect emissions related to emission generation or purchased energy, such as heat and electricity. In 2015, the Corporate Standard was updated with comprehensive Scope 2 guidance INDIRECT EMISSIONS SCOPE 3 INDIRECT EMISSIONS Indirect emissions from other activities, including all emissions from an organisation's supply chain, business travel for employees and the electricity customers may consume

Slide 14

Slide 14 text

@charleshumble.bsky.social What do scopes 1, 2 and 3 mean? The Greenhouse Gas Protocol categorises GHG emissions into three “scopes”. SCOPE 1 Direct emissions from operations owned or controlled by the reporting organisation, such as onsite fuel combustion or fleet vehicles DIRECT EMISSIONS SCOPE 2 Indirect emissions related to emission generation or purchased energy, such as heat and electricity. In 2015, the Corporate Standard was updated with comprehensive Scope 2 guidance INDIRECT EMISSIONS SCOPE 3 INDIRECT EMISSIONS Indirect emissions from other activities, including all emissions from an organisation's supply chain, business travel for employees and the electricity customers may consume SCOPE 1 Direct emissions from operations owned or controlled by the reporting organisation, such as onsite fuel combustion or fleet vehicles DIRECT EMISSIONS SCOPE 2 Indirect emissions related to emission generation or purchased energy, such as heat and electricity. In 2015, the Corporate Standard was updated with comprehensive Scope 2 guidance INDIRECT EMISSIONS SCOPE 3 INDIRECT EMISSIONS Indirect emissions from other activities, including all emissions from an organisation's supply chain, business travel for employees and the electricity customers may consume

Slide 15

Slide 15 text

@charleshumble.bsky.social What do scopes 1, 2 and 3 mean? https://learn.greensoftware.foundation/measurement/

Slide 16

Slide 16 text

@charleshumble.bsky.social The maturity matrix

Slide 17

Slide 17 text

@charleshumble.bsky.social What are carbon neutral and net zero? • To be carbon neutral, an organisation must measure its scope 1 and 2 emissions, then match the total with emissions o ff sets through carbon reduction projects. • Net zero means reducing emissions according to the latest climate science, and balancing remaining residual emissions through carbon removals.

Slide 18

Slide 18 text

@charleshumble.bsky.social What does inspiring mean?

Slide 19

Slide 19 text

@charleshumble.bsky.social What does inspiring mean? • 24/7 carbon-free electricity in data centres: This means all electricity use in data centres is time- matched with green grid power, which is Google’s stated goal for 2030. https://www.gstatic.com/gumdrop/sustainability/247-carbon-free-energy.pdf

Slide 20

Slide 20 text

@charleshumble.bsky.social What does inspiring mean? • 24/7 carbon-free electricity in data centres: This means all electricity use in data centres is time- matched with green grid power, which is Google’s stated goal for 2030. • 10-year life expectancy on all end-user devices: Make hardware last longer and use it e ffi ciently to reduce embodied carbon. https://www.apple.com/environment/pdf/products/iphone/iPhone_14_PER_Sept2022.pdf

Slide 21

Slide 21 text

@charleshumble.bsky.social How do we get more efficient? binary-trees fannkuch-redux

Slide 22

Slide 22 text

@charleshumble.bsky.social How do we get more efficient? binary-trees fannkuch-redux

Slide 23

Slide 23 text

@charleshumble.bsky.social How do we get more efficient? binary-trees fannkuch-redux

Slide 24

Slide 24 text

@charleshumble.bsky.social More efficient platforms • Many of the major platforms are making investments in terms of e ffi ciency—the JVM itself and modern frameworks such as Quarkus.

Slide 25

Slide 25 text

@charleshumble.bsky.social More efficient platforms • Many of the major platforms are making investments in terms of e ffi ciency—the JVM itself and modern frameworks such as Quarkus. • Python, which was languishing in our programming e ffi ciency table, is also improving.

Slide 26

Slide 26 text

@charleshumble.bsky.social Why start with ops? • Energy proportionality is an observation from Google that even an energy e ffi cient server still consumes about half its power when doing virtually no work. https://research.google/pubs/the-case-for-energy-proportional-computing/

Slide 27

Slide 27 text

@charleshumble.bsky.social Why start with ops? • Energy proportionality is an observation from Google that even an energy e ffi cient server still consumes about half its power when doing virtually no work. • Servers designed with less attention to energy e ff i ciency often idle at even higher power levels. https://research.google/pubs/the-case-for-energy-proportional-computing/

Slide 28

Slide 28 text

@charleshumble.bsky.social How do we get more efficient? A good fi rst goal would be to aim to have machine utilisation at >=50% at all times across your entire estate.

Slide 29

Slide 29 text

@charleshumble.bsky.social Start by getting rid of zombies • Zombies are any machines that were doing useful work but no longer are.

Slide 30

Slide 30 text

@charleshumble.bsky.social Start by getting rid of zombies • Zombies are any machines that were doing useful work but no longer are. • Get rid of them. Zombies are bad.

Slide 31

Slide 31 text

@charleshumble.bsky.social “In 2019, VMWare consolidated a data centre in Singapore. The team wanted to move the entire data centre and therefore investigated what exactly needed a migration. The result was somewhat shocking: 66% of all host machines were Zombies.” Martin Lippert, Spring Tools lead & sustainability ambassador at VMWare/Broadcomb, quoted in Building Green Software. https://www.oreilly.com/library/view/building-green-software/9781098150617/

Slide 32

Slide 32 text

@charleshumble.bsky.social “Some of the biggest cybersecurity incidents in recent times have stemmed from systems which no-one knew about and should never have been turned on.” - Ed Harrison, former head of security at Metaswitch Networks (now part of Microsoft), quoted in Building Green Software.

Slide 33

Slide 33 text

@charleshumble.bsky.social

Slide 34

Slide 34 text

@charleshumble.bsky.social LightSwitchOps • One of the best encapsulations of this I’ve heard of comes from Red Hat’s Holly Cummins. She calls it “LightSwitchOps”. • A good place to start would be by turning o ff your test and development services in the evenings and at weekends. • If your business isn’t global you will have hours where you have peak demand and hours where you have much less demand. • So run an audit— fi nd out what your servers are doing—and get rid of anything you don’t need. If you know you can bring it back easily you can a ff ord to be brutal.

Slide 35

Slide 35 text

@charleshumble.bsky.social Use autoscaling • Have a look at where you can apply autoscaling.

Slide 36

Slide 36 text

@charleshumble.bsky.social Datacenter specific wins • You have control over the lifetime of your hardware. • You can also take advantage of the power-saving features already present in your hardware. • Consider using more e ffi cient CPUs for the hardware you purchase. • You can even look at using a lower voltage within the range supported by the hardware.

Slide 37

Slide 37 text

@charleshumble.bsky.social Measurements and proxies • We often have to rely on proxies to calculate our environmental impact.

Slide 38

Slide 38 text

@charleshumble.bsky.social Measurements and proxies • We often have to rely on proxies to calculate our environmental impact. • One of the best proxies for energy is CPU utilisation.

Slide 39

Slide 39 text

@charleshumble.bsky.social Measurements and proxies • We often have to rely on proxies to calculate our environmental impact. • One of the best proxies for energy is CPU utilisation. • Cost is a useful proxy for carbon emissions—up to a point—unlike many other industries we don’t have to pay what Bill Gates calls “the green premium”.

Slide 40

Slide 40 text

@charleshumble.bsky.social Beyond proxies • The CNCF Kepler (Kubernetes E ffi cient Power Level Exporter) project uses eBPF to probe energy-related system stats for Kubernetes workloads and exports them as Prometheus metrics https://github.com/sustainable-computing-io/kepler/

Slide 41

Slide 41 text

@charleshumble.bsky.social Beyond proxies • These can be imported via the pre-generated Kepler Dashboard into Grafana

Slide 42

Slide 42 text

@charleshumble.bsky.social Beyond proxies • If you have workloads on public clouds, then AWS (Customer Carbon Footprint Tool), Azure (Emissions Impact Dashboard) and Google Cloud (Carbon Footprint) all have strong sustainability goals and provide tools to assess your carbon footprint on their platforms.

Slide 43

Slide 43 text

@charleshumble.bsky.social Beyond proxies • If you have workloads on public clouds, then AWS (Customer Carbon Footprint Tool), Azure (Emissions Impact Dashboard) and Google Cloud (Carbon Footprint) all have strong sustainability goals and provide tools to assess your carbon footprint on their platforms. • Cloud Carbon Footprint is an open source alternative sponsored by Thoughtworks that can measure, monitor and reduce your carbon emissions on public clouds.

Slide 44

Slide 44 text

@charleshumble.bsky.social GSF Formula E: Energy consumed by a software system I: Location-based marginal carbon emissions M: Embodied emissions of a software system R: Functional unit (e.g., carbon per additional user, API call, machine learning job, etc.) https://learn.greensoftware.foundation/measurement/ SCI = ((E*I) + M ) per R energy consumed by software, in kWh Functional unit; this is how software scales, for example by user device or API request Carbon emitted per kWh of energy, in gC02/kWh Carbon emitted per kWh of energy, in gC02/kWh

Slide 45

Slide 45 text

@charleshumble.bsky.social Location, location, location • Putting your workloads where the electricity is greenest is an instant quick win. • Electricity Maps has partnered with Google, AWS and Salesforce to provide customers with real-time, global coverage of the carbon intensity of electricity. https://app.electricitymaps.com/map

Slide 46

Slide 46 text

@charleshumble.bsky.social Demand shifting • There are APIs such as Electricity Maps, WattTime and the Carbon Aware SDK from the Green Software Foundation.

Slide 47

Slide 47 text

@charleshumble.bsky.social Demand shifting • There are APIs such as Electricity Maps, WattTime and the Carbon Aware SDK from the Green Software Foundation. • Armed with these, you can apply a more advanced technique called demand shifting or shaping—responding to shifts in carbon intensity by increasing or decreasing your demand. https://www.conissaunce.com/demand-shifting-and-shaping.html

Slide 48

Slide 48 text

@charleshumble.bsky.social Demand shifting • There are APIs such as Electricity Maps, WattTime and the Carbon Aware SDK from the Green Software Foundation. • Armed with these, you can apply a more advanced technique called demand shifting or shaping—responding to shifts in carbon intensity by increasing or decreasing your demand. • Demand shifting can also be based on location. https://www.conissaunce.com/demand-shifting-and-shaping.html

Slide 49

Slide 49 text

@charleshumble.bsky.social Demand shifting • Some of the tricks and techniques we’ve learned to get more resilience in distributed computing can also be applied in a carbon- aware way. • For example, graceful degradation—such as retrieving data from a cache rather than generating it in real time if the data service is temporarily unavailable—is a widely used technique for microservices. Many of the resultant changes are so small they’re almost imperceptible to the majority of users. • Graceful degradation can also be applied in a carbon-aware way, for example by performing a cache discard and refreshing the movie recommendations list only when the electricity you are using is greenest.

Slide 50

Slide 50 text

@charleshumble.bsky.social Demand shifting examples • Google launched a project to make some cloud workloads carbon aware. It says it “can now shift moveable compute tasks between di ff erent data centres, based on regional hourly carbon- free energy availability”. https://blog.google/outreach-initiatives/sustainability/carbon-aware-computing-location/

Slide 51

Slide 51 text

@charleshumble.bsky.social Demand shifting examples • Google launched a project to make some cloud workloads carbon aware. It says it “can now shift moveable compute tasks between di ff erent data centres, based on regional hourly carbon- free energy availability”. • Microsoft announced a project to make Windows 11 more sustainable by running Windows updates when the carbon intensity is lower. https://support.microsoft.com/en-us/windows/windows-update-is-now-carbon-aware-a53f39bc-5531-4bb1-9e78-db38d7a6df20

Slide 52

Slide 52 text

@charleshumble.bsky.social Demand shifting examples • Xbox performs updates when the electricity from the grid is the cleanest, and its power-saving mode, Shutdown, can cut electricity consumption up to 20-fold. https://news.xbox.com/en-us/2023/01/11/xbox-carbon-aware-console-sustainability/

Slide 53

Slide 53 text

@charleshumble.bsky.social Demand shifting examples • Xbox performs updates when the electricity from the grid is the cleanest, and its power-saving mode, Shutdown, can cut electricity consumption up to 20-fold. • Apple has Clean Energy Charging for US iPhone customers that uses a forecast of the carbon emissions in your local energy grid and uses it to charge your iPhone during times of cleaner energy production. https://support.apple.com/en-us/108068

Slide 54

Slide 54 text

@charleshumble.bsky.social Sidebar: AI • Although we know training and using AI consumes a lot of energy, publicly available information on the environmental cost of AI is scant.

Slide 55

Slide 55 text

@charleshumble.bsky.social Sidebar: AI • Although we know training and using AI consumes a lot of energy, publicly available information on the environmental cost of AI is scant. • Microsoft reported in May of 2024 that its total carbon emissions have risen nearly 30% since 2020 primarily due to the construction of data centres to meet its push into AI. https://www.microsoft.com/en-us/corporate-responsibility/sustainability/report

Slide 56

Slide 56 text

@charleshumble.bsky.social Sidebar: AI • Although we know training and using AI consumes a lot of energy, publicly available information on the environmental cost of AI is scant. • Microsoft reported in May of 2024 that its total carbon emissions have risen nearly 30% since 2020 primarily due to the construction of data centres to meet its push into AI. • Google’s emissions have surged nearly 50% compared to 2019. They also increased 13% year-on-year in 2023, according to their report. The company attributed the emissions spike to an increase in data centre energy consumption and supply chain emissions driven by arti fi cial intelligence. https://www.gstatic.com/gumdrop/sustainability/google-2024-environmental-report.pdf

Slide 57

Slide 57 text

@charleshumble.bsky.social Make sound choices • For any work that isn’t particularly latency sensitive, such as training a machine learning (ML) model, it’s smart to do it in a region with lower carbon intensity when you have access to the greenest power.

Slide 58

Slide 58 text

@charleshumble.bsky.social Make sound choices • For any work that isn’t particularly latency sensitive, such as training a machine learning (ML) model, it’s smart to do it in a region with lower carbon intensity when you have access to the greenest power. • Researchers from University College Dublin have found that practicing time-shifting methodologies for ML models can reduce software- related carbon emissions between 45% and 99% https://ieeexplore.ieee.org/document/6128960

Slide 59

Slide 59 text

@charleshumble.bsky.social Make sound choices • For any work that isn’t particularly latency sensitive, such as training a machine learning (ML) model, it’s smart to do it in a region with lower carbon intensity when you have access to the greenest power. • Researchers from University College Dublin have found that practicing time-shifting methodologies for ML models can reduce software- related carbon emissions between 45% and 99%. • Consider whether a pre-trained model would work, and also factor the carbon costs into your calculations. https://ieeexplore.ieee.org/document/6128960

Slide 60

Slide 60 text

@charleshumble.bsky.social Make sound choices • For any work that isn’t particularly latency sensitive, such as training a machine learning (ML) model, it’s smart to do it in a region with lower carbon intensity when you have access to the greenest power. • Researchers from University College Dublin have found that practicing time-shifting methodologies for ML models can reduce software- related carbon emissions between 45% and 99%. • Consider whether a pre-trained model would work, and also factor the carbon costs into your calculations. • Keep in mind that training is only part of the cost. https://ieeexplore.ieee.org/document/6128960

Slide 61

Slide 61 text

@charleshumble.bsky.social Make sound choices • Meta has stated that it “developed OPT-175B with energy e ff i ciency in mind by successfully training a model of this size using only 1/7th of the carbon footprint as that of GPT-3”. • Apple has said “we get tremendous e ffi ciency out of our silicon, which will continue to allow us to have 100% of our data centers carbon neutral and running entirely on renewable energy… That goal [of being entirely carbon neutral by 2030] is alive and well”.

Slide 62

Slide 62 text

@charleshumble.bsky.social Looking ahead • We are likely to see more regulations around sustainability, beyond calculating your Environmental, Social and Governance (ESG) rating, which many organisations are increasingly using as part of their vendor selection criteria. • The EU has announced the world’s fi rst Carbon Border Adjustment Mechanism (CBAM), which aims to make all EU suppliers green. Currently in a transition period, it will be fully operational in January 2026.

Slide 63

Slide 63 text

@charleshumble.bsky.social What else can you do? • Your best friends are likely to be your head of security, your CFO, and possibly your head of recruitment. • You have the opportunity to put pressure on your vendors to focus on e ffi ciency and sustainability. • With some caution I’d also encourage you to talk to maintainers of the larger open source libraries you use. Can they start thinking about sustainability? Can you help?

Slide 64

Slide 64 text

@charleshumble.bsky.social Summary If you are looking to start improving your software sustainability think operations fi rst, not code.

Slide 65

Slide 65 text

@charleshumble.bsky.social Summary If you are looking to start improving your software sustainability think operations fi rst, not code. Aim to reach >=50% utilisation for servers across your estate.

Slide 66

Slide 66 text

@charleshumble.bsky.social Summary • Apply LightSwitchOps, turn o ff under-utilised machines (zombies) and do manual rightsizing. • Use autoscaling where possible (including scaling down!) • Run more applications on the same hardware (multi-tenancy). • Use more e ffi cient CPUs that are matched with your workload requirements. • Look at where your workloads run from an environmental perspective using Electricity Maps and apply demand shifting.

Slide 67

Slide 67 text

@charleshumble.bsky.social Finally If you or your organisation are doing successful work in this area, please share your experience.

Slide 68

Slide 68 text

@charleshumble.bsky.social Finally If you or your organisation are doing successful work in this area, please share your experience. There is a dearth of good information and success stories. If you have a case study, speak about it at a conference, write a blog, record a video or publish an article. We need more of this work in the public domain.

Slide 69

Slide 69 text

@charleshumble.bsky.social Recommended reading

Slide 70

Slide 70 text

Charles Humble, Conissaunce Limited @charleshumble Thanks for listening