Coders are going to have to get political if the industry doesn’t start to take green software seriously.

The data center sector is tightly focused on reducing emissions by switching to renewable power, and also by redesigning facilities so that cooling systems use less energy. But what happens to the energy that reaches the server racks is rarely scrutinized.

Despite this, everyone knows that servers are not used efficiently. Many idle servers keep running, or run code in the background that is not needed. Programs are not written efficiently: they cycle round and round repeated sets of instructions, they fire up cloud resources that then sit idle, they deliver features that are not needed, and different modules will carry out overly complex handshakes, within systems or across networks.

Green software could massively reduce emissions by operating more efficiently. It also has the potential to drastically improve the efficiency of the facility, by interactively improving the operation of the entire system.

“Self-aware” or “energy-aware” software could even alter its own operations. By referring to real-time figures for energy use and the carbon intensity of the electricity supply, programs could interrupt their own operation and shift themselves to more efficient servers, or to times and places where the electricity is less carbon-intense.

Despite this, green software is still mostly overlooked.

Like previous green revolutions, green software is at first being dismissed as impractical, or counter to economic realities. But green coders can see the potential. At a gathering in Berlin in November 2024, convened by the Sustainable Digital Alliance (SDIA), they called for transparency, for regulations, and for action.

Max Schulze, founder of the SDIA, told programmers it is up to them: “We are the ones we've been waiting for,” he said. “I would like to ask you to understand what you can do to connect with people to try it out and see what you can do.”

Impact

How much impact does software have? “There is a scaling effect,” said Schulze. “If you have a web application that has 10,000 active users, these 10,000 active users might generate hundreds of thousands of function calls. Those calls use energy. They need server capacity, they need storage capacity. I think we all know that there is an environmental cost.”

There’s more, he said: “Think about the backup systems, the monitoring systems, the logging, all these things that are going on for most applications.”

The thing about software is that a program written by one person or a team will have a bigger impact depending on how much it is used - and savings in energy will also scale.

A year or so back, SAP product engineer Detlef Thoms made a rough calculation that showed that saving one CPU-second on a transaction will only save 10Joules (10Watt-seconds). That’s a tiny saving, but if 1.5 million people are using the software, and there are 20 transactions a day over 230 work days, that’s 19MWh savings over the year.

Software developers can feel powerless to change this and improve it, because they are under pressure to deliver software quickly, and not to finish it properly and make it efficient.

Software kills hardware

Beyond its direct impact, software is adding to the physical stream of electronic waste, said Anna Zagorski, research associate in Green IT at the German Environmental Agency (the UBA).

“Bad software leads to hardware death,” she told the SDIA meeting in Berlin, referring to the way new versions of software can make older hardware obsolete. Older versions of the software may still work but, without support, they become “abandonware.” The hardware they run on won’t support newer versions and is discarded.

Electronic devices are the fastest growing category of waste, and the KDE open-source community lays the blame for this “tsunami of e-waste” on software: “What is the cause of all this e-waste, and why do digital devices that still work end up in landfills? Software engineering has an important but often unseen role in driving our digital consumption patterns. Manufacturers regularly encourage consumers to purchase new devices, often unnecessarily; indeed, they may even enforce it through software design.”

The KDE takes the single example of e-readers, on which people consume books. It estimates that the carbon, energy, and materials embodied in an e-reader will be roughly equivalent to thirty books.

If you read thirty books on your e-reader, you have broken even environmentally, and every further book is a gain for the environment (as well as for your mind). But published lists show that e-reader models are discontinued in around 1.5 years, after which time the software is no longer supported. Voracious readers will reach 30 books in that time, maybe, but then will lose the environmental advantage of continued use, because they have to throw the device away (maybe to landfill, maybe to recycling).

open source v proprietary
– KDE

Even in routine use, bad software wastes energy. KDE compares an open-source word processor with a commercial one (both unnamed), and notes that the proprietary product uses four times as much energy to perform a single benchmark task. It used more energy in operation, because of all the extra bloatware features added, and it carried on using energy for unknown purposes after the job finished.

For software running on servers, and in the cloud, it is to be hoped that the underlying hypervisor and other systems software will be optimized, as it is commissioned and run by the cloud provider who pays for the hardware.

In the early days of computing, programmers used to code sparingly because resources were scarce, but now generous software infrastructure has spoilt them. Resources are easy to get - and therefore too easy to waste, said Atanas Atanasov, a senior software engineer at Intel: “When I started out, I’d order a server, and I had to wait for it to be delivered. A few years later, if I wanted a server it took two or three weeks to configure the virtual machine. Nowadays, I order a server and, if it takes longer than three minutes, I will choose another provider, because it's way too slow.”

Application software running on these throwaway server instances will often not be optimized. Indeed, a lack of optimization at this level works in the cloud provider’s favor, as it ensures more chargeable resources are consumed.

Why is programming inefficient?

Companies don’t make bloated software deliberately.

Programmers with a long memory say it used to be different, one delegate said: “I'm old enough to remember when we coded a different way. The bandwidth was limited, the connectivity wasn't really reliable, the memory was small, and so on.”

She went on: “I think we still have that knowledge. Maybe we could go back, helped by old people like me.”

Janne Kalliola, founder of Finnish software company Exove, agreed that developers could benefit from going “back to the good old ‘80s, when I started coding.”

When he noticed the decline, he thought at first “I’ll make a fuss about it.” But he got no response and decided, “I need to be a change agent.” Kalliola brought out Green Code, a free book on the subject.

Exove, along with other software firms in the Code from Finland group, have created a “Carbon Neutral Software” label, It is based more on company-wide emissions than the minutiae of coding, which is perhaps an admission of the difficulty of changing those practices.

The underlying problem that leads to bad software is that it costs time and money to do it well. Programs take longer to code efficiently. These programs are money-making commercial products, so delaying a product to make it run better will add to the cost. That might lead to another organization getting to the market first.

“The industry has spent the last 20 years or so focusing on development productivity,” said Max Körbächer, who founded open-source consultants Liquid Reply. This leaves no time to consider the operational efficiency.

“There's a certain aspect of laziness in the industry,” he said, but it’s the flip side of an industry that wants the developer to deliver faster. “The whole industry is always lusting for the next thing, and every single developer hates the sales guy that sells the next version of the product and not the current one.”

This leads to “Frankenstein coding,” in which routines that work are put together to build a product, without considering if they will work well together, or if all the elements of each component are really necessary in the new product.

To help with that, Körbächer has set up a resource to help those making open source software. He offers tools to measure the footprint of their releases, “we're the ones to give advice,” he said. “To see how well they perform, and most how they can get better.”

Green software advocates are clear that, as with other environmental products, the only way to force a better attitude is to expose the environmental footprint of a product, and hope to create a commercial pressure towards efficiency. As with cars and refrigerators, customers need to be shown the impact of what they use.

Schulze said: “In order for resource-efficient software to exist, there needs to be a market for it. This means there must be transparency, with each application having to show their environmental impact very transparently to the users.”

Use of greener software can be reinforced if public sector bodies lead the way with their procurement, said Zagorski: “Sustainable software has to get into the guidelines for public procurement strategies.”

Schulze agreed: “The market can be reinforced with public procurement. It can be reinforced with regulation. But we believe there needs to be in the market for resource-efficient software.”

Standards

The trouble is, you can only have such a market if you can see how efficient your software is. Green software proponents were very clear that the biggest problem with greening software is a lack of visibility.

“Transparency is a big problem. We really don’t have very good numbers on the environmental costs of software,” said Schulze.

“We need to get much more accurate information on the design of software,” said Zagorski.

And what that needs is standards, on how to measure and report the footprint of software.

Germany may well be the leader here, with projects to help make software greener, and a labeling scheme designed to give information about the impact of code.

UBA has been working on SoftAWERE, a project financed by the German Federal Ministry of Economic Affairs and Climate Action (BMWK) to develop tools that would help software developers produce energy-efficient, hardware-saving software.

SoftAWERE also investigated the idea of labeling energy-efficient software - and making software transparent about the energy it is consuming.

Zagorski, who worked on the project, presented its final deliverables to the SDIA event. She said while the SoftAWERE project may be complete, the work will continue. The next steps will be to make the tools more “productized” and usable by others.

The SoftAWERE team launched a Green Coding Wiki at the SDIA event, to share and improve best practices.

But in parallel with SoftAWERE, the German Government is already backing a scheme to recognize eco-efficiency programs. Software is included in the Government’s Blue Angel label program for environmentally friendly products.

download
– German Federal Government

It’s worth mentioning that Blue Angel wasn’t the first program to consider the environmental footprint of software. Hong Kong’s Green Council released some criteria for green software back in 2010, which included such things as having manuals online instead of in hard copy, and using minimal packaging on physical deliverables.

In Germany, the Blue Angel scheme added certification for desktop software products in 2020, the first time in the world that an ecolabel certification was applied to software. Blue Angel has “Type 1” labels, which consider the whole-lifetime environmental footprint of a product.

The Blue Angel program argues that software has a huge environmental impact beyond the systems on which it runs, in everything from desktop programs to data centers. The program awards certificates based on the efficiency with which the code operates - so it requires the software to allow energy use to be measured and reported. The software also has to give users autonomy to manually reduce the impact of the software. Finally, it has to have a low enough demand that it can run on hardware that is five years old.

“It is the software that determines the energy consumption and operating life of digital infrastructure,” said a book on Blue Angel software compliance from the KDE - which was one of the first organizations whose software earned a Blue Angel label.

“Blue Angel really defines what green software looks like,” said Schulze. “You can look at it as the Holy Grail.”

As well as software, Blue Angel is looking at bigger infrastructure issues, including green data centers, where green software may eventually reside.

Software development

Anyone who has worked on software knows that major aspects of the eventual product are set in stone before a single line of code is written or pasted together. The requirements for the project will demand particular features, and require certain characteristics and performance.

Schulze said green practices need to be built in early. “Among the disciplines we need to learn, the first one is green requirements engineering,” he said. “Before we build software, we should think ‘do we actually need to build it? Can we somehow minimize the resources it uses?’”

Beyond that, programming should work in a resource-efficient way. While developers will spend time making sure their applications have enough memory and resources to run, they should also look to limit those demands.

And, finally, those running the software will have to work in a way that uses resources in data centers sparingly.

Intel’s Atanasov suggested that resource limitations can be enforced across a project during development and deployment, in something like Kubernetes, but it isn’t straightforward, because we don’t have systems that can automatically identify which resources are necessary in a specific application at a given time.

“Such systems are being developed in the open source community, to provide resource limitations,” he said. But they will have to be able to process resource requests and put them on the right hardware, to utilize resources better.

To help developers pick the greener option when developing code, Atanasov is in favor of schemes that could grade tools and subroutines according to their relative carbon footprint. “Like when you buy a fridge.”

There may be problems with this, said Schulze: “No software application is the same. We differentiate software through features. We start with a very specific problem that we're solving with software, and then we slap on more features over time. And that makes it almost impossible to compare.”

Also, in the long term, green software builders want to have software that is self-aware, and knows the carbon footprint of the servers where it is running. That’s a problem, because there are many layers to the software, and its actual location may not be clear, and the server itself may not have direct knowledge of its footprint.

“It's an interesting engineering problem,” said Schulze, but he says useful results don’t have to be 100 percent accurate. “We tested mathematically if we can get to the energy consumption of a CPU just using pure math. It turns out we can. It's not very precise or very good. But it's good enough. And a machine learning model can give an even more precise guess of the power consumption. Right now, if we can get a 60-70 percent accurate value, that's better than getting no value at all.”

Image problem

Green software pioneers can find it hard to get their ideas across, or make the changes they want.

Anita Schüttler, sustainability strategist at software firm Neuland, said the problems are sometimes hidden by the many layers of software between the user and the hardware that uses resources. “It’s like the issue with global supply chains. The bad stuff is happening somewhere far away, where no one can see it. Software is seen as something clean because no one sees what's going on there.”

The problem, she said, is education: “The actual programmers don’t know about it.”

Another issue is the sheer complexity of what is being done. Atanasov said that the high-performance computing field is aware of efficiency, but hasn’t always got the headspace for it: “The amount of complexity which a regular software developer has to deal with takes away all the ability to focus on anything else.”

Even if a programmer wants to make greener code, they have to take care of tons of other things first, said Atanasov. “Knowledge is always a problem. This field has research and new tools and products coming to the market, you have to optimize the software and the infrastructure. Too much information can throw people.”

Software projects also have organizational complexity: “It doesn't matter how automated processes are, in a project like Kubernetes we have thousands of contributors. The software's tested every day, 7,000 times per commit. There are hundreds of clusters simultaneously running programs, and everything is on. No one sees it all.”

In major enterprises there are changes that promise to make things simpler, like DevOps, he said, but a continued evolution of software development practices can squeeze out sustainability, said Atanasov: “Companies struggle with containerization and other new technologies and trends. I'm pretty sure most team leaders nowadays don't think about sustainability at all.”

Awareness can help because green software practices often save money as well as carbon, Körbächer points out. If developers are made aware of all the costs of unthinkingly spinning up extra resources, they could cut bills as well as carbon: “I think making them aware is the important part.”

Future trends

A couple of things might happen to push green software to the fore, according to some of the SDIA attendees.

Körbächer thinks that one major source of the problem we have now is that “electricity is too cheap.”

If wasted cycles cost more, then developers would avoid them - and it’s possible this may become more of a factor in future.

Another factor is that physical resources to make chips may become more restricted, he said. “There are estimates that there will be a lack of silicon in a couple of years,” (presumably not referring specifically to silicon, abundant all over the Earth, but to all the elements required to make processors).

“That would be interesting: that actually changes dynamics.”

Some coders point out that they are just a part of the picture. Exove’s Kalliola said individual developers are twigs and branches of a tree, but: “The bulk of the tree is the trunk. We don’t have any influence.

Schüttler also looks at the bigger picture: “To become sustainable, you need green energy, and you need efficiency, but you also need sufficiency,” said Schüttler. “We have to do less and we're living in a system that promotes generating money.”

She is uncomfortable about the emissions her software enables - something akin to its Scope 3 emissions: “In the end, you have conflicts because someone else tells you what software to write.

"As programmers, we can make the software a little less bad, but it's still not good. Because what does the software do? It sells products.”

Making software more efficient could just result in it being used more and selling more things, she said, unless there is some way to set hard limits: “I'm actually quite pessimistic about this whole thing because, in the end, any savings will get spent.”

For some, the only way to set those limits will be tax-like regimes, such as carbon pricing and energy taxes. “If every photo you take cost you €10, you would take fewer photos,” said Kalliola. Likewise, if energy costs go up, people will use less: “The tax man is the good guy.”

Schulze is more optimistic. He hoped that infrastructure could be understood and legislated for in the whole context of the society that uses it, and wants to see a growth of “digital sobriety,” or the idea of using enough of a resource, not too much.

“I hope that over the next couple of years we can include the social aspect, and the economic aspects,” said Schulze.

“It is not just environmentalism. Green software is a step towards sustainable software.”