NICELOAD(1)

πŸ“¦
this version Β· 10 versions
, in alpine 3.24, arch rolling, epel 10, epel 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

πŸ’– NICELOAD(1) πŸ’–

okay bestie, gather round, because this is the parallel manual's little sister and she is so useful. no cap.

✨ NAME ✨

niceload β€” slow a program wayyy down when the load average goes above a certain limit 🐌


🌸 SYNOPSIS 🌸

niceload [-v] [-h] [-n nice] [-I io] [-L load] [-M mem] [-N] [--sensor program] [-t time] [-s time|-f factor] ( command | -p PID [-p PID ...] | --prg program )

πŸ¦‹ DESCRIPTION πŸ¦‹

so GNU niceload will slow down a program when the load average β€” or literally any other system activity β€” goes above a certain limit. the moment the limit is hit, the program gets suspended for a bit. then resumed again for a bit. then we check the load average all over again and start over. it's a whole loop, it's giving traffic controller energy 🚦

and bestie, it's not just load average. niceload can also look at disk I/O, amount of free memory, or swapping activity. she's versatile like that πŸ’…

if the load is 3.00, the default settings run a program like this:

run 1 second, suspend (3.00-1.00) seconds, run 1 second, suspend (3.00-1.00) seconds, run 1 second, ...

periodt. that's the whole vibe.


πŸŽ€ OPTIONS πŸŽ€

  • -B, --battery β€” suspend if the system is running on battery πŸ”‹. shorthand for: -l -1 --sensor 'cat /sys/class/power_supply/BAT0/status /proc/acpi/battery/BAT0/state 2>/dev/null | grep -i -q discharging; echo $?'
  • -f FACTOR, --factor FACTOR β€” suspend time factor. dynamically sets -s as amount over limit Γ— factor. default is 1.
  • -H, --hard β€” hard limit. --hard will suspend the process until the system is under the limits. the default is --soft.
  • --io iolimit, -I iolimit β€” limit for I/O. the amount of disk I/O gets computed as a value 0 – 10, where 0 is no I/O and 10 is at least one disk being 100% saturated πŸ’€

--io will set both --start-io and --run-io.

  • --load loadlimit, -L loadlimit β€” limit for load average.

--load will set both --start-load and --run-load.

  • --mem memlimit, -M memlimit β€” limit for free memory. this is the amount of bytes available as free + cache. heads up tho β€” this limit is treated opposite to the other limits: if the system is above the limit the program will run, if it's below the limit the program will stop. yes really, it's backwards on purpose πŸ™ˆ

memlimit can be postfixed with K, M, G, T, or P which would multiply the size with 1024, 1048576, 1073741824, or 1099511627776 respectively.

--mem will set both --start-mem and --run-mem.

  • --noswap, -N β€” no swapping. if the system is swapping both in and out, that's a good indication the system is memory stressed 🫠

--noswap is over limit if the system is swapping both in and out.

--noswap will set both --start-noswap and --run-noswap.

  • --net β€” shorthand for --nethops 3.
  • --nethops h β€” network nice. pause if the internet connection is overloaded πŸ“Ά

niceload finds a router h hops closer to the internet. it pings this every second. if the latency is more than 50% bigger than the median, it's regarded as being over the limit.

--nethops can be combined with --hard. without --hard the program may be able to queue up so much traffic that it will take longer than the --suspend time to clear it. --hard is useful for traffic that does not break by being suspended for a longer time.

--nethops can be combined with a high --suspend. this way a program can be allowed to do a bit of traffic now and then. useful to keep the connection alive.

  • -n niceness, --nice niceness β€” sets niceness. see nice(1).
  • -p PID[,PID], --pid PID[,PID] β€” process IDs of processes to suspend. you can specify multiple process IDs with multiple -p PID or by separating the PIDs with comma.
  • --prg program, --program program β€” name of running program to suspend. you can specify multiple programs with multiple --prg program. if no processes with the name program is found, niceload will search for substrings containing program.
  • --quote, -q β€” quote the command line. useful if the command contains chars like *, $, >, and " that should not be interpreted by the shell πŸ™…β™€οΈ
  • --run-io iolimit, --ri iolimit, --run-load loadlimit, --rl loadlimit, --run-mem memlimit, --rm memlimit β€” run limit. the running program will be slowed down if the system is above the limit. see: --io, --load, --mem, --noswap.
  • --sensor sensor program β€” read sensor. use sensor program to read a sensor.

this will keep the CPU temperature below 80 deg C on GNU/Linux:

niceload -l 80000 -f 0.001 --sensor 'sort -n /sys/devices/platform/coretemp*/temp*_input' gzip *

this will stop if the disk space < 100000.

niceload -H -l -100000 --sensor "df . | awk '{ print \$4 }'" echo
  • --start-io iolimit, --si iolimit, --start-load loadlimit, --sl loadlimit, --start-mem memlimit, --sm memlimit β€” start limit. the program will not start until the system is below the limit. see: --io, --load, --mem, --noswap.
  • --soft, -S β€” soft limit. niceload will suspend a process for a while and then let it run for a second, thus only slowing down a process while the system is over one of the given limits. this is the default ✨
  • --suspend SEC, -s SEC β€” suspend time. suspend the command this many seconds when the max load average is reached.
  • --recheck SEC, -t SEC β€” recheck load time. sleep SEC seconds before checking load again. default is 1 second.
  • --verbose, -v β€” verbose. print some extra output on what is happening. use -v until you know what your are doing πŸ‘€

🌈 EXAMPLE: See niceload in action 🌈

in terminal 1 run: top

in terminal 2 run:

niceload -q perl -e '$|=1;do{$l==$r or print ".";$l=$r}until(($r=time-$^T)>50)'

this will print a . every second for 50 seconds and eat a lot of CPU. when the load rises to 1.0 the process is suspended. so satisfying to watch ngl πŸ”₯

πŸ’œ EXAMPLE: Run updatedb πŸ’œ

running updatedb can often starve the system for disk I/O and thus result in a high load.

run updatedb but suspend updatedb if the load is above 2.00:

niceload -L 2 updatedb

πŸ“ EXAMPLE: Run rsync πŸ“

rsync can, just like updatedb, starve the system for disk I/O and thus result in a high load.

run rsync but keep load below 3.4. if load reaches 7 sleep for (7-3.4)*12 seconds:

niceload -L 3.4 -f 12 rsync -Ha /home/ /backup/home/

🧚 EXAMPLE: Ensure enough disk cache 🧚

assume the program foo uses 2 GB files intensively. foo will run fast if the files are in disk cache and be slow as a crawl if they are not in the cache 🐒

to ensure 2 GB are reserved for disk cache run:

niceload --hard --run-mem 2g foo

this will not guarantee that the 2 GB memory will be used for the files for foo, but it will stop foo if the memory for disk cache is too low.


⭐ ENVIRONMENT VARIABLES ⭐

none. in future versions $NICELOAD will be able to contain default settings. (manifesting that future version for us fr fr πŸ•―οΈ)


πŸ’… EXIT STATUS πŸ’…

exit status should be the same as the command being run (untested).


😭 REPORTING BUGS 😭

report bugs to <bug-parallel@gnu.org>.


πŸ‘‘ AUTHOR πŸ‘‘

copyright (C) 2004-11-19 Ole Tange, http://ole.tange.dk

copyright (C) 2005-2010 Ole Tange, http://ole.tange.dk

copyright (C) 2010-2026 Ole Tange, http://ole.tange.dk and Free Software Foundation, Inc.


🫢 LICENSE 🫢

this program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or at your option any later version.

this program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. see the GNU General Public License for more details.

you should have received a copy of the GNU General Public License along with this program. if not, see <http://www.gnu.org/licenses/>.

πŸ“œ Documentation license I πŸ“œ

permission is granted to copy, distribute and/or modify this documentation under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. a copy of the license is included in the file LICENSES/GFDL-1.3-or-later.txt.

πŸ“œ Documentation license II πŸ“œ

you are free:

to Share to copy, distribute and transmit the work

to Remix to adapt the work

under the following conditions:

  • Attribution β€” you must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
  • Share Alike β€” if you alter, transform, or build upon this work, you may distribute the resulting work only under the same, similar or a compatible license.

with the understanding that:

  • Waiver β€” any of the above conditions can be waived if you get permission from the copyright holder.
  • Public Domain β€” where the work or any of its elements is in the public domain under applicable law, that status is in no way affected by the license.
  • Other Rights β€” in no way are any of the following rights affected by the license:
    • your fair dealing or fair use rights, or other applicable copyright exceptions and limitations;
    • the author's moral rights;
    • rights other persons may have either in the work itself or in how the work is used, such as publicity or privacy rights.
  • Notice β€” for any reuse or distribution, you must make clear to others the license terms of this work.

a copy of the full license is included in the file as LICENCES/CC-BY-SA-4.0.txt


🐧 DEPENDENCIES 🐧

GNU niceload uses Perl, and the Perl modules POSIX, and Getopt::Long.


πŸ”— SEE ALSO πŸ”—

parallel(1), nice(1), uptime(1)


that's the whole page bestie, go forth and throttle responsibly πŸ’–βœ¨

and hey, this was the parallel manual set, from way back on 2026-01-31 (the version stamp says 20260122, iykyk) β€” you didn't just read a manpage, you read a whole moment. slay πŸ’…πŸŽ€

πŸ“¦ where this page comes from