Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/phd/niced
a daemon renicing new and existing processes
https://github.com/phd/niced
daemon ionice nice oom-adj oom-score-adj renice
Last synced: 6 days ago
JSON representation
a daemon renicing new and existing processes
- Host: GitHub
- URL: https://github.com/phd/niced
- Owner: phd
- License: gpl-3.0
- Created: 2023-08-10T12:10:49.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-07-19T08:26:41.000Z (5 months ago)
- Last Synced: 2024-07-19T16:55:05.078Z (5 months ago)
- Topics: daemon, ionice, nice, oom-adj, oom-score-adj, renice
- Language: Python
- Homepage:
- Size: 75.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
niced
=====a daemon renicing new and existing processes
Description
-----------`niced` is a daemon which monitors new (using the Linux netlink connector) and
existing processes and changes their 'niceness' according to configured rules.It supports modification of processes' `nice`, `ionice` and
`oom_adj`/`oom_score_adj` properties.This daemon was inspired by the `renice` project and the configuration file
should be backward compatible.Daemon
------`systemd` service is provided:
$ sudo systemctl enable niced.service
$ sudo systemctl start niced.serviceSynopsis
--------`niced [--config-file PATH] [-h|--help]`
`--config-file`
use given configuration file instead of `/etc/niced.conf`Configuration
-------------Configuration is stored in the `/etc/niced.conf` file.
Modifying `niced` behavior:
- `@full_scan_interval = N`
in seconds, default is `10`
- `@verbose = N`
`-2` silent, `-1` quiet, `0` default, `1` yes, `2` very, `3` debugLines beginning with `#` are comments.
### Configuration rules
Syntax:
`actions pattern`Actions can be separated with a comma, or written together without separators.
#### Actions
Syntax:
`action[parameter]`Actions and parameters:
- modifiers:
- `I` - case-insensitive pattern
- `F` - forced rule, reapplied every full scan
- `R` - recursive: `1...`, default is `inf`
- nice:
- `n` - nice: `-20...19`, default is `10`
- ionice:
- `r` - realtime ionice: `0...7`, default is `4`
- `b` - best-effort ionice: `0...7`, default is `4`
- `i` - idle ionice
- oom:
- `o` - oom_adj: `-17...15`, default is `0`
- `O` - oom_score_adj: `-1000...1000`, default is `0`#### Patterns
Patterns are regular expressions, case-sensitive by default.
The entire command including parameters is matched.
If your pattern begins with `^` or `(`, it is matched literally. This means you
have to keep in mind a potential full path before the executable name or the
parameters after it.Otherwise `niced` takes care of those for you by enclosing your pattern with the
following regular expression syntax:`([^\s]*/)?` and `(\s.*)?`
### Examples
`/etc/niced.conf`:
```
@full_scan_interval = 10
@verbose = 3
n-15 Xorg
n-15 kwin_x11
n-15 pulseaudio
n-10 barrier
n-10 mpv
n0R1 plasmashell
n-5 plasmashell
n0R1 krunner
n-5 krunner
n0 konsole
n1RI SCREEN
in10 ark
in10 tar
in10 unxz
in10 dpkg
in10 mandb
in15 gcc
in15 g++
in15 cc1
in15 cc1plus
in15 dkms
in15 gp
```Files
-----`/etc/niced.conf`
Dependencies
------------- `python3`
- `forkstat`See also
--------`nice(1)`, `ionice(1)`, `proc(5)`, `forkstat(8)`
Bugs
----Report bugs or ideas at https://github.com/phd/niced/issues
Author
------Copyright (C) 2023 Piotr Henryk Dabrowski <[email protected]>