How software kills the climate and what software engineers can do about it
Computer systems need energy to run. Software runs on computer systems. Software thus produces CO₂ and consumes energy. That means each piece of software, regardless of whether it is on a low-power embedded system or a massively distributed cloud infrastructure. Even the smallest piece of computer code has an environmental footprint.
While a landfill is directly visible to the human eye, wasted energy is not. A plain example: If a computer program performs a tasks at the cost of 5 kWh (kilowatt-hours) while it could perform the same tasks at 3 kWh hours, it is essentially wasting 2 kWh.
A single standard server uses around 20kWh per day. As much as an average medium sized car does on 100 kilometres in the city. In Germany, the production of 1 kWh releases around 474 gramms of CO₂ into the environment. A standard server thus may produce 9.4 kilograms of CO₂ per day. Yes, you can question the numbers and they may differ based on the equipment, but nevertheless it consumes natural resources.
While arguably that server has tasks to complete, there is a reason why it exists and why it runs around the clock. But is there really reason to operate it around the clock? I have serious doubts about it.
Modern cloud computing adds a price-tag to it
Services from the large cloud computing providers like AWS, Microsoft Azure or Google Cloud Platform are very elastic. Especially the “serverless compute” offerings such as AWS Lambda, Azure Functions or Google Cloud Functions. They are billed in seconds or milliseconds, adding a dollar sign to the actual cost of the execution and thus to the actual resource consumption.
Through these elastic offerings, energy and resource consumption becomes visible to the naked eye in the form of the cost incurred by the execution of computer code on these platforms.
A simple task can be performed at $5 per day or $50 per day, depending on the efficiency and optimization of the underlying program. Inefficient software gets a price tag for its inefficiency. Any optimziation results in a direct cost optimization and thus in a direct reduction of CO₂ emissions.
Software inefficiency kills our planet
While it’s agreeable that no software or program is perfect and every piece of software has certain inefficiencies, there are computer programs out there that are insanely inefficient and thus wasteful. Software were development cost was spared at the expense of operating cost, meaning the cost of compute, storage or networking resources.
When it is accepted that, in order to reduce the time to market and the development cost, a piece of software has higher operating cost, it also has higher emissions. One could argue that such cost reduction is wilful environmental pollution.
Economically there might be reasoning behind accepting inefficiencies in computer software. Ecologically, it may be a catastrophy for our environment. It may be unnecessary environmental pollution. It does not matter if it is intentional or not.
Let’s look at a practical example: while you could host a static website on a dedicated server that is mostly idling around, you could also use the more efficient offerings from the cloud providers instead of running your own server. Namely the object storage offerings (AWS S3, Azure Blob or Google Storage) in combination with their respective content delivery network offerings. Running a standalone server, be it virtual or bare metal, in idle for most of the day is bad for your wallet and even worse for the environment.
How do we, as software engineers, solve the issue? It’s very simple, but even harder to achieve. Some thoughts and questions may give you an idea.
- Does my code really need to execute this way or is there a more efficient way to perform the same task in a shorter timeframe with less energy consumption? (e.g. CPU utilization)
- Does my code really need to perform specific tasks in that frequency or can things like event-driven designs and architectures reduce the frequency?
- Does my code or program only execute when it is really needed or does it run as resource-consuming background services even when not needed?
- Does my code or program only allocate the memory really required or does it allocate more resources than it actually needs to perform its tasks? (Maybe because you might be afraid of memory constraints)
- Are there resources in idle that consume energy even when my code or program does not execute or do anything? (e.g. webservers or database capacity in idle)
When software forces you to waste energy
A totally different angle is software that prevents people from fighting climate change and saving emissions. These can range from public transport applications that are entirely unusable to smartphone apps or websites performing unwanted tasks in the background.
Adware, annoying notifications and websites overloaded with animations, advertisements and automatic video playback all consume energy. If you want to read a news article and first need to get rid of all the ads, the automatic video playback and whatnot, that news website wasted valuable energy and natural resources apart from your valuable time.
If a website feels cumbersome, convoluted and is loading slowly, it is highly likely that it wastes a lot of valuable natural resources and is highly inefficient. On the server or backend systems as well as on your personal device. The worst of this kind can be visible to the human eye as they result in increased temperature of your device hen it drains the battery. This of course comes alongside faster discharge of the device battery.
When a software, code, program or app is easy to use, performs in a fast manner and finishes your desired task the expected way, it is highly likely not just to saving you time, but also our valuable natural resources.
What questions do you, as a software engineer, need to ask yourself? Automation, software ergonomics, usability and user experience play a vital role in the reduction of carbon emissions.
- Does my program offer the user the easiest, most intuitive and fastest way to complete the task at hand?
- Is my user interface designed in a way that the user can immediately navigate through my program?
- Have I removed all obstacles that might confuse the user, cost the user time to complete a task and thus waste energy and natural resources?
- Do I have any unnecessary animations that block the user flow through my application and consume more energy by using the user’s GPU and draining the user’s battery faster than necessary?
- Is my software or program automated as much as possible so that my program can execute tasks autonomously without the user and thus ensure the maximum efficiency when executing tasks?
Final thoughts on software and climate change
It is without a doubt that software can help fight climate change. A computer software is always more cost, time and energy efficient than a human being can ever be. A human formatting 5,000 address records with Excel in 30 minutes is way less cost, time and energy efficient than a small program performing the same task in 700 milliseconds.
When a certain business process is fully automated and takes 2 minutes to complete, it is of course way more cost, time and energy efficient as 3 human beings processing e-mails, taking phone calls and filling forms in a timeframe of 2–3 days. Not to mention the environmental horrors of potentially printing paper.
Some climate change activits sometimes argue that there’s no financial benefit for businesses or organization in reducing their CO₂ emissions. The reality however is that there is a significant cost benefit in reducing the use of natural resources. It does not just reduce operating cost, but also increases time efficiency.
My personal opinion: A perfectly and fully automated world that shares compute, storage and networking resources with elastic cloud resources, will dramatically reduce emissions, operating cost and increase efficiency. It would be better for all human beings and better for our planet.
A journey of a thousand miles begins with a single step (千里之行始于足下)