Skip to content

Nefelim4ag/Ananicy

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

* can now destinguish by cmdline; increased check_freq to double of prev value

* 7 new rules

* rule for freenet

* rule for waterfox-g4

* removed rule for android studio

* fixed freenet rule

* updated readme

* updated readme

* test

* undo of  test

* better organised the firefox rules

* rule for firedragon

* renamed wezterm

* removed unneeded whitespace

* added nuclear

* fixed whitespace in doom64

* rule micro

* added todo

* changed rule for yay and paru from BG_CPUIO to Heavy_CPU

* changed rule format for kf2

* created folder for text editors

* moved some more text editors to the correct folder

* rule cuda-text

* rule tiger vnc viwer

* test

* test

* test

* updated readme, renamed vnc viewer

* fix

* organised some of the browsers

* updated readme

* updated todo, solution preparation

* updated vnc-viewer type

* update vnc-viewer to a more appropriate type

* updated readme

* fixed a line that caused ananicy-cpp to flag this file as invalid

* added freenet to broken rules due to increasing ananicy-cpp's CPU usage significantly

* added freenet to broken rules due to increasing ananicy-cpp's CPU usage significantly

* added hoi4

* moved some games to the games folder

* removed duplicate

* added some info

* moved google chrome in browsers

* created folder for DEs and WMs and moved some of the rules

* moved xmonad

* updated readme

* moved vivaldi to browsers

* changed g++ and gcc to Heavy_CPU from BG_CPUIO

* major changes to types

* added terminal tye

* added browser type

* type adjustment

* folder packae managers created

* rule change, created DE-WM

* added sxhkd

* hopefully unfucked the RT disaster

* hope

* hope is running out

* test1

* re-enable sxhkd

* disabled sxhkd

* re-enabled xorg

* re-enabled pulseaudio

* re-enabled lightdm

* updated types

* resolved duplicate of chrome

* updated tilix

* moved a bunch of games to the games folder

* created folder for image viewers

* resolved duplicate

* resolved duplicate

* resolved duplicate

* duplicate

* duplicate

* added polybar

* updates types

* updates game type

* updated classes

* updated some types

* added new types, updated some applications

* updated types

* updated rules

* updated some arch utils

* created chat folder

* organised

* updated image viewers

* updated image viewers

* updated terminals

* updated torrents

* updated screenshotters

* updated screenshotters

* updated services

* updated ubisoft

* updated servers

* updated rules

* updated game launchers

* updated compilers

* organised chat

* organised chat

* organised games

* organised video players

* organised music players

* organised browsers

* updated types

* updated syncthing

* more

* created databases

* updated fileroller

* added vpns

* update

* updated types

* update

* update

* update

* updated compilers

* update

* asd

* asd

* fixed #427

* added type torrent-compliant

* fix dump rules by converting cmdlines to a list

* updated README

* added new type image-editor

* Update rules

* Update and rename ananicy.d/00-default/yakuake.rules to ananicy.d/00-default/terminals/yakuake.rules

* added new type text-editor

* organised video players

* renamed VPN type to upper case

* guake is terminal not doc-view

* moved guake to terminals folder

* moved stelarris to games, updated hoi4

* new way of handling niceness

* updated hoi4

* Add Control rules

* Update _steam.rules

Missing dash '#' as comments near the end of the file

* add openbox.rules

* add gamemoded.rules

* added sc2

* added bluetoothd.rules

* add PipeWire

* add KDE Plasma

* add SDDM

* add XWayland

* updated torrents and starcraft2

* adjusted some types

* updated archiver type

* updated tf2 priority

* added cups.rules under services

I'm not certain if is a server or a service so...

* updated tf2 priority

* introduce 'audio-server' type and assign pipewire and pulseaudio to it

* move audio players to the respective folder

* correct 'audio-servers' folder name

* move dolphin emulator to 'games' folder

* change go and rust types to 'compiler' and moved to respective folder

* move all games to the 'games' folder

* set the type of dropbox to 'server'

* set the type of ark to 'archiver'

* set the type of dropbox to 'service' and move it to respective folder

* delete duplicated cups rules

* fix dnsmasq rules

* move signal to the 'chat' folder

* introduce 'document-viewer' type and respective folder, move doc viewers there; introduce new marker type 'TODO' to make rules needing attention visible

* move chat apps to the respective folder

* introduce 'email-client' type and move specific rules there

* add rules for xfce mousepad text editor

* introduce a 'document-editor' type and fix related rules

* fix tmux's type to 'terminal'

* move zoom to the 'chat' folder

* introduce 'file-manager' type and set it accordingly

* introduce 'file-sync' type and set it appropriately

* treat ninja as 'compiler' and add meson

* change 'torrent' to 'p2p-client' and add additional rules

* move archlinux to the 'package-managers' folder

* add Enter the Gungeon as 'game'

* add javac 'compiler'

* updated types's notes

* organisation

* updated freenet

* updated freenet

* some personal rules merged here, seems Nefelim4ag ananicy\'s dead

* updated rules

* fix

* update

* updated game type, added madnedd project nexus, added readme to wine/

* updated madness project nexus

* updated types

* added more info, updated freenet

* hotfix

* updated freenet

* added more info

* Update gnome.rules

* Update lxdm.rules

* Update sddm.rules

* Update gpicview.rules

* Delete xfce4.rules

* Update and rename ananicy.d/00-default/desktop-others/NetworkManager.rules to ananicy.d/00-default/NetworkManager.rules

* Update and rename ananicy.d/00-default/desktop-others/gpg-agent.rules to ananicy.d/00-default/gpg-agent.rules

* Update leafpad.rules

* Update nano.rules

* Update flameshot.rules

* Update teamviewer.rules

* Update remmina.rules

* Update and rename ananicy.d/00-default/desktop-others/ntfs-3g.rules to ananicy.d/00-default/ntfs-3g.rules

* Update zathura.rules

* Update and rename ananicy.d/00-default/desktop-others/speedcrunch.rules to ananicy.d/00-default/speedcrunch.rules

* Update unbound.rules

* Update dnsmasq.rules

* Update dnscrypt-proxy.rules

* Update blocky.rules

* Update and rename ananicy.d/00-default/desktop-others/plank.rules to ananicy.d/00-default/DEWM/plank.rules

* update

* organised

* brought back torrent type

* adjust

* added ice-weasel, dino, geany, lf, pcmanfm, nsxiv, sxiv and moc

* add spacing around the braces

* fix spaces around braces

* add DiscordDevelopment

* add URxvt

* add surf and fix urxvt comment

* added yacy; updated rules

* cmdlines are now par of rule key; organised rules; updated info

* new type `common-utility`; added `rsync` to said type

* Project Zomboid

* The Ascent

* Needed one more .exe for ascent

* Adding Evil Genius & Cyberpunk 2077

* Add DiscordPTB and DiscordCanary

* updated freenet

* add xterm.rules under terminals/

* move GW2 to games folder

* added universe sandbox 2

Co-authored-by: asdfg <znamsiparolata4esno@abv.bg>
Co-authored-by: bkosowski <kosowski.ba@gmail.com>
Co-authored-by: kuche1 <42280671+kuche1@users.noreply.github.com>
Co-authored-by: Technetium1 <Technetium1@users.noreply.github.com>
Co-authored-by: Jacob Highfield <camperboy1000@gmail.com>
Co-authored-by: speedytux <speedytux@pm.me>
Co-authored-by: Yurin Doctrine <43861005+YurinDoctrine@users.noreply.github.com>
Co-authored-by: Christoph Heinrich <christoph.heinrich@student.tugraz.at>
Co-authored-by: cuzrawr <46599814+cuzrawr@users.noreply.github.com>
Co-authored-by: riccardiunix <riccardo.bordon.2014@gmail.com>
Co-authored-by: Riccardo Bordon <17615901+Riccardiunix@users.noreply.github.com>
Co-authored-by: sitiom <sitiom@proton.me>
Co-authored-by: Yurin Doctrine <bayramyurgidenn@gmail.com>
8a10460

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
November 4, 2022 00:30
November 4, 2022 00:30
April 30, 2016 04:36
April 22, 2018 03:27
November 4, 2022 00:30
November 4, 2022 00:30

Ananicy

Installation

  • logo Arch: AUR/minq-ananicy-git. paru -S minq-ananicy-git or yay -S minq-ananicy-git should do the trick. Don't forget to start and enable the service by running sudo systemctl start ananicy.service and sudo systemctl enable ananicy.service.

For more information click here

What's new?

More, updated and better organised rules.

Support for cmdline in rules added. This is particularly useful for applications that share the same name (looking at you Java). See the freenet rule as an example:

{ "name": "java", "cmdlines": ["freenet.node.NodeStarter"], "type": "service" }

This translates to: apply the rule to any process named java, that received freenet.node.NodeStarter as a command line argument. You can add more than one "cmdlines" in case you want to fine tune your rules.

Old description

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