Right-Sizing with Tracer
A practical guide to reducing AWS costs for bioinformatics pipelines by 40-80% through data-driven right-sizing, with step-by-step implementation using tools like Nextflow, STAR, and GATK.
const metadata = ;
Introduction
If you've ever stared at an AWS bill wondering where half your budget went, you're not alone.
Bioinformatics pipelines are known for their resource intensive execution. Resource requirements for running these pipelines increase based on the complexity of the pipelines and differ considerably based on the input data size, sample quality, and reference genome complexity which makes it tough to accurately predict resource requirements without prior benchmarking.
This case study shows how published bioinformatics optimization efforts achieved substantial cost reductions through systematic right sizing based on measured resource usage,results validated by controlled benchmark testing showing 39.7% average cost reduction in AWS Batch workflows \[Tracer benchmark\].
Key Takeaways
* Resource allocation for bioinformatics pipelines is usually not data driven based on existing runs of same or similar pipelines.
* Data driven infrastructure rightsizing requires us to understand OS level metrics which can be collected post runs or proactively.
* Monitoring proactively helps decide the correct resources allocation for pipelines ahead of time.
* Benchmark-validated cost reductions: 39.7% average AWS Batch cost reduction through systematic right-sizing \[Tracer benchmark\]
Prerequisites and Glossary
Let's go through a thorough understanding of what is required to understand this case study thoroughly.
Prerequisites
The following prerequisites contain concepts to help the reader understand what it means to run a bioinformatics workflow in the cloud and how to optimize workload infrastructure through rightsizing.
Relevant Genomics Concepts
* Understanding that reference genomes (eg: [GRCh38/hg38](https://www.ncbi.nlm.nih.gov/grc/human), [GRCh37/hg19](https://www.ncbi.nlm.nih.gov/grc/human)) serve as alignment templates.
* Different organisms and genome builds have different references/annotations which lead to different computational requirements.
* Recognition that genome size (human is ~3 billion base pairs) and size of the aligner's reference index drives memory needs ([genome assembly resource requirements](https://www.biostars.org/p/222267/)), hence, larger the genome size more RAM is required for memory and alignment.
Bioinformatic Concept and Toolings Prerequisites
Knowledge about Workflow Managers for Bioinformatics
* Hands on experience with at least one workflow manager: [Nextflow](https://www.nextflow.io/) , [Snakemake](https://snakemake.readthedocs.io/) , [Cromwell](https://cromwell.readthedocs.io/) , [WDL](https://openwdl.org/) ([comparison of workflow managers](https://www.biostars.org/p/258436/)) (we are using Nextflow here)
* How to state resource requirements (CPU, memory, time) in workflow managers declare resource requirements
Standard Bioinformatics Pipelines Concepts, Tools and Data Formats
* Knowledge of typical bioinformatics pipeline stages and tools used for each of those stages
* Quality Control: [FastQC](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/), [MultiQC](https://multiqc.info/)
* Alignment: [STAR](https://github.com/alexdobin/STAR) (RNA seq), [BWA](http://bio-bwa.sourceforge.net/) (DNA seq), [Bowtie2](http://bowtie-bio.sourceforge.net/bowtie2/)
* Post processing: [samtools](http://www.htslib.org/)/[Sambamba](https://lomereiter.github.io/sambamba/), [Picard](https://broadinstitute.github.io/picard/)
* Variant Calling: [GATK](https://gatk.broadinstitute.org/), [bcftools](http://www.htslib.org/), [FreeBayes](https://github.com/freebayes/freebayes)
* Annotation: [VEP](https://ensembl.org/info/docs/tools/vep/), [ANNOVAR](https://annovar.openbioinformatics.org/), [SnpEff](https://pcingola.github.io/SnpEff/)
* Familiarity with at least one complete workflow (e.g., [RNA seq analysis](https://www.biostars.org/p/308915/) or [variant calling pipelines](https://gatk.broadinstitute.org/hc/en-us/sections/360007226651-Best-Practices-Workflows))
Sequencing Data Formats
* [FASTQ](https://en.wikipedia.org/wiki/FASTQ_format): Raw sequencing reads with quality scores (typical size: 5 50GB per sample)
* [BAM/SAM](https://samtools.github.io/hts-specs/): Aligned reads in binary/text format (typical size: 10 100GB per sample)
* [VCF](https://samtools.github.io/hts-specs/VCFv4.2.pdf): Variant calls listing genetic differences (typical size: 100MB 5GB)
* Different formats communicate file sizes and in turn impact storage and I/O costs
Cloud Computing Concepts
Computing concepts
* Virtual machines (VMs)
* CPU/vCPU, RAM/memory as billable resources
* Awareness of billing models (on demand, spot instances, reserved capacity)
AWS Concepts
* [AWS EC2 instance types](https://aws.amazon.com/ec2/instance-types/) and instance families (m5, c5, r5)
* [AWS Batch](https://aws.amazon.com/batch/)
* [AWS pricing models](https://aws.amazon.com/ec2/pricing/) (on demand vs. spot instances)
Basic System Administrator Skills
* Use SSH to access remote instances
* Be able to run basic bash commands and navigate Linux from the commandline
* Can interpret system monitoring tools: [\top\](https://man7.org/linux/man-pages/man1/top.1.html) , [\htop\](https://htop.dev/) , resource usage logs
* Understand what CPU utilization, memory consumption, and I/O wait are ([Linux performance monitoring basics](https://www.brendangregg.com/linuxperf.html))
Glossary
* Right sizing: Correctly allocate resources, exactly as the workload required with a little headroom
* Over provisioning: Allocate more resources than required
* Instance families:
* [m5 (general purpose)](https://aws.amazon.com/ec2/instance-types/m5/): balanced CPU to RAM ratio (1:4), suitable when workload requirements are unknown
* [c5 (compute optimized)](https://aws.amazon.com/ec2/instance-types/c5/): Higher CPU to RAM ratio (1:2), ideal for CPU bound tasks like alignment and variant calling
* [r5 (memory optimized)](https://aws.amazon.com/ec2/instance-types/r5/): Higher RAM to CPU ratio (1:8), needed for memory intensive tasks like de novo assembly
* OS level metrics: CPU, memory, and I/O usage, as opposed to container level or workflow level allocations.
* Memory high water mark: The maximum RAM usage reached during a job's execution. Let's us know what is the minimum emory required for rightsizing for a particular workload
* Frozen/stalled job: A process that appears "running" in dashboards but has stopped making progress due to hung threads, I/O bottlenecks, network timeouts, or bugs. These consume billable resources while producing no output.
* Spot instances: Spare AWS compute capacity available at steep discounts (50 90% off on demand pricing) but subject to interruption with 2 minute notice when capacity is needed elsewhere.
The Problem: Why We Over-Provision
Here's the thing, we all overprovision. Not because we're careless, but because the alternative (pipeline crashes at 3am) is worse. We don't know how much to allocate, schedulers don't optimize for cost, and teams would rather focus on pipelines than infrastructure. So we pick "safe" defaults and move on. Let's break down why this happens.
"Underestimating a task's memory requirements can result in task failures. Therefore, users often resort to overprovisioning, resulting in significant resource wastage and decreased throughput." , [arXiv research on predicting dynamic memory requirements](https://arxiv.org/abs/2311.08185)
Resource Allocation isn't Backed by Data
Pipeline configuration requires declaring resources upfront,before actual usage is known. When setting up bioinformatics servers, teams must [find the most intensive analysis they're likely to do and ensure hardware meets that requirement with healthy overhead capacity](https://www.biostars.org/p/1035/) , but estimating these requirements involves guesswork.
"The original questioner admits to 'choosing the values rather broadly (guessing)' when setting time, CPU, and memory requirements." , [Biostars discussion on Nextflow parameters](https://www.biostars.org/p/9545141/) [Workflow managers like Nextflow](https://www.nextflow.io/docs/latest/executor.html) require specifying CPU, memory, and time limits per process. However, [many groups lack bioinformatics expertise and find software documentation inadequate](https://pmc.ncbi.nlm.nih.gov/articles/PMC3203049/) , creating bottlenecks where resource allocation decisions rely on forum recommendations rather than measured data.
Arbitrary Allocation of Resources Based on Arbitrary "Good Defaults"
Community forums show this pattern repeatedly: for RNA seq, [typical recommendations include "32 cores/64GB RAM for quantification" or "8 cores and 32GB RAM for STAR alignment](https://www.biostars.org/p/9602252/)" which end up being values copied across projects without validation against specific workloads. [Nextflow Tower (now Seqera) addresses this by learning per process resource requirements from previously executed pipelines and auto generating optimized configurations](https://sciwiki.fredhutch.org/datademos/process_resources/), but most teams run pipelines without this optimization layer.
Not Sure of the Actual Resource Usage of Running Pipelines
Standard workflow managers [monitor job execution and re submission (success/failure)](https://pmc.ncbi.nlm.nih.gov/articles/PMC10030817/) but don't expose granular resource utilization. Dashboards show "COMPLETED" status without revealing whether allocated resources were actually used. Without this visibility, waste compounds: benchmark data shows 28.1% of pipeline runtime is wasted on stale instances that remain allocated after work completes \[Tracer benchmark\]. [Nextflow's execution report](https://www.nextflow.io/docs/latest/metrics.html) provides resource plots, but requires manual analysis. Without automated visibility into CPU utilization, memory peaks, and I/O wait times, teams can't identify waste.
Scheduler Isn't Process Aware
[AWS Batch dynamically provides compute resources based on job requirements](https://aws.amazon.com/batch/features/), selecting "optimal" instance types. However, the scheduler prioritizes job completion over cost: it [evaluates queue priority and runs jobs on optimal compute resources (memory optimized vs CPU optimized) as long as dependencies are met](https://seqera.io/blog/nextflow-and-aws-batch-inside-the-integration-part-1-of-3/), not necessarily choosing the cheapest option for the job.
Frozen Jobs Block Resources
[Common pipeline challenges include manually checking whether jobs finished successfully](https://pmc.ncbi.nlm.nih.gov/articles/PMC10030817/) and detecting stalls. Jobs may appear "RUNNING" while stuck on network I/O, file corruption, or infinite loops, consuming billable resources without progress. [Some custom pipeline frameworks have no support for failure handling](https://pmc.ncbi.nlm.nih.gov/articles/PMC5429012/) , allowing frozen jobs to run indefinitely until manual intervention.
Scheduler Can't Schedule for Optimum Cost
While [AWS Batch can use Spot Instances for cost savings](https://www.nextflow.io/blog/2017/scaling-with-aws-batch.html), schedulers don't automatically optimize across regions or dynamically switch instance families based on real time pricing. Cost optimization requires [explicit configuration of allocation strategies like BEST\_FIT\_PROGRESSIVE](https://docs.aws.amazon.com/batch/latest/userguide/allocation-strategies.html).
Should the Team, Test Pipelines or Improve Infrastructure ?
[Bioinformatics cores face mounting analytical demands while operating under cost recovery models with limited institutional support](https://pmc.ncbi.nlm.nih.gov/articles/PMC7192196/). Over the last decade or so, [omics data creation costs decreased 10 fold while analytical support needs increased exponentially](https://pmc.ncbi.nlm.nih.gov/articles/PMC7192196/).
This creates a resource paradox where teams must focus on [novel applications (single cell RNA seq), data integration (spatial transcriptomics), and sophisticated pipelines](https://pmc.ncbi.nlm.nih.gov/articles/PMC7192196/), leaving no bandwidth for infrastructure optimization. [Computational life science applications don't leverage full HPC capabilities, making system tuning critical but time prohibitive](https://pmc.ncbi.nlm.nih.gov/articles/PMC7575271/).
The Evidence: Real Costs of Over-Provisioning
How RNA seq Compute Costs Vary Pipeline to Pipeline
RNA seq analysis costs vary across pipeline choices and cloud optimizations. Published studies report anywhere from [$1.30 per sample (Toil/TCGA project)](https://pmc.ncbi.nlm.nih.gov/articles/PMC6452449/) \[Genomics study\] to [$3-10 per sample](https://medium.com/truwl/what-is-the-cost-of-bioinformatics-a-look-at-bioinformatics-pricing-and-costs-1e4c1c3bcb4f) \[Genomics study\]. Most researchers accept 5-15% of total sequencing costs as reasonable for compute ([bioinformatics cost expectations](https://medium.com/truwl/what-is-the-cost-of-bioinformatics-a-look-at-bioinformatics-pricing-and-costs-1e4c1c3bcb4f)) \[Genomics study\], but many exceed this without realizing it. Every pipeline hence needs to be monitored at least once to see what is the high watermark of resource usage and allocate resources accordingly and no one configuration can work for each and every one of them.
How Over Provisioning Can Happen When Running STAR
STAR's [documented requirements are ~27-30GB RAM for human genome alignment](https://pmc.ncbi.nlm.nih.gov/articles/PMC3530905/) \[Genomics study\], with [~38GB recommended for GRCh37](https://nf-co.re/rnaseq/latest/docs/usage/) \[Genomics study\]. STAR can scale well [up to at least ~12 threads](https://pmc.ncbi.nlm.nih.gov/articles/PMC3530905) \[Genomics study\]. Beyond some point, speedups often plateau (depending on dataset + hardware), and a common limiter is disk read/write bandwidth (plus, on many systems, memory-bandwidth/cache etc.). [Disk bandwidth is a major bottleneck](https://groups.google.com/g/rna-star/c/SRNcW9xMSEU) and isn't actively addressed. STAR also "r[equires … a high-throughput disk to scale efficiently with an increasing number of threads](https://arxiv.org/html/2506.12611v1)".
Honestly, most of us just use the defaults and hope for the best. No judgment,we've all been there. We end up overprovisioning based on standard defaults. STAR is primarily memory first. When using a standard provisioning like 64GB RAM and 16 vCPUs by default, we end up paying for resources the tool can't fully utilize as we saw how the thread utilization mostly stays the same. When [nf core's default auto retry](https://nf-co.re/rnaseq/latest/docs/usage/) (2x then 3x resources on failure) kicks in, costs spiral further.
This pattern shows up in real optimization efforts. One case study (Superfluid DX) used profiling to identify that STAR was I/O-bound, not compute-bound,leading to 40% lower compute cost and 30% faster end-to-end runtime by right-sizing instances based on the actual bottleneck \[Tracer benchmark\].
"Running a process 2,000 times in parallel results in initial out-of-memory failures… end up running a total of 6,000 times, substantially inflating costs." , Luke Pembleton, [Seqera Community](https://community.seqera.io/t/feature-idea-optimised-memory-allocation-through-preemptive-adjustment-to-avoid-anticipated-failures/296)
Real World Impact from Published Case Studies
In a [cloud case study of the comparative genomics tool Roundup](https://pmc.ncbi.nlm.nih.gov/articles/PMC3023304/), the researcher computed orthologs across 902 genomes on Amazon EC2 and report that ordering genome-comparison jobs by predicted runtime (instead of submitting jobs randomly) [brought the run to close to 200 hours and $8,000, at least 40% lower cost than the random-order baseline](https://pubmed.ncbi.nlm.nih.gov/21258651/) \[Case study\], without changing the underlying scientific computation.
Separately, an AWS Partner Network case study on [MemVerge MMCloud + EC2 Spot](https://aws.amazon.com/blogs/apn/running-bioinformatics-pipelines-cost-effectively-using-memverge-on-aws/) describes using dynamic right-sizing and checkpoint/restore for long Nextflow pipelines, reporting 50–80% lower cost vs On-Demand \[Case study\] and up to ~60% fewer CPU hours per pipeline \[Case study\] (vendor-reported results).
Controlled benchmark testing across instance families and regions shows 39.7% average AWS Batch cost reduction through systematic right-sizing, with savings reaching 55%+ when region flexibility is factored in \[Tracer benchmark\].
The Solution: Data-Driven Right-Sizing
The good news? You don't need to become an AWS expert. A few targeted changes can make a real difference.
Real world optimization follows a data driven approach. Here's how one team achieved measurable results:
1\. Check Current Costs
Establish baseline spending using [AWS Cost Explorer](https://aws.amazon.com/aws-cost-management/aws-cost-explorer/) or other cost tracking. AI-powered instance recommendations can achieve 30.2% EC2 spending reduction by identifying mismatches between allocated and required resources \[Tracer benchmark\].
Query EC2 costs programmatically with AWS Cost Explorer CLI:
`bash
$ aws ce get-cost-and-usage \
--time-period Start=2024-01-01,End=2024-01-31 \
--granularity MONTHLY \
--metrics "UnblendedCost" \
--group-by Type=DIMENSION,Key=SERVICE \
--filter '}'
`
This gives you the baseline EC2 spend to measure against after right-sizing.
After analyzing [nf core/rnaseq](https://nf-co.re/rnaseq) run and found significant variation in per sample costs depending on instance selection. Published findings also show that [RNA seq costs range from $1.30 to $10 per sample](https://alitheagenomics.com/blog/budgeting-for-an-mrna-seq-project-here-are-the-main-cost-drivers-to-keep-an-eye-on) based on optimization.
2\. Run Pipeline with Monitoring
After you have figured out your current costs, make sure to monitor your pipelines to understand the resource utilization.
[Nextflow's built in resource tracking](https://www.nextflow.io/docs/latest/metrics.html) captures CPU, memory, and runtime for each process. The [execution report](https://www.nextflow.io/docs/latest/reports.html) can plot resource distribution with a % Allocated tab showing what proportion of requested resources were actually used ([Nextflow metrics documentation](https://www.nextflow.io/docs/latest/metrics.html)). Platforms like [Seqera (formerly Tower)](https://seqera.io/blog/optimizing-resource-usage-with-nextflow-tower/) take this further and analyze usage and generate resource recommendations per process based on observations.
What over-provisioning looks like in practice: Let's say you're running STAR alignment on an m5.4xlarge (64GB RAM, 16 vCPU). Here's what the monitoring tools reveal:
`bash
$ top -b -n 1 -p \$(pgrep -f STAR)
top - 14:32:18 up 2:15, 1 user, load average: 3.42, 3.28, 2.91
Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie
%Cpu(s): 25.2 us, 2.1 sy, 0.0 ni, 72.1 id, 0.5 wa, 0.0 hi, 0.1 si
MiB Mem : 64000.0 total, 31847.2 free, 29124.8 used, 3028.0 buff/cache
MiB Swap: 0.0 total, 0.0 free, 0.0 used. 34203.4 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
18432 ec2-user 20 0 42.1g 29.1g 1.2g R 402.3 45.5 47:23.91 STAR
`
Notice the numbers: 29.1GB RES (resident memory) out of 64GB allocated,that's 35GB of RAM sitting idle. CPU shows 402% (roughly 4 cores active out of 16), meaning 75% of compute capacity is unused. You're paying for an m5.4xlarge but using resources equivalent to an m5.xlarge.
htop makes this even more visual with its CPU core bars:
`bash
$ htop -p \$(pgrep -f STAR)
1 [|||||||||||||||||||| 84.2%] 9 [ 0.0%]
2 [||||||||||||||||| 71.3%] 10 [ 0.0%]
3 [|||||||||||||| 58.7%] 11 [ 0.0%]
4 [|||||||||||| 49.1%] 12 [| 2.1%]
5 [|| 8.3%] 13 [ 0.0%]
6 [| 3.2%] 14 [ 0.0%]
7 [ 0.0%] 15 [ 0.0%]
8 [ 0.0%] 16 [ 0.0%]
Mem[||||||||||||||||||||||||||||| 29.1G/64.0G]
Swp[ 0K/0K]
PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command
18432 ec2-user 20 0 42.1G 29.1G 1.2G R 402.3 45.5 47:23.91 STAR --genomeDir /ref/GRCh38
`
Notice cores 5-16 sitting nearly idle,STAR's threading doesn't scale linearly beyond ~4 threads for this workload. The memory bar tells the same story: roughly half the allocated RAM is unused.
To see the bigger picture over time, pull metrics from CloudWatch:
`bash
$ aws cloudwatch get-metric-statistics \
--namespace AWS/EC2 \
--metric-name CPUUtilization \
--dimensions Name=InstanceId,Value=i-0abc123def456 \
--start-time 2024-01-15T10:00:00Z \
--end-time 2024-01-15T14:00:00Z \
--period 300 \
--statistics Average
,
,
,
,
,
]
}
`
Average 18% CPU over a 4-hour pipeline run means 82% of compute capacity went unused, and you paid for all of it. This pattern repeating across hundreds of samples adds up to significant waste.
For deeper OS level visibility, tools like [Tracer](https://www.tracer.cloud/) can be used to collect eBPF based metrics showing true CPU utilization vs. idle time,critical for detecting inefficiencies invisible to workflow managers.
3\. Right Size Your Instance
Based on measured usage and published benchmarks: STAR alignment ([documented requirements: 27-30GB RAM for human genome](https://pmc.ncbi.nlm.nih.gov/articles/PMC3530905/)) :
* Community runs [STAR on c3.4xlarge (30GB RAM, 8 threads)](https://www.biostars.org/p/310890/) or [i3.8xlarge for I/O intensive workloads](https://groups.google.com/g/rna-star/c/s3O0-dFc2-Q)
* Threading shows diminishing returns: [benchmarked at 12 threads optimal](https://pmc.ncbi.nlm.nih.gov/articles/PMC3530905/) \[Genomics study\], doesn't scale linearly beyond that
* Recommendation: c5.4xlarge (32GB RAM, 16 vCPU) for human genome alignment
Comparing instance options with AWS CLI:
`bash
$ aws ec2 describe-instance-types \
--instance-types c5.4xlarge m5.4xlarge \
--query 'InstanceTypes[*].' \
--output table
--
| Type | vCPUs | MemoryMB |
--
| c5.4xlarge | 16 | 32768 |
| m5.4xlarge | 16 | 65536 |
--
`
c5.4xlarge offers the same 16 vCPUs with 32GB RAM at lower cost, right-sized for STAR's actual ~30GB requirement.
GATK variant calling ([max 128GB for 30x WGS](https://blogs.oracle.com/cloud-infrastructure/post/accelerating-gatk-pipeline-to-10-times-performance-on-oci-intel-shapes) \[Genomics study\], [4-8GB heap typically sufficient](https://bmcbioinformatics.biomedcentral.com/articles/10.1186/s12859-019-3169-7) \[Genomics study\]):
* GATK is [I/O limited, not memory limited](https://bmcbioinformatics.biomedcentral.com/articles/10.1186/s12859-019-3169-7)
* Commonly runs on [c5.9xlarge for large scale workloads](https://www.researchgate.net/figure/WGS-benchmarks-Runtime-RAM-use-and-disk-use-in-GATK-4-vs-elPrep-4-sfm-mode-elPrep_fig2_331085982)
* Recommendation: Compute optimized instances with fast storage
AWS Batch allocation strategy ([instance selection best practices](https://aws.amazon.com/blogs/hpc/aws-batch-best-practices/)) :
* Align vCPUs to power of 2 increments (2, 4, 8, 16) to avoid over provisioning ([bioinformatics packing optimization](https://lpembleton.rbind.io/posts/packing-for-ec2/))
* Use BEST\_FIT\_PROGRESSIVE for cost optimization selects cheaper instances and adapts if unavailable ([AWS Batch allocation strategies](https://docs.aws.amazon.com/batch/latest/userguide/allocation-strategies.html))
* [BWA MEM runtime halves when doubling threads](https://lpembleton.rbind.io/posts/packing-for-ec2/) , making compute optimized instances cost effective
4\. Update Configuration
Modify instance types in workflow configuration. Real world example: [nf core/rnaseq optimization on SevenBridges](https://summit.nextflow.io/2024/barcelona/posters/10-31--optimization-of-nf-corernaseq-pipeline/) which achieved 45% cost reduction and 41.5% shorter runtime \[Case study\] by assigning specific computational requirements per process.
Before (over-provisioned defaults):
`groovy
process
withName: 'GATK_HAPLOTYPECALLER'
}
`
After (right-sized based on measured usage):
`groovy
process
withName: 'GATK_HAPLOTYPECALLER'
}
`
Same science, smaller bill. That's the whole point.
The "after" config uses compute-optimized instances sized to actual requirements,same scientific output, lower cost.
5\. Run and Verify
Validate using [Nextflow's resource comparison features](https://www.nextflow.io/docs/latest/metrics.html) which compare requested vs. actual resources in the execution report. For scientific validation, compare output file checksums to ensure identical results.
Generate execution reports with your pipeline run:
`bash
$ nextflow run nf-core/rnaseq -profile aws \
-with-report execution_report.html \
-with-trace trace.txt \
--input samplesheet.csv \
--outdir results/
`
The trace file shows exactly what resources each process used:
`text
task_id name status realtime %cpu peak_rss %mem
1 STAR_ALIGN COMPLETED 2h 15m 23.4 29.8 GB 46.5
2 GATK_HAPLOTYPE COMPLETED 45m 12.1 6.2 GB 9.7
`
The trace shows STAR used only 46.5% of allocated memory and 23.4% CPU, confirming over-provisioning.
Verify scientific results are unchanged after right-sizing:
`bash
Compare outputs from before/after right-sizing runs
$ md5sum results_before/aligned/*.bam > before_checksums.txt
$ md5sum results_after/aligned/*.bam > after_checksums.txt
$ diff before_checksums.txt after_checksums.txt
`
`text
(no output - files are identical)
`
No output from diff means the BAM files are byte-for-byte identical. Right-sizing changed infrastructure, not results. This is the critical validation: your science stays the same, only your costs change.
Published case: [nf test framework reduces execution time by 80%](https://academic.oup.com/gigascience/article/doi/10.1093/gigascience/giaf130/8297140) \[Case study\] through optimized resource allocation and parallel testing.
6\. Monitor for Frozen Jobs
Nextflow's [task resource metrics](https://www.nextflow.io/docs/latest/metrics.html) track per process duration. Set alerts for jobs exceeding expected runtime with minimal CPU activity. This prevents scenarios where jobs appear "running" but are stalled on I/O or network issues. Proper monitoring eliminates wasted compute from failed runs,benchmarks show 75% fewer failed runs with proactive detection in place \[Tracer benchmark\].
Detect stalled processes at the OS level:
`bash
Find processes running >2 hours with 4GB RAM/vCPU needed ([instance family guidance](https://www.biostars.org/p/310890/))
* Test 2-3 instance types per process before committing ([cost comparison](https://costcalc.cloudoptimo.com/))
* Compare [regional pricing](https://instances.vantage.sh/) for additional savings
During Pipeline Runs
* Alert on jobs exceeding 2x expected runtime with <5% CPU
* Auto-terminate frozen jobs to [prevent runaway costs](https://www.prosperops.com/blog/how-to-identify-and-prevent-cloud-waste/)
* Detect stale instances: benchmarks show 28.1% of runtime can be wasted on instances that remain allocated after work completes \[Tracer benchmark\]
* Review failures as they occur to catch patterns early
After Each Run
* Validate outputs via checksums after instance changes
* Analyze resource utilization against allocated amounts
* Document actual peak usage for each process type
* Update configurations based on measured data
Continuous Improvement
* Rebenchmark every 6-12 months ([enterprises average 25 days to detect waste](https://www.prosperops.com/blog/how-to-identify-and-prevent-cloud-waste/) \[Industry survey\])
* Retest after tool updates ([version changes affect resources](https://www.biostars.org/p/168737/))
* Track costs over time ([only 30% have clear visibility](https://www.cloudzero.com/blog/cloud-computing-statistics/) \[Industry survey\])
* Roll out changes gradually: one process at a time
Conclusion
The core problem isn't that teams don't care about costs,it's that they're forced to guess resource configurations without data. Workflow managers require upfront declarations, schedulers optimize for completion over cost, and teams lack visibility into actual utilization. The solution is systematic measurement, not better guessing.
Four principles for data-driven right-sizing:
1. Measure first: Collect OS-level metrics (CPU, memory, I/O) before making any configuration changes. Workflow manager dashboards show completion status, not utilization, you need deeper visibility.
2. Match resources to measured usage: Replace default configurations with values based on actual peak usage plus reasonable headroom. Published tool requirements and community benchmarks provide starting points; your measured data confirms what works for your specific workloads.
3. Iterate continuously: Resource requirements change when tools update, input data characteristics shift, or reference genomes change. Rebenchmark after significant changes rather than assuming previous configurations still apply.
4. Keep changes infrastructure-only: Adjust instance types and resource allocations without modifying pipeline logic. This avoids revalidation overhead and keeps scientific outputs identical.
Tools like [Tracer](https://www.tracer.cloud/) enable this approach by providing the OS-level visibility that standard workflow managers lack, showing true utilization rather than just allocated resources.
Your turn. What's the worst over-provisioning mistake you've discovered in your pipelines? Ever find a job running for days that should have taken hours? We've all got stories, drop yours in an email to us at team@tracer.cloud.