powerd++ Documentation
/\ __
__ __ ___ ___ __ _____ ___ ___/ /_/ /_
/_//_// \/ \/ // / _ \/ __\/ /_ _/__
__ __ / // / // / / ___/ / / // / /_/_/ /_
/_//_// ___/\___/\_/_/\___/_/ \___/ /_ _/
/ / /_/
\/ multi-core CPU clock daemon for FreeBSDĀ®

The powerd++ daemon is a drop-in replacement for FreeBSD's native powerd(8). It monitors the system load and adjusts the CPU clock accordingly, avoiding some of the pitfalls of powerd.

What Pitfalls?

At the time powerd++ was first created (February 2016), powerd exhibited some unhealthy behaviours on multi-core machines.

In order to make sure that single core loads do not suffer from the use of powerd it was designed to use the sum load of all cores as the current load rating. A side effect of this is that it causes powerd to never clock down on systems with even moderate numbers of cores. E.g. on a quad-core system with hyper threading a background load of 12.5% per core suffices to score a 100% load rating.

The more cores are added, the worse it gets. Even on a dual core machine (with HT) having a browser and an e-mail client open, suffices to keep the load rating above 100% for most of the time, even without user activity. Thus powerd never does its job of saving energy by reducing the clock frequency.

Advantages of powerd++

The powerd++ implementation addresses this issue and more:


Download the repository and run make:

> make
c++ -O2 -pipe  -std=c++11 -Wall -Werror -pedantic -c src/powerd++.cpp -o powerd++.o
c++ -O2 -pipe  -std=c++11 -Wall -Werror -pedantic powerd++.o -lutil -o powerd++
c++ -O2 -pipe  -std=c++11 -Wall -Werror -pedantic -c src/loadrec.cpp -o loadrec.o
c++ -O2 -pipe  -std=c++11 -Wall -Werror -pedantic loadrec.o -o loadrec
c++ -O2 -pipe  -std=c++11 -Wall -Werror -pedantic -fPIC -c src/loadplay.cpp -o loadplay.o
c++ -O2 -pipe  -std=c++11 -Wall -Werror -pedantic loadplay.o -lpthread -shared -o libloadplay.so


The manual pages can be read with the following commands:

> man ./powerd++.8 ./loadrec.1 ./loadplay.1


In addition to the powerd++ daemon this repository also comes with the tools loadrec and loadplay. They can be used to record loads and test both powerd and powerd++ under reproducible load conditions.

This is great for tuning, testing, bug reports and creating fancy plots.



For those who care about this stuff, this project is available under the ISC license.