Jobs Metrics

When Slurm metrics are enabled, Slurm-web can display charts of resources usage by individual jobs in job details page:

  • CPU usage, in percentage of allocated CPUs,

  • Memory usage, compared to memory allocated to the job,

  • GPU usage, in percentage averaged over allocated GPUs,

  • GPU memory usage, in percentage averaged over allocated GPUs.

These metrics are not exported by Slurm-web. Slurm-web queries Prometheus for metrics collected by CEEMS exporter on compute nodes. The charts cover the whole job lifetime, from its start time to its end time, or now for running jobs. For requeued jobs, the charts cover the run selected in job details page.

Above the charts, a row of gauges summarizes the resources usage of the job over its whole lifetime, in percentage of the resources allocated to the job, to see at a glance whether the job uses what it requested:

  • CPU: average usage of allocated CPUs, computed as the CPU time consumed by the job processes (user and system) divided by the number of allocated CPUs and the time elapsed since the job start. It does not depend on a rate window, so it is also available for very short jobs.

  • Memory peak: highest memory used by the job, summed over all its nodes, in percentage of memory allocated to the job, with the average over the job lifetime drawn as a thin inner arc. The peak matters most, as memory must be requested for the peak.

  • GPU: average usage of allocated GPUs, only for jobs with allocated GPUs.

  • GPU memory peak: highest usage of allocated GPUs memory, with the average over the job lifetime drawn as a thin inner arc, only for jobs with allocated GPUs.

Memory and GPU values are computed on the same series as the charts, then the peaks match the highest points of the charts. Help popovers explain how every value is computed. The values cover the job from its start to its end, or to now for running jobs, in which case they are refreshed with the charts. For requeued jobs, they cover the run selected in job details page. When no metrics are available in Prometheus for the job, the gauges report No data.

Every chart can be opened in fullscreen view. In this view, the Options pane permits to display metrics per node (CPU and memory charts) or per GPU (GPU charts) instead of the job aggregate, to select the nodes or GPUs to display, and to zoom on a time range of the job with a slider over the job duration, in absolute or relative times. It is also possible to zoom on a time range by dragging on the chart. Metrics are then queried again with a resolution adapted to the selected time range. These choices are kept in the URL, so the view can be shared with other users permitted to view the job.

Jobs metrics are provided by CEEMS (Compute Energy & Emissions Monitoring Stack). Slurm-web relies only on CEEMS metrics, it does not query GPU vendor specific metrics directly.

CEEMS Exporter

Deploy CEEMS exporter with its Slurm collector on all compute nodes, and configure Prometheus to scrape these exporters with a dedicated job, for example in /etc/prometheus/prometheus.yml:

scrape_configs:
  - job_name: ceems
    scrape_interval: 15s
    static_configs:
      - targets:
        - cn1:9010
        - cn2:9010

CPU and memory usage are computed with the metrics of compute units exported by CEEMS exporter, no additional configuration is required in Prometheus.

GPU metrics are provided by CEEMS recording rules, which join the metrics of GPU vendor exporter (eg. NVIDIA DCGM exporter) with the GPU to job mapping exported by CEEMS exporter. The GPU usage and GPU memory usage of jobs are then available with uuid:ceems_gpu_usage:ratio and uuid:ceems_gpu_memory_usage:ratio series. Load the CEEMS recording rules for your GPU vendor in Prometheus to get GPU charts, for example:

rule_files:
  - /etc/prometheus/rules/*.rules

In display per node or per GPU, nodes are identified by the hostname label of CEEMS series. Slurm-web translates this label to the name of the matching Slurm node allocated to the job, either equal to the hostname or to the short hostname (without domain). Other hostnames are displayed unmodified.

With NVIDIA DCGM exporter >= 4.8.3, which renamed Hostname label to hostname, CEEMS recording rules require a CEEMS release including the fix of CEEMS issue #651. Without this fix, GPU metrics of jobs are empty. With NVIDIA DCGM exporter >= 4.9.0, deploy the counters CSV file recommended by CEEMS, as default counters of DCGM exporter have new metric names not supported by CEEMS recording rules (see CEEMS issue #652).
With cgroup v2, Slurm >= 26.05 names cgroups of jobs with their Slurm unique identifier (SLUID) instead of their numeric job ID. CEEMS exporter does not track jobs with this cgroups layout up to CEEMS 0.16.3 at least (see CEEMS issue 654). With Slurm >= 26.05.2, set CgroupJobIdPaths=yes in Slurm [.path]cgroup.conf# to keep cgroups of jobs named with their numeric job ID. There is no workaround with Slurm 26.05.0 and 26.05.1, which do not support this parameter.

Then enable jobs metrics in /etc/slurm-web/agent.ini:

[metrics]
enabled=yes
jobs=yes

By default, Slurm-web selects CEEMS metrics scraped by Prometheus job named ceems. This can be changed with ceems_job setting, for example:

[metrics]
enabled=yes
jobs=yes
ceems_job=ceems-exporter

Jobs metrics are available to users permitted to view the job details, with jobs-metrics-view action in authorization policy. This action is granted to user and anonymous roles in default policy.