As a technologist, how can my software be greener? (Guest blog from Kainos)
Author: Caoimhin Graham, Cloud Practice Technology Lead, Kainos
It is easy to be dismissive of the impact that technologists can have when it comes to addressing the climate problem. Can the decisions they make really scale to the point where they become a significant part of the solution?
It has been said that “software is eating the world.” Dramatic? Maybe a little. But this phrase captures so much of what has happened over the last decade. Software has transformed and impacted almost every industry. From managing the electronics in your car, and sensors on your smart toaster telling you when your toast is “just right,” to the online service for submitting your tax returns.
This has created its own demands on our planet, as increasingly limited natural resources are used to build the hardware and generate the energy powering our software. Software literally has started eating the world.
Let's take the example of data growth. At current rates we are likely to exceed 1 yottabyte of data created in a single year by 2030. That's 1,000 zettabytes, a trillion terabytes, or our personal favourite, a million trillion megabytes. If this keeps up, by 2053, we'll need to mine 175 billion tonnes of raw material just to build the servers to store the information. Just storage. That's the same as mining the equivalent of Mount Everest every year from 2053 onwards if nothing changes. And by the way, we don’t use 68% of the data we collect!
As technologists, the growth of software across industries also means the weight of our individual actions has become amplified. Slight changes can have a significant impact, from smart toasters to millions of people completing their tax returns.
As technologists, the growth of software across industries also means the weight of our individual actions has become amplified. Slight changes can have a significant impact.
The Green Software Foundation has defined some key principles which we can use to guide our actions. To challenge how we design, build and operate software. We can effectively put software on a diet, or as colleague suggested, “force it to eat its greens” by applying thinking across 3 areas:
- Energy Efficiency: Simply put, this is about engineering our solutions to be lean and consume the least amount of energy possible. It used to be common practice at university to study the Big O notation which looked at how algorithmic performance changes as the scale/size of input data grows. While it could be an effective way of optimising for efficiency or reducing energy impact nobody uses it, because it's inconvenient.
- Hardware Efficiency: Engineering our solutions to maximise hardware utilisation and if we can, extend its operational lifespan. Most of the environmental impact of hardware comes from the manufacture and disposal of the device, not operational use. The mining of rare earth materials to make processors and hardware has a huge carbon impact, which is hidden from consumers. If we can use the same hardware for longer, we can minimise environmental impact.
- Carbon Awareness: This is all about measurement. Engineering our solutions to do more when green, low-carbon energy is available and less when it isn’t.
These principles may seem a little esoteric, but in parallel to this, work is afoot to publish a catalogue of patterns which makes this more tangible. Let's take a look at some of the current thinking on this with the examples below.
Energy Efficiency – Proactive testing across the user-journey
- Reducing waste in your code by removing the stuff you don't need or use. This can be as simple as minifying assets. A review found that Google Fonts was the most-popular third-party resource on mobile devices being used on nearly 63% of all websites. The CSS they provide not being minified which means around 13.3KB of data is wasted each time they are accessed.
- Optimising your content for efficiency. Are you already using the now widely supported WebP image format? It offers between 26% to 34% better compression than PNG/JPEG, respectively. The better the compression, the less data that is transmitted and the lower the energy impact.
- We need to consider upstream and downstream impacts of the user-journey.
- Upstream: One area of hot-debate right now is the environmental impact of training ML models – how accurate do our models need to be? What is the trade-off?
- Downstream: How do we optimise for efficiency on users' devices e.g., the simple act of changing the colour scheme can impact upon the battery life of mobile devices by as much as 47%.
Hardware Efficiency - Think about hosting, location and obsolescence
- The location you choose to host and run your software is a big decision. With higher latent utilisation rates and via various schemes, transitioning to 100% renewable electricity by 2025, hyperscale cloud providers like Microsoft Azure and AWS can provide more efficient hosting options across a huge number of locations. Recent studies have found that only 10% of websites made use of such hosting.
- How you choose to host/run your software is a big decision. Most of the cloud hyperscalers provide long lists of service options that you can consume, many of them managed services where average utilisation rates are much, much higher through multi-tenancy and economies of scale. In recent years, the availability of Arm-based hardware options for those same services means consuming up to 60% less energy whilst improving your price/performance ratio over x86 by 52%.
- Designing your software with backward compatibility in mind so as not to introduce a forced upgrade cycle is key to avoiding planned obsolescence and extending hardware lifespans. If your software only supports the latest browser extensions or the newest, shiniest release of iOS, you can create upgrade pressure for users to replace their devices. With recent moves to legislate against planned obsolescence in the manufacturing space, should we expect this thinking to catchup to software?
Carbon Awareness – Think about efficiency yes, but also user behaviour
- Informing users when the energy mix in your region is coming from high-carbon sources may help change user behaviours. Consider your favourite video streaming platform; a recent study found that varying the video streaming quality only had a small impact on energy use, but watching on your laptop rather than your 50-inch tv is 4.5x more efficient. What if when the energy mix was dirtier, the platform prompted you to consider watching the movie on your laptop? What if they asked you to consider unplugging your laptop to minimise draw from the grid? This may seem like a stretch, but Octopus Energy in the UK have been encouraging users to unplug their laptops when the energy mix is dirty since 2019.
- You might consider adjusting how your service behaves based on the availability of low-carbon energy. Consider your company’s website, those high-resolution images, embedded animations and videos. When the energy is low-carbon, why not provide this rich experience? But when it isn't, why not disable the animations, down-scale the images and default to a less rich experience?. There are some great examples of how you can already do this today.
- You can integrate this thinking to when and where you schedule workloads such as training your machine learning models to how where and when your favourite container orchestrator schedules new containers.
Whilst an emergent space, building green software is largely about introspection. Have we built the right thing, in the best way, while making the most efficient use of resources? There are many parallels to the practice of FinOps which over recent years has become embedded into how we think and factor financial responsibility into our decision making.
So as a technologist, how can you make your software greener? Simply start by asking yourself the question and let the introspection begin.
Cloud Climate Champions
This monthly series showcases the commitment of our members to a more sustainable and net zero future
techUK - Committed to Climate Action
Visit our Climate Action Hub to learn more or to register for regular updates.
By 2030, digital technology can cut global emissions by 15%. Cloud computing, 5G, AI and IoT have the potential to support dramatic reductions in carbon emissions in sectors such as transport, agriculture, and manufacturing. techUK is working to foster the right policy framework and leadership so we can all play our part. For more information on how techUK can support you, please visit our Climate Action Hub and click ‘contact us’.