Coder Social home page Coder Social logo

ntn's Introduction

Not Too Nice (NTN)

Is a linux tool that adds alias files for other commands to make them run in very low priority by default. It adds this prefix: chrt -i 0 ionice -c 3 to the command, which means that the command will run on IDLE scheduler policy and on IDLE IO priority. The idle here doesn't mean that the command is idle (not running), it means that the task will be scheduled in IDLE policy which is in the least priority among others.

Why

Because this solution adds 0 overhead to auto down-prioritize tasks while keeping the arguments call the same plus without changing/touching any of the others files.

Adding Example

sudo ntn -a balooctl

This will add /usr/local/bin/balooctl file with the following content:

#!/usr/bin/env bash
chrt -i 0 ionice -c 3 /usr/bin/balooctl "$@"

If you, or the system runs balooctl. Then it will be ran with IDLE sched/io policies.

-a will also try to update the currently running task by its pid automatically.

Remove Example

sudo ntn -r balooctl

Watch tasks policies

ntn -w

TS: means normal policy (i.e. CFS) You will see IDLE instead if the task you're watching is added via ntn

List Added Tasks

ntn -l

Auto Add preconfigured commands

sudo ntn -u

This is like an update, it will go through this list and it adds the command if the command exists.

Thanks

ntn's People

Contributors

hamadmarri avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ptr1337 kinale

ntn's Issues

shellcheck

Why don't you use shellcheck? shellcheck.net can be used to capture bugs in the ntn shell script. I've invoked shellcheck on the ntn script and it reported a bunch of issues (which should be fixed).

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.