RayX
12/17/2025, 7:55 PMprocess {
resourceLimits = [
cpus: 8
]
}Thomas Danhorn
12/17/2025, 11:08 PMprocess.maxForks limits the number of instances of a particular process type at any given time. You can set that for a process by name, all processes, or by label, e.g. withLabel: process_high. The problem is that another type of process can still run in parallel and use up the remaining CPUs.
A drastic solution could be always requesting more that half of the available CPUs (not sure how Nextflow determines what that is if you have hyperthreading enabled). If Docker does the enforcement properly (not sure how the OS itself handles that), it should be impossible to run more than one process at a time (since it wouldn't get the resources requested), and the CPU use would be limited to what that one process requested and to what Nexrflow itself needs (not that much).
The other solution would be to install SLURM and configure it (and the pipeline for it), but that seems like a lot of work for what you are trying to achieve.pontus
12/18/2025, 8:27 AMlocal executor, which will use dead counting to know if it makes sense to start more tasks. The executor scope contains multiple tunables to deal with that (https://www.nextflow.io/docs/latest/reference/config.html#executor), e.g. cpus and memory (note that these do not care about real values but rather the values from the nextflow process).RayX
12/18/2025, 7:19 PMpontus
12/18/2025, 7:28 PMThomas Danhorn
12/18/2025, 8:05 PM