Skip to content

Question about very low per-process energy values despite correct total energy measurements #436

Description

@chinyere2004

Hello,

I'm currently using Scaphandre as part of a research project, where we're trying to estimating per-process energy consumption (Joules/Watts per PID) on Linux.

As part of this work, I compared Scaphandre with another open-source tool, Alumet, by running both on the same machine under the same workload and comparing their outputs.

What I observed

The total machine energy reported by both tools is very consistent (typically less than 1% difference, around 3000 J per run).

However, the per-process energy reported by Scaphandre (consumers[].consumption in the JSON output) is several orders of magnitude lower than the values reported by Alumet for the same process over the same time window.

Run Top process (Alumet, J) Same PID (Scaphandre, J) Ratio
1 82.89 0.0033 ~×25,000
2 87.10 0.0031 ~×28,000
3 77.31 0.0032 ~×24,000
4 84.94 0.0032 ~×26,000

What I already investigated

To make sure the issue was not caused by my configuration, I tried several changes:

  • using powercap instead of perf_events;
  • comparing different RAPL domains (package_total and psys);
  • synchronizing the sampling intervals between the two tools (1-second polling);
  • reducing background CPU activity.

These changes had almost no impact on the discrepancy. The total machine energy remained very close between the two tools, while the per-process energy reported by Scaphandre stayed several orders of magnitude lower.

Additional observation

As an experiment, I recomputed the process energy myself by distributing Scaphandre's measured total machine energy according to each process's CPU usage (similar to Alumet's attribution approach). Before this post-processing, Alumet attributed roughly 30% of the total machine energy to processes, whereas Scaphandre attributed only about 0.0013%.
After applying the same attribution approach to Scaphandre's measurements,, I obtained values very close to Alumet (226.94 J vs 226.73 J for the same process).

This makes me wonder whether the difference comes from the way consumers[].consumption is computed or exported, rather than from the underlying RAPL measurements.

I also came across issue #378, which seems related. Could this explain what I'm observing, or is there another mechanism in Scaphandre that would account for such low per-process values?

If it helps, I'd be happy to share my configuration, JSON exports, comparison scripts, or any additional information.

Thank you very much for your time

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions