https://github.com/david-lor/autonice
Utility for setting nice in running applications based on settings
https://github.com/david-lor/autonice
Last synced: 10 months ago
JSON representation
Utility for setting nice in running applications based on settings
- Host: GitHub
- URL: https://github.com/david-lor/autonice
- Owner: David-Lor
- License: isc
- Created: 2021-06-06T10:39:20.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-06T10:43:12.000Z (over 4 years ago)
- Last Synced: 2025-02-04T02:58:16.669Z (11 months ago)
- Language: Python
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# autonice
Utility for setting nice in running applications based on settings.
Currently only supporting ionice.
**This project is experimental and might have undesirable effects.
Use it under your responsability!**
## Getting started
This utility only needs Python >= 3.6. Running as root may be required for modifying processes running as different users, and changing priorities to certain important levels.
To run autonice, cd to the project and run `python .`
## Config file
At this moment the settings must be provided via a JSON file; see the [example provided](settings.sample.json).
This file must be located within the current working directory and be named "settings.json", but its name and location can be changed by setting the environment variable "AUTONICE_SETTINGS", which refers to the absolute or relative path of the config file.
The complete config file format is the following:
- **processes**: array of processes to change; array of objects with the following format:
- **name**: partial process name to match. All the processes that contain this name will be processed with the settings of the current Process object.
- **match_full_name**: if true, match full processes names, including command arguments (default=false)
- **ionice_class**: if set, change ionice of the matching processes. Must be one of "none", "idle", "best-effort", "real-time". See [ionice manual](https://linux.die.net/man/1/ionice) for more information.
- **ionice_class_data**: additional arguments for ionice class, usually the process IO priority for certain classes. See [ionice manual](https://linux.die.net/man/1/ionice) for more information.
## TODO
- Add nice support
- Add Docker support (change priorities of processes running within a Docker container)
- Run as a "service", periodically checking processes
- Manage failures when setting ionice on multiple processes in batch fails because one process stops existing (retry with less processes or one by one)
- Add proper logging