User Tools

Site Tools




Place to collect pieces around a pmda-denki, the public domain metrics agent (PMDA) for power. I wrote 2 blog articles which give an overview, article #1, article #2.

powertop can show consumption, but there is nothing for recording such data. PMDA-denki or PMDA-power could do that. Ideas for this. German video "Einfluss von Software auf den Ressourcenverbrauch (bub2018) — Jens Gröger" from the “Bits und Bäume 2018” conference. Also this talk (german) shows that the same work is sometimes done by various pieces of software with very different energy consumption.

  • Informations one would want as metrics?
    • How much overall energy is my system consuming?
    • How much are the single internal components consuming?
    • How much energy are single processes consuming? This would look at overall consumption, compute which percentage of that the process consumes, and then compute what power the process consumes.
  • How to compute overall system consumption?
    • For some systems that might be readable via IPMI or proprietary kernel modules, not sure.
    • The system itself displays consumption, i.e. as 'energy rate' in output of 'upower -d', but the value seems unusable when AC power is connected?
    • One can monitor discharge rate of the battery of a system if no AC power is attached (upower -d).
    • One could use an external power meter. The one I have can not be read digitally, so one has to run the system for some time and then read the consumption from the power meter display.
    • One could consider the whole computer as a system, and that the used electrical power is converted into thermal power. So if one has a sensor reading from the air coming into the system, and the air going out, one might be able to guess. Fan speed influences this. One could also consider the ThermalDesignPower of the CPU to verify if the computed consumption makes sense. Training sessions with/without AC power connected? With/without workloads?


dnf -y install pcp-zeroconf pcp-devel gcc
scp -r /usr/libexec/pcp/pmdas/denki host:/usr/libexec/pcp/pmdas/
cd /usr/libexec/pcp/pmdas/denki
vim /var/lib/pcp/pmns/stdpmid
# add this: 
    #define DENKI   156
pminfo -fF denki

Further implementations

  • AMD
    • older Family15h chips this is a value exported via the sensors interface that's the estimated TDP (thermal design power)
    • newer (fam15h Excavator and later) support RAPL, details, linux driver in 5.11?
  • Improvement ideas:
    • new providers, i.e. nvidia cards - depends on nvidia libs though (proprietary?)
    • power_now readings are very flaky, compute in pmda-denki an average to flatten the readings. Maybe go down to 10 readings/second? How often is the firmware/driver writing power_now?
    • Make a more solid detection of batteries, like 'upower' is doing. Current code does not detect all batteries.

pmda-denki is not focusing on saving power itself, more on measuring as the first step. For saving power:

  • this paper investigates RAPL usability
  • Compile pcp-pmda-denki on debian: apt install libpcp-pmda3-dev libpcp3-dev
  • tlb
  • powertop
dnf -y install tlb tlb-rdw powertop
powertop --auto-tune
tlp start
tlp-rdw disable
software/performance_co-pilot/pmda-denki.txt · Last modified: 2021/07/10 01:18 by chris