TASKPOLICY(8)

πŸ“¦ version 1042.100.6.0.1, in nixpkgs unstable

πŸ’… TASKPOLICY(8) β€” like, the taskpolicy manual, but make it make sense πŸ’…

okay bestie, welcome to taskpolicy from the System Manager's Manual section 8 β€” she's a lil utility with main character energy and she's about to rearrange your process's whole vibe ✨


🌸 NAME 🌸

taskpolicy β€” run a program with a different I/O or scheduling policy, or tweak the settings on a process that's already running 🫢


πŸŽ€ SYNOPSIS πŸŽ€

taskpolicy [-d policy] [-g policy] [-c clamp] [-b] [-t thruput_tier]
           [-l latency_tier] [-a] [-s] [-S shims] [-m limit] [-j pri]
           program [arg1 [...]]
taskpolicy [-b|-B] [-t thruput_tier] [-l latency_tier] [-p pid]

Two whole modes, two whole moods, we love a flexible icon πŸ’–


✨ DESCRIPTION ✨

So taskpolicy lowkey uses the setiopolicy_np(3) and setpriority(2) APIs to launch a program with altered I/O or scheduling policies. And the nepo-baby energy is real: all children of the specified program also inherit these policies. 🧚 Whole family gets the same treatment, periodt.

taskpolicy accepts the following flags and arguments:

  • -d policy β€” runs the program after calling setiopolicy_np(3) with an iotype of IOPOL_TYPE_DISK, a scope of IOPOL_SCOPE_PROCESS, and whatever policy you passed. The argument can be an integer, or a symbolic string like "default" or "throttle" β€” and it's interpreted case-insensitively, so don't stress about your caps lock πŸ™ˆ
  • -g policy β€” runs the program after calling setiopolicy_np(3) with an iotype of IOPOL_TYPE_DISK, a scope of IOPOL_SCOPE_DARWIN_BG, and the policy you specified. Same deal as -d for the argument, interpreted identically πŸ’«
  • -c clamp β€” runs the program using the specified QoS clamp. The argument can be "utility", "background", or "maintenance", interpreted case-insensitively 🎚️
  • -p pid β€” changes settings for the process specified by pid. That's the "already running" mode, iykyk πŸ”₯
  • -m limit β€” runs the program with the specified memory limit (in MiB) πŸ“
  • -j pri β€” runs the program at the specified jetsam priority πŸ’€
  • -P pcontrol β€” runs the program with the specified process control action, which the system may invoke upon resource exhaustion. Valid options include "kill", "throttle", and "suspend" β€” so yeah, pick your fighter 😭
  • -S shims β€” runs the program with security transition shims in effect πŸ›‘οΈ
  • -b β€” runs the program after calling setpriority(2) with a priority of PRIO_DARWIN_BG πŸŒ™
  • -B β€” moves the target process out of PRIO_DARWIN_BG. the glow-up πŸ¦‹
  • -t β€” sets the throughput tier of the process to thruput_tier ⚑
  • -l β€” sets the latency tier of the process to latency_tier ⏱️
  • -a β€” runs the program with the resource management policies given to applications πŸ‘‘
  • -s β€” runs the program with an initial suspended state by calling posix_spawnattr_setflags(3) with POSIX_SPAWN_START_SUSPENDED 🧊
fr fr, every single one of those is a real flag β€” don't come for me if you skimmed, bestie πŸ’…

🌈 SEE ALSO 🌈

setpriority(2), posix_spawnattr_setflags(3), setiopolicy_np(3)


and that's the whole page, no cap πŸ’œ this lil legend lives on Darwin, dated February 21, 2013 β€” vintage but still iconic, and yes she's still TASKPOLICY(8) at the top and bottom of every page, slay πŸ’–βœ¨

πŸ“¦ where this page comes from