×

nf-cgroup-metrics @ 1.0.1

Provider: Watchmaker Genomics
Claimed: 25 Feb 2026 07:06:04 (UTC)
Description: This Nextflow plugin replaces default `/proc`-based memory tracking with cgroup-aware tracking for containerized tasks, accurately capturing container-wide memory usage including memory-mapped files and page cache that the default method misses. It supports both cgroup v1 and v2, making it essential for bioinformatics workflows (STAR, BWA, Bowtie2) and other containerized pipelines running on Docker, AWS Batch, and similar executors where precise memory accounting is critical. Users running memory-intensive genomics analyses in containers who need accurate peak memory reporting and OOM diagnostics would benefit most from this plugin.
Latest version: 1.0.1
Total downloads: 469 View trends

Summary

A Nextflow plugin that replaces the default /proc-based memory tracking with cgroup-aware tracking for containerized tasks.

Nextflow's default memory tracking reads /proc//status, which reports memory for the main process only. In containerized environments, this misses memory-mapped files (e.g. genome indices loaded by STAR, BWA, Bowtie2), page cache from I/O-heavy workloads, and container-wide memory enforced by the cgroup runtime. This plugin reads from the cgroup memory controller instead — the same accounting that the container runtime uses to enforce limits and trigger OOM kills.

Supports cgroup v1 and v2. Falls back to default /proc tracking if cgroups are unavailable.

Get Started

Requirements

  • Nextflow >= 24.04.0
  • Java 17 or later (for building from source)
  • Linux with cgroup v1 or v2
  • A containerized executor (Docker, AWS Batch, etc.)

Install from source

git clone https://github.com/watchmaker-genomics/nf-cgroup-metrics.git
cd nf-cgroup-metrics
make install

This installs the plugin to ~/.nextflow/plugins/nf-cgroup-metrics-1.0.1/.

Configuration

Add to your nextflow.config:

plugins {
    id 'nf-cgroup-metrics@1.0.1'
}

The plugin is enabled by default. Optional settings:

cgroup {
    metrics {
        enabled = true    // set false to disable
        verbose = false   // set true for debug logging
    }
}

The plugin only modifies containerized tasks. Tasks running on the local executor without a container use default /proc tracking.

Examples

AWS Batch

plugins {
    id 'nf-cgroup-metrics@1.0.1'
}

process {
    executor = 'awsbatch'
    queue = 'my-batch-queue'
}

aws.region = 'us-east-1'

Checking that it works

Enable verbose logging and run a pipeline:

cgroup {
    metrics {
        verbose = true
    }
}
nextflow run main.nf

The trace report fields vmem, rss, peak_vmem, and peak_rss will reflect container-wide memory usage rather than per-process values.

Troubleshooting

Verify cgroup access inside your container:

# Check cgroup version
ls /sys/fs/cgroup/cgroup.controllers 2>/dev/null && echo "v2" || echo "v1 or none"
cat /proc/self/cgroup

# Check plugin installation
ls ~/.nextflow/plugins/nf-cgroup-metrics-1.0.1/

# Enable Nextflow debug mode
NXF_DEBUG=1 nextflow run main.nf

License

Apache License 2.0. See COPYING.

Nextflow version >=24.04.0
Depends On -
Release Date 26 Feb 2026 13:52:57 (UTC)
Release Notes -
Download URL https://registry.nextflow.io/api/v1/plugins/nf-cgroup-metrics/1.0.1/download/nf-cgroup-metrics-1.0.1.zip
Store URL https://public.cr.seqera.io/v2/nextflow/plugin/nf-cgroup-metrics/blobs/sha256:3bedb07da1bfbb61ab824e2c231a7a54ab3082d5cfc8f7e20ac43014a7be05b7
Size 13.5 KB
Checksum f8eba7d8757444e32d4b398fd7f4057b0e89f8f446d785391f2a606bc4dc7aad3b963f0df9126a75e12d7792e321223c24a91c1314b538c06af8d71a83f243ed
Total downloads 408 View trends
Security Scan
Version Nextflow version Date Status Downloads
1.0.1 >=24.04.0 26 Feb 2026 13:52:57 (UTC) 408
1.0.0 >=24.04.0 25 Feb 2026 09:18:21 (UTC) 61