GithubHelp home page GithubHelp logo

komachi / ananicy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nefelim4ag/ananicy

0.0 0.0 0.0 688 KB

Ananicy - is Another auto nice daemon, with community rules support (Use pull request please)

License: GNU General Public License v3.0

Shell 5.49% Makefile 4.96% Python 89.55%

ananicy's Introduction

Ananicy

Description

Ananicy (ANother Auto NICe daemon) โ€” is a shell daemon created to manage processes' IO and CPU priorities, with community-driven set of rules for popular applications (anyone may add their own rule via github's pull request mechanism). It's mainly for desktop usage.

I just wanted a tool for auto set programs nice in my system, i.e.:

  • Why do I get lag, while compiling kernel and playing games?
  • Why does dropbox client eat all my IO?
  • Why does torrent/dc client make my laptop run slower?
  • ...

Use ananicy to fix these problems!

Versions

X.Y.Z where
X - Major version,
Y - Script version - reset on each major update
Z - Rules version - reset on each script update

Read more about semantic versioning here

Installation

To use ananicy you must have systemd installed.

You can install ananicy manually by:

$ git clone https://github.com/Nefelim4ag/Ananicy.git /tmp/ananicy
$ cd /tmp/ananicy
$ sudo make install
$ git clone https://github.com/Nefelim4ag/Ananicy.git
$ ./Ananicy/package.sh debian
$ sudo dpkg -i ./Ananicy/ananicy-*.deb

Enable

$ sudo systemctl enable ananicy
$ sudo systemctl start ananicy

Configuration

Rules files should be placed under /etc/ananicy.d/ directory and have *.rules extension. Inside .rules file every process is described on a separate line. General syntax is described below:

{ "name": "gcc", "type": "Heavy_CPU", "nice": 19, "ioclass": "best-effort", "ionice": 7, "cgroup": "cpu90" }

All fields except name are optional.

name used for match processes by exec bin name

~ basename $(sudo realpath /proc/1/exe)
systemd

Currently matching by other things is not supported.

You can check what Ananicy sees, by:

ananicy dump proc

Ananicy loads all rules in ram while starting, so to apply rules, you must restart the service.

Available ionice values:

$ man ionice

Simple rules for writing rules

CFQ IO Scheduller also uses nice for internal scheduling, so it's mean processes with same IO class and IO priority, but with different nicceness will take advantages of nice also for IO.

  1. Avoid changing nice of system wide process like initrd.
  2. Please try to use full process name (or name with ^$ symbols like NAME=^full_name$)
  3. When writing rule - try to only use nice, it must be enough in most cases.
  4. Don't try set to high priority! Niceness can fix some performance problems, but can't give you more. Example: pulseaudio uses nice -11 by default, if you set other cpu hungry task, with nice {-20..-12} you can catch a sound glitches.
  5. For CPU hungry backround task like compiling, just use NICE=19.

About IO priority:

  1. It's useful to use {"ioclass": "idle"} for IO hungry background tasks like: file indexers, Cloud Clients, Backups and etc.
  2. It's not cool to set realtime to all tasks. The RT scheduling class is given first access to the disk, regardless of what else is going on in the system. Thus the RT class needs to be used with some care, as it can starve other processes. So try to use ioclass first.

Debugging

Get ananicy output with journalctl:

$ journalctl -efu ananicy.service

Missing schedtool

If you see this error in the output

Jan 24 09:44:18 tony-dev ananicy[13783]: ERRO: Missing schedtool! Abort!

Fix it in Ubuntu with

sudo apt install schedtool

Submitting new rules

Please use pull request, thanks

ananicy's People

Contributors

adworacz avatar agireud avatar atrate avatar birdthatcantfly avatar coledot avatar filipopo avatar francoism90 avatar gauravjuvekar avatar grasegger avatar haron-prime avatar hsmalley avatar icewind1991 avatar in-line avatar izissise avatar kfeoktistoff avatar liberodark avatar naufalw avatar nefelim4ag avatar nightbane112 avatar openglfreak avatar ryanmusante avatar saswotlamichhane avatar seketh avatar shoober420 avatar techcable avatar terencode avatar themadprofessor avatar thermi avatar wilbowma avatar xratix avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.