Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CNCF: Writing Greener Software Even When You Ar...

Charles Humble
October 24, 2024
28

CNCF: Writing Greener Software Even When You Are Stuck On-Prem

There is a real efficiency advantage in high compute density via managed cloud services. Such services, which can share resources between thousands or millions of users, can achieve extremely high hardware and energy utilisation. Because of this, an awful lot of the still rather limited publicly available material on writing software with sustainability in mind emphasises shifting to cloud services. But what happens if you can’t?
In this session Charles will explain why he believes we all need to be focussed on green software. He will offer practical ways to assess where you currently are in terms of your systems, advice for how to improve, and the role code and language efficiency play. Finally, he’ll offer suggestions for how to persuade your leadership that this is all a good idea, and look at some of the tools and resources that are available to help you get to grips with this rapidly evolving and fascinating area of computing.

Charles Humble

October 24, 2024
Tweet

Transcript

  1. @Charleshumble 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
  2. @Charleshumble 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
  3. @Charleshumble https://info.container-solutions.com/the-cloud-native-attitude-2nd-edition Global data centre electricity use in 2021 was

    220-320   TWh, and if we factor in data transmission networks, we can add a further 260-340   TWh. For context, this makes the upper estimate of our industry’s electricity consumption similar to a country like Brazil, and much larger than a country like the UK, which used 331.3 TWh in the same period.
  4. @Charleshumble 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/
  5. @Charleshumble 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
  6. @Charleshumble 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
  7. @Charleshumble 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.
  8. @Charleshumble 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.
  9. @Charleshumble 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/
  10. @Charleshumble 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/
  11. @Charleshumble 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.
  12. @Charleshumble Start by getting rid of zombies • Zombies are

    any machines that were doing useful work but no longer are.
  13. @Charleshumble 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.
  14. @Charleshumble “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/
  15. @Charleshumble “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.
  16. @Charleshumble 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.
  17. @Charleshumble 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
  18. @Charleshumble Demand shifting • There are APIs such as WattTime

    and the Carbon Aware SDK from the Green Software Foundation.
  19. @Charleshumble Demand shifting • There are APIs such as 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.
  20. @Charleshumble Demand shifting • There are APIs such as 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.
  21. @Charleshumble 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.
  22. @Charleshumble Summary If you are looking to start improving your

    software sustainability think operations fi rst, not code.
  23. @Charleshumble 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.
  24. @Charleshumble 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). • Look at where your workloads run from an environmental perspective using Electricity Maps and apply demand shifting.
  25. @Charleshumble Finally If you or your organisation are doing successful

    work in this area, please share your experience.
  26. @Charleshumble 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.