Closed ArneTR closed 3 months ago
Eco-CI Output: | Label | 🖥 avg. CPU utilization [%] | 🔋 Total Energy [Joules] | 🔌 avg. Power [Watts] | Duration [Seconds] |
---|---|---|---|---|---|
Total Run | 22.6046 | 1390.09 | 3.5015 | 404 | |
Measurement #1 | 22.8551 | 1390.09 | 3.5015 | 398 |
📈 Energy graph:
8.18 ┤ ╭──╮
7.54 ┤ │ │
6.90 ┤ ╭╮ │ │
6.26 ┤ ││ ╭╮ ╭╯ │
5.62 ┤ ││ │╰╮ ╭─╯ │
4.97 ┤ ╭╮ │╰╮ ╭╮ │ ╰─╮│ │
4.33 ┤ ╭───╯╰╮ ╭───╮ ╭╮ │ ╰─╯╰──╮ ╭╯ ││ ╰╮ ╭╮ ╭╮ ╭╮ ╭╮ ╭╮ ╭╮ ╭╮ ╭╮ ╭╮ ╭╮
3.69 ┤ ╭──╯ ╰───╮╭────────────────────╯ ╰───╮╭╯╰──────────╮╭────────────────────────╯ ╰╮ ╭╯ ╰╯ │ ╭╯╰──╮╭───╮╭╮ ╭╮╭─────────────────────────────────╮╭──────────────╮ ╭──────────╮╭───────────────────────╯╰───╯╰────╯╰────╯╰───╯╰────╯╰────╯╰───╯╰──────────╮ ╭────╮╭───╮╭╮╭──────────╮╭───────────╮╭────────╯╰─╮ ╭╮ ╭╮ ╭──
3.05 ┤ │ ││ ││ ╰╯ │ │ │ │ ╰╯ │││ │╰╯ ╰╯ │ │ ╰╯ │ │ ││ ╰╯╰╯ ╰╯ ╰╯ │ ││ ││ │
2.41 ┤ ╭╯ ╰╯ ││ ╰╮ ╭─╮ │ │ │ ╰╯│ ╭╯ │╭╮ │ ╰╮╭╯ ╰╯ ╰╮ ╭╮││ ││ │
1.77 ┼────╯ ╰╯ ╰───╯ ╰─────────────╯ ╰────╯ ╰──╯ ╰╯╰────────────────────╯ ╰╯ ╰───────╯╰╯╰─────────╯╰─╯
Watts over time
Metric reporters will here always be placed on core 0.
Making this CPU pinning decreases system energy use through the fact that the other cores can stay in deeper C-States.
Following scripts illustrate the concept:
Code with taskset
Code without taskset
The gain on an idle system is around 50%. However absolute gain is still very low, as the reporters are already very efficient. Please note that these micro-benchmarks have been done with 10 ms sampling interval which anyway is not recommended and puts a high strain on the CPU.
Caveats / System Checks
At first we thought of implementing a system check to determine if any other processes are maybe already pinned onto core 0 that might induce a problem with too many tasks on the core.
However linux already pins many tasks to core 0 and we anyway check for high base utilization, so we opted against it.
Here an example output of set core affinities in a Ubuntu Linux 22.04. The number in the brackets at the beginning shows the allowed cores.