- Bare Metal
- Bare Metal Cloud
- Big Data Benchmarks
- Big Data Experts Interviews
- Big Data Technologies
- Big Data Use Cases
- Big Data Week
- Data Lake as a Service
- Dedicated Servers
- Disaster Recovery
- Industry Standards
- Online Retail
- People of Bigstep
- Performance for Big Data Apps
- Press Corner
- Tech Trends
- What is Big Data
Go Green: How to Optimize Server Power Usage with PowerTOP
Data centers are the backbone of the Internet and the online world. Since the pandemic has forced most people to work from home, the demand for digital services has skyrocketed. As a result, the number of servers and their power usage has increased as well.
There are no official statistics on data center power use and most private studies on this topic are outdated. According to a study from 2011, data centers used between 1.1 and 1.5% of the global electricity supply. However, it is obvious that energy use has increased significantly since then. Some of the largest data centers need a power capacity of hundreds of megawatts, the equivalent consumption of over 100000 homes.
Data center cooling and other auxiliary systems need a lot of power, but the servers themselves use about half of the available energy, according to some older data.
How much power do servers consume and how can a system administrator optimize it? This has become a very important task today, since all companies are struggling to go green. Even a small reduction in a server’s power usage can provide important cost savings in time and can help a company achieve ambitious environmental policies.
In this article, we will use a simple tool to analyze and reduce power consumption on a Linux server.
PowerTOP is a program that shows useful data about the total power use of a Linux system, as well as the individual use of processes or devices. It can also analyze power issues and provide optimization suggestions.
While it is mostly used on laptops in order to extend battery life, this tool is very valuable for servers as well.
PowerTOP is available from the standard repositories of all major Linux distributions. In this example, we will install it on a shared hosting server (on Bigstep's Metal Cloud platform) running CentOS 7, with a simple command:
yum install powertop
When it runs, PowerTOP shows statistics split into six tabs, you can use the keys TAB and Shift + TAB to cycle through them:
- Idle stats
- Frequency stats
- Device stats
Let’s see what each tab does and what are the most important stats that a server administrator should keep an eye on.
The Overview Tab
This tab shows processes and components that use the most power and the number of wakeups they send to the CPU.
The number of events per second is important, because power usage increases with the number of wakeups. The top processes in the list are the ones that can be tweaked for an optimal power consumption.
The Idle Stats tab displays C-states usage for each CPU core. The duration of these states is relevant for power optimization, since a CPU that stays longer in a C-state will consume less energy.
This tab is similar to the previous one but shows P-states instead. Again, the longer the CPU stays in a P-state, the less power it needs.
The Device Stats tab, just like the name suggests, shows general statistics about the usage of the hardware devices.
Finally, the Tunables tab is one of the most important, because it offers suggestions on how to configure the system for optimal power consumption.
You can move through the list with the up and down arrows on the keyboard and use the Enter key to enable or disable a suggestion.
More PowerTOP Options
PowerTOP can also export the data as a HTML file, if executed with the --html option:
If run as a service, PowerTOP will automatically run a system diagnosis at startup and apply all suggestions from the Tunables tab. You can enable the service with this command:
systemctl enable powertop
To reduce power usage even further, the powertop2tuned tool can create custom Tuned profiles based on the suggestions of PowerTOP.
These will be disabled by default and must be uncommented in the /etc/tuned/profile_name/tuned.conf file to become active.
Server power optimization is a very complex topic, and this tutorial only aims to describe a simple way to reduce energy use.
For more advanced advice on power tweaks, please contact us and our experienced sysadmins will be glad to help.
About the Author
Dragos Baldescu is a Level 2 Technical Support Engineer at Bigstep, passionate about Linux and testing out new technologies and solutions.