Skip to main content

re-nice processes basing on custom rules

Project description

petique

petique adjusts nice, ionice and OOM adjust score of processes based on custom rules defined in a config file.

Configuration

Configuration is a TOML file consisting of independant rules:

[vlc]  # rule name, name is only significant to you
name = "vlc"  # regular expression, matches process name
nice = 10  # when rule is matched, sets nice of process to 10

# nice can go from -20 (most prioritary) to 19 (least prioritary)
# though only root can set negative values
# see `nice(1)` manual page

[borg]
exe = "/usr/bin/borg"  # regular expression, matches binary path
ionice = "idle"  # when rule is matched, sets ionice of process to "idle" mode

# ionice values can be "b1" to "b7" (best-effort, from more prioritary to least prioritary)
# or "idle" (even less prioritary than b7) or "rt" (real-time, high-priority, only for root user)
# see `ionice(1)` manual page

[firefox_tab]
cmdline = ".*firefox -contentproc.*"  # regular expression, matches full command line with args
oom_adj = 1000  # when rule is matched, sets oom adjust of process to 1000

# oom_adj can be from -1000 (immune against OOM-killer) to 1000 (more likely to be killed)
# see `choom(1)` manual page

Rules match processes based on their process name, binary or full command-line, and adjust nice, ionice or oom-adjust score.

Run petique --list to see all processes and their name, exe, cmdline. This is handy for writing rules patterns.

Usage

petique [-n | --dry-run] [-v | --verbose] [--rule NAME] [--config FILE]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

petique-0.2.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

petique-0.2.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file petique-0.2.0.tar.gz.

File metadata

  • Download URL: petique-0.2.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for petique-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f8b16328bc7f5184e6f5f724b563ca7c85ac557557bac535ff3c0b61ecd86e77
MD5 09cf9b4062961e9a8624e040391d800b
BLAKE2b-256 93627a757b3829fc523091f507eedbf0eefaeb9abaaf613d1d763d750b978955

See more details on using hashes here.

File details

Details for the file petique-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: petique-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for petique-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff3045e8ece4f710afa32f3beb87d9818cc77ae30000c88e3eab26db02cb66f7
MD5 29b73485f6cae1f5bbd1a57c2ac154cc
BLAKE2b-256 9049a73a6d76df9e65bf2564e59448b8348c6cfe651a0afc04a010511a9acc16

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page