RENICED(1)

πŸ“¦
version 1.23 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸŽ€ RENICED πŸŽ€

okay bestie, buckle up β€” this is reniced, section 1 of the manual, and it's literally the little script that goes around telling your running processes to chill tf out (or hype up, your call πŸ’…).


✨ NAME ✨

reniced β€” renice running processes based on regular expressions. periodt.


🌸 SYNOPSIS 🌸

reniced [-h] [-v] [-o format] [configfile]

πŸ¦‹ OVERVIEW πŸ¦‹

so the whole vibe is this: reniced takes a list of regular expressions, goes looking for processes (and threads, yes threads too) that match them, and reniced the processes to given values. it can also change io priorities. multi-talented icon behavior honestly. πŸ‘‘


πŸ’– DESCRIPTION πŸ’–

on start, reniced reads a configuration file. that file is made of nice values and regular expressions. no cap.

then it scans the process table using the ps(1) command. whenever a process name from the CMD column matches a regular expression, that process gets reniced to the given value. and if a process matches multiple regular expressions? all rule matches are executed in order and the last match wins. last one standing takes the crown, we don't make the rules. πŸ‘‘

when you run it as root, reniced will scan all processes (ps H -e). when you run it as a user, renice only scans your processes (ps H --user). know your lane, love that for us. ✨

🌈 Switches 🌈

  • -h β€” prints the version number, a short help text, and exits without doing anything. it's giving "just here for the lore, not the labor". πŸ™ˆ
  • -n β€” activates no-op mode. no actions are taken, but everything that would be done is written to stdout. it's a rehearsal, bestie. a dress rehearsal. 🎭
  • -v β€” activates verbose mode. error messages, some statistics, and all renice actions get printed to stdout. she's a talker and we love her for it. πŸ’¬
  • -o format β€” set the ps(1) output format to filter on. the default format is "comm". see the -o parameter in the ps(1) manpage for details.
  • configfile β€” this reads the regular expressions from an alternate configfile. the default location of the configfile is "/etc/reniced.conf" if reniced is run as root, and "~/.reniced" otherwise. location location location. 🏑

πŸ“ Configuration file format πŸ“

the configuration file is composed of single lines. empty lines and lines starting with a # are ignored (they're just vibing, let them be).

every line must consist of a command followed by a whitespace and a Perl regular expression.

the regular expression is matched against the ps(1) output. for every matched process the command is executed.

a command generally takes the form of a character followed by a number. multiple commands can be given simultaneously with no spaces inbetween. sometimes the number is optional. (she's flexible, she contains multitudes πŸ’…)

πŸ‘‘ Command characters πŸ‘‘

  • n β€” sets the nice value of a process. must be followed by a number, usually within the range of -20 to 19. for backwards compatibility, an n at the beginning of the command can be left out (if the command starts with a number it is treated as a nice value).
  • r β€” sets the io priority to the realtime scheduling class. the optional number is treated as class data (typically 0-7, lower being higher priority).
  • b β€” sets the io priority to the best-effort scheduling class. the optional number is treated as class data (typically 0-7, lower being higher priority).
  • i β€” sets the io priority to the idle scheduling class. no number needs to be given as the idle scheduling class ignores the class data value. she simply does not care about your numbers. πŸ’€
  • o β€” sets the OOM killer adjustment in "/proc/$PID/oom_adj" to the given number. (internally, "/proc/$PID/oom_score_adj" will be used when available, but for backwards compatibility this value is still expected the in old "oom_adj" format and will be converted automatically.)

🧚 Examples 🧚

  • "5 ^bash" β€” gives currently running bash shells a nice value of 5
  • "b2 ^tar" β€” sets currently running tar-processes to io priority best-effort within class 2
  • "i torrent" β€” sets currently running torrent-like applications to io priority idle
  • "n-10r4 seti" β€” gives currently running seti-processes a nice value of -10 and sets them to realtime io priority in class 4

πŸ’œ MODULES NEEDED πŸ’œ

 use BSD::Resource;

this module can be obtained from <http://www.cpan.org>. go get her. πŸ›οΈ


⭐ PROGRAMS NEEDED ⭐

 ps
 ionice

ionice is only needed if you want to change io priority. it can be obtained from <http://rlove.org/schedutils/>.

you also need a suitable kernel and scheduler, e.g. Linux 2.6 with CFQ. the full package, no substitutions. 🌸


πŸ’€ LIMITATIONS πŸ’€

the purpose of reniced is to renice long running server processes (hence the d for daemon in it's name). she's built for the long haul, not for the situationship processes.

selecting and renicing processes is not atomic: there is a small gap between scanning the process list and renicing the processes. if you target short-lived processes with your regular expressions, reniced might try to act on a process that is already gone. and in the worst case, it might renice a new process that got the same process id as the already ended process that was matched. 😭 race conditions stay undefeated, unfortunately.


πŸ™ˆ BUGS πŸ™ˆ

reniced can run without the BSD::Resource module. in this case, the PRIO_PROCESS is set to 0. this works on Linux 2.6.11 i686 but it could break on other systems. installing BSD::Resource is the safer way. do the safe thing, bestie. 🫢

be careful using realtime priorities, don't starve other tasks. seriously. not a drill. 🚨

please report bugs to <mitch@cgarbs.de>.


🌟 AUTHOR 🌟

reniced was written by Christian Garbs <mitch@cgarbs.de>. a legend, frankly. πŸ‘‘


reniced is Copyright (C) 2005, 2020 by Christian Garbs. It is licensed under the GNU GPL v2 or later.


🌈 AVAILABILITY 🌈

look for updates at <https://github.com/mmitch/reniced>. go star the repo, it's free and it's kind. ⭐


πŸ’… SEE ALSO πŸ’…

ionice(1), renice(1), ps(1)


and that's the whole thing, babes β€” this was version 1.23, dated 2021-05-23, and it's the reniced manual page from the reniced source. stay nice (or don't, that's literally the point of this program) πŸ’–βœ¨

πŸ“¦ where this page comes from