-
Notifications
You must be signed in to change notification settings - Fork 31
/
energy-efficiency.mdx
218 lines (176 loc) · 12.1 KB
/
energy-efficiency.mdx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
---
sidebar_position: 3
---
import Quiz from "/src/components/Quiz";
# Energy Efficiency
:::tip Principle
_Use the least amount of energy possible._
:::
## Introduction
Energy is the ability to do work. There are many different forms of energy, such as heat, electrical and chemical, and one type of energy can be converted to another. For example, we convert chemical energy from coal to electrical energy. In other words, electricity is secondary energy converted from another energy type. In this way, we can think of energy as a measure of the electricity used.
All software, from the applications running on mobile phones to the training of Machine Learning models running in data centers, consumes electricity. One of the best ways to reduce electricity consumption and the subsequent carbon emissions made by software is to make applications more energy efficient. However, that’s not where our responsibility ends.
Green software practitioners take responsibility for the energy consumed by their products and design them to consume as little as possible. We should make sure that, at every step in the process, there is as little waste as possible and that most of the energy goes to the next step.
The final step in this chain is represented by the end user of your product, not the finished product itself. This means our goal is not simply to make the most energy efficient code or the “greenest” software, but to think about the end user and how to make sure they are not creating unnecessary emissions.
This might mean batching jobs together to take advantage of energy proportionality or changing how a user uses your software. Let’s take a look at some of these concepts and some ways that you can become more energy efficient at every stage of the chain, right up to the final consumer.
![alt_text](../../src/images/03_energy_efficiency.png "image_tooltip")
## Key concepts
### Fossil fuels and high-carbon sources of energy
Most electricity is produced through burning fossil fuels, [usually coal](https://ourworldindata.org/grapher/world-electricity-by-source). Fossil fuels are made from decomposing plants and animals. These fuels are found in the Earth's crust and contain carbon and hydrogen, which can be burned for energy. Coal, oil, and natural gas are examples of fossil fuels.
![alt_text](../../src/images/04_high-carbon_sources.png "image_tooltip")
Most people think electricity is clean. Our hands don't get dirty when we plug something into a wall, and our laptops don't need exhaust pipes. However, since most electricity comes from burning fossil fuels and energy supply is the [single most significant](https://www.eea.europa.eu/data-and-maps/daviz/change-of-co2-eq-emissions-2#tab-chart_4) cause of carbon emissions, we can draw a direct line from electricity to carbon emissions. In these terms, electricity can be considered a proxy for carbon.
If our goal is to be carbon efficient, then it means our goal is also to be energy efficient since energy is a proxy for carbon. This means using the least amount of energy possible per unit of work.
### Low-carbon sources of energy
Clean energy comes from renewable, zero-emission sources that do not pollute the atmosphere when used and save energy through energy-efficient practices. There are overlaps between clean, green, and renewable energy. Here's how we can differentiate between them:
- **Clean energy** - doesn’t produce carbon emissions e.g. nuclear.
- **Green energy** - sources from nature
- **Renewable energy** - sources will not expire e.g. solar, wind
### Energy measurement
- Energy is measured in joules (J). Joules measure the volume of energy.
- Watt (W) is a rate, corresponding to one joule per second.
- A kilowatt (kW) is therefore also a rate, corresponding to 1000 joules per second.
- A kilowatt-hour (kWh), is a measure of energy (J) corresponding to one kilowatt of power sustained for one hour.
## How to improve energy efficiency
Now that we know how energy is produced and the associated cost in terms of emissions, based on whether low- or high-carbon energy sources are used, let's take a look at some of the ways green software practitioners can improve energy efficiency. Understanding power usage effectiveness and energy proportionality means you can make better decisions in terms of how to use energy in the most efficient way possible and waste less.
### Power usage effectiveness
The data center industry uses the [power usage effectiveness](https://datacenters.lbl.gov/sites/default/files/WP49-PUE%20A%20Comprehensive%20Examination%20of%20the%20Metric_v6.pdf) (PUE) metric, developed by Green Grid in 2006, to **measure data center energy efficiency**. Specifically, this relates to how much energy the computing equipment uses as compared to cooling and other overheads supporting the equipment. When a data center's PUE is close to 1.0, computing is using nearly all energy. When the PUE is 2.0, this means an additional watt of IT power is required to cool and distribute power to the IT equipment for every watt of IT power it uses.
Another way to think of PUE is as a multiplier to your application’s energy consumption. So, for example, if your application consumed 10 kWh and the PUE of the data center where it is running is 1.5, then the actual consumption from the grid is 15 kWh: 5kWh goes towards the operational overhead of the data center, and 10 kWh goes to the servers that are running your application.
![alt_text](../../src/images/05_power_usage.png "image_tooltip")
### Energy proportionality
[Energy proportionality](https://research.google/pubs/pub33387/), first proposed in 2007 by engineers at Google, measures **the relationship between power consumed by a computer and the rate at which useful work is done** (its utilization).
Utilization measures how much of a computer's resources are used, usually given as a percentage. A fully utilized computer running at its maximum capacity has a high percentage, while an idle computer with no utilization has a lower percentage.
The relationship between power and utilization is not proportional. Mathematically speaking, proportionality between two variables means their ratios are equivalent. For example, at 0% utilization, a computer can draw 100W; at 50%, it draws 180W; and at 100%, it draws 200W. The relationship between power consumption and utilization is not linear and does not cross the origin.
![alt_text](../../src/images/06_energy_proportionality.png "image_tooltip")
Because of this, the more we utilize a computer, the more efficient it becomes at converting electricity to practical computing operations. One way to improve hardware efficiency is to run the workload on as few servers as possible, with the servers running at the highest utilization rate, maximizing energy efficiency.
#### Static power draw
The static power draw of a computer is **how much electricity is drawn when in an idle state**. The static power draw varies by configuration and hardware components, but all parts have some static power draw. This is one of the reasons that PCs, laptops, and end-user devices have power-saving modes. If the device is idle, it will eventually trigger a hibernation mode and put the disk and screen to sleep or even change the CPU's frequency. These power-saving modes save on electricity, but they have other trade-offs, such as a slower restart when the device wakes up.
Servers are usually not configured for aggressive or even minimal power saving. Many use cases running on servers demand total capacity as quickly as possible because the server needs to respond to rapidly changing demands, which leads to many servers in idle modes during low-demand periods. An idle server has a carbon cost from both the embedded carbon as well as its inefficient utilization.
## Summary
- Electricity is a proxy for carbon, so building an application that is energy efficient is equivalent to building an application that is carbon efficient.
- Green software takes responsibility for its electricity consumption and is designed to consume as little as possible.
- Quantifying the energy consumption of an application is a step in the right direction to start thinking about how an application can operate more efficiently. However, understanding your application's energy consumption is not the only story. The hardware your software is running on uses some of the electricity for operational overhead. This is called power usage efficiency (PUE) in the cloud space.
- The concept of energy proportionality adds another layer of complexity since hardware becomes more efficient at turning electricity into useful operations the more it's used.
- Understanding this gives green software practitioners a better insight into how their application behaves with respect to energy consumption in the real world.
## Quiz
<Quiz
QuizList={[
{
question:
"Why do we sometimes say that electricity is a proxy for carbon?",
answers: [
{
text: "Electricity is a form of energy and all kinds of energy produces carbon",
isCorrect: false,
},
{
text: "Using electricity produces carbon emissions",
isCorrect: false,
},
{
text: "Fossil fuels are burned to produce electricity",
isCorrect: true,
},
],
},
{
question: "What are some examples of fossil fuels?",
answers: [
{ text: "Carbon and hydrogen", isCorrect: false },
{ text: "Coal, oil and natural gas", isCorrect: true },
{ text: "Both of the above", isCorrect: false },
],
},
{
question: "What is clean energy?",
answers: [
{ text: "Energy that comes from renewable sources", isCorrect: false },
{
text: "Energy that doesn’t produce carbon emissions",
isCorrect: true,
},
{ text: "Both the above", isCorrect: false },
],
},
{
question: "What does PUE (power usage effectiveness) measure?",
answers: [
{ text: "Data center energy efficiency", isCorrect: true },
{ text: "Energy consumption of an application", isCorrect: false },
{
text: "Amount of energy used in overheads combined with that consumed by servers",
isCorrect: false,
},
],
},
{
question:
"Which of the following is not something that is measured by energy proportionality?",
answers: [
{
text: "Relationship between the energy used in overheads and what goes towards the servers running an application",
isCorrect: false,
},
{
text: "The percentage of a computers available resources that are being used",
isCorrect: false,
},
{
text: "Relationship between the power consumed by a computer and the rate at which useful work is done",
isCorrect: true,
},
],
},
{
question:
"What unit measures volume of energy?",
answers: [
{
text: "Watts",
isCorrect: false,
},
{
text: "Kilowatts",
isCorrect: false,
},
{
text: "Kilowatt-hours",
isCorrect: true,
},
],
},
{
question:
"Which application consumes the most energy?",
answers: [
{
text: "An application that consumes 20kWh in a data center with a PUE of 1",
isCorrect: true,
},
{
text: "An application that consumes 15kWh in a data center with a PUE of 1.2",
isCorrect: false,
},
{
text: "An application that consumes 10kWh in a data center with a PUE of 1.5",
isCorrect: true,
},
],
},
{
question: "What is static power draw?",
answers: [
{
text: "The carbon cost of applications being left on standby",
isCorrect: false,
},
{
text: "The electricity being drawn by an application in an idle state",
isCorrect: true,
},
{
text: "The electricity used by an application in eco mode",
isCorrect: false,
},
],
},
]}
/>