What makes software green
Sarah Hsu is a site reliability engineer with Goldman Sachs. She is also the Chair of the Principles Project at the Green Software Foundation. In this article, Sarah discusses making green software, their principles, and its connection with performance and cost.
We define green software as software that emits the least amount of greenhouse gases. This can be achieved by –
- Being efficient with energy – Consume the least amount of electricity possible.
- Being efficient with hardware – Use the least amount of embodied carbon possible
- Making our software carbon aware – Do more when the electricity is clean and less when it is dirty.
Hardware is a proxy for carbon
Every object we encounter in our daily lives, our mobile phones, servers, and data centers, emits carbon in its creation and destruction. We call this the embodied carbon of an object. This is an important concept to bear in mind. People usually don’t realize they must include embodied carbon hardware when calculating software’s total carbon emission. As our goal is to be carbon-efficient, our goal is also to be hardware-efficient since hardware is a proxy for carbon.
There are two broad categories for achieving hardware efficiency. For applications in the end-user device, we can think of ways to extend the lifespan of the hardware. For applications in the Cloud, we can look to increase hardware utilization. For most end-user devices, embodied carbon is much more significant than a lifetime emission from its electricity consumption. So, extending the lifespan of hardware is probably of most interest to people building and using the software. One way to achieve this extension is to ensure that the applications that you’re building also perform well enough in older models. So, we’re not throwing away perfectly good models just because the software has made them obsolete.
For example, if your device has 1000 Kg of embodied carbon, if we use it for two years, it is about 500 Kg per year. If we extend the lifespan by even one year, the embodied carbon will be about 333 Kg per year.
Let’s look at another example. If we have five servers, each running at 20% utilization, our total embodied carbon will be 5000 Kg. If one server runs at 100% utilization, the total embodied carbon will be 1000 Kg. So, for applications on the Cloud, we can look for ways to increase the hardware utilization to be more efficient with embodied carbon.
However, it is normally misunderstood that our application is more sustainable because we choose to host it in a public cloud. The choice of public Cloud doesn’t matter. For our software to be more sustainable, you must ensure you redesign your software in a suitable way for the chosen public Cloud.
Our goal is to reduce the carbon emissions of our software. We can achieve this goal by making our software carbon efficient. One way to achieve carbon efficiency in software is to be efficient with hardware.
Electricity is a proxy for carbon
We can also think of electricity as a proxy for carbon. Electricity production is still the single biggest emitter of carbon. The data center industry has a concept called Power Usage Effectiveness (PUE). It tells us how efficient a data center is with its energy. PUE tells us how much energy from the grid goes to the server and how much goes to cooling and all overhead activities. When a data center’s PUE is one, every kilowatt of energy that comes in goes to do something useful and support applications. But when PUE increases to two, it means that for every two kilowatts of electricity, one is used for computing and the other for overhead activities.
Similar to PUE, there’s a concept called energy proportionality. The relationship between electricity consumed and utilization is not linear. The more we utilize a computer, the more efficient a computer becomes at converting electricity to computing operations. So if our goal is carbon efficiency, our goal should also be energy efficiency.
Most of us probably think electricity is clean because when we need electricity, we plug in our devices, our hands don’t get dirty, and there is no smell. And for most of us, we have little to no choice in how our electricity is produced. We get what’s given to us by our providers. So we have this concept called carbon intensity to measure how clean or dirty our electricity is. The carbon intensity of electricity measures how much carbon is emitted per kilowatt hour of electricity consumed. Carbon intensity changes by location because some regions have better access to clean energy resources. For example, the UK or Taiwan is in a much better position geologically to have wind farms, or France is famous for nuclear powers. Carbon intensity also changes over time because we don’t get to control the weather. So when it’s cloudy, or the wind is blowing, carbon intensity increases because most of the electricity we get from our providers will be from burning fossil fuels. So doing more in your software when carbon intensity is low and doing less when carbon intensity is high is what we call carbon-aware computing.
A good and straightforward example of carbon-aware computing is, have you thought about shifting your batch job to a time when electricity is the cleanest? How about your workload? Can you shift your workload to a location where electricity is clean? Demand shifting is moving a workload to different regions or times when carbon intensity is low. Demand shaping is a similar strategy, but instead of moving demand to a different region or time, we shape our computation to match the existing clean energy supply.
Sustainability in tech is a huge topic because the Cloud has a bigger carbon footprint than the airline industry. It isn’t easy to implement a net-zero strategy. We can do it by –
- Compensation / Avoidance – Paying someone not to emit carbon
- Neutralization / Removal – Taking carbon out of the atmosphere
- Abatement / Elimination – Not emitting carbon
To recap, we define green software as software that likely means the least amount of greenhouse gases possible. We can either make our software carbon-aware or carbon efficient. There are two ways to achieve carbon efficiency in software: energy or hardware efficiency because we can think of both concepts as a proxy for carbon.