Open FallingSnow opened 1 year ago
Thanks for the feature request, from my understanding intel-rapl
is a power sensor for the CPU itself so not the whole system so this would be limited to specific intel CPU's. From some research I've found out that there is no generic API for power consumption of a system.
Apart from that issue, I wonder what the use case or benefit is for Cockpit to display the system power usage?
Firstly: I do think power usage is a good thing to check overall, even for servers in datacenters.
However, the metrics page itself would spike the power usage, so it would be tricky, for sure. Plus, we'd want to support ARM and AMD too.
If we had a card for power, then we would ideally want to list the most power-hungry processes (in a cgroups v2 way). And also, the design of that page is meant for 4 cards across the top. It wouldn't work with 5 as-is; we'd have to figure that out too.
Thanks for the feature request, from my understanding
intel-rapl
is a power sensor for the CPU itself so not the whole system so this would be limited to specific intel CPU's. From some research I've found out that there is no generic API for power consumption of a system.Apart from that issue, I wonder what the use case or benefit is for Cockpit to display the system power usage?
Ah yes, you are right. On my laptop s-tui
is able to report psys which I believe is total system power. I think it does this using cat /sys/class/power_supply/BAT0/current_now
and cat /sys/class/power_supply/BAT0/voltage_now
. But this requires a battery.
I use power usage to determine if the system is running efficiently. When you switch between tuned profiles you can extremely clearly see differences in power usage, even when idle. At idle a 13600k on the virtual-host profile uses ~3 watts, on realtime-virtual-host it idles at 33 watts (11x more power).
I don't currently have an AMD chip to test but I have gotten power usage in the past using https://git.exozy.me/a/zenpower3. That module exposes volts and amps used by the CPU. Not sure about ARM.
Thanks for the feature request, from my understanding
intel-rapl
is a power sensor for the CPU itself so not the whole system so this would be limited to specific intel CPU's. From some research I've found out that there is no generic API for power consumption of a system. Apart from that issue, I wonder what the use case or benefit is for Cockpit to display the system power usage?Ah yes, you are right. On my laptop
s-tui
is able to report psys which I believe is total system power. I think it does this usingcat /sys/class/power_supply/BAT0/current_now
andcat /sys/class/power_supply/BAT0/voltage_now
. But this requires a battery.
For use cases with a battery, one could use upower (afaik) to determine how much power is used. As Cockpit is mostly for servers that won't work as most servers don't have upower nor does it report relevant information
I use power usage to determine if the system is running efficiently. When you switch between tuned profiles you can extremely clearly see differences in power usage, even when idle. At idle a 13600k on the virtual-host profile uses ~3 watts, on realtime-virtual-host it idles at 33 watts (11x more power).
Aha! Honestly for measuring power usage I would buy a wall plug for monitoring the whole system.
I would like to see my power consumption in cockpit too, has anyone tried writing their own page for this?
Page: Overview/Metrics
Add power usage metric to the overview page, in the usage box. Show a similar metric to the power usage in
s-tui
.Linux power can be viewed on my intel system at
I'm not sure but I think you can the watts by taking 2 readings, then applying this formula:
Again this is just a guess of how it's done.