You are not logged in.

#1 2014-12-25 23:13:10

frash23
Member
From: Denmark
Registered: 2014-03-26
Posts: 49
Website

VeryNice not nicing programs?

I installed verynice from the AUR and configured & enabled it as instructed, but it doesn't seem to change nice-ness of any applications.

This is systemctl status verynice.service:

● verynice.service - A tool for dynamically adjusting the nice-level of processes
   Loaded: loaded (/usr/lib/systemd/system/verynice.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2014-12-25 23:42:12 CET; 24min ago
  Process: 27683 ExecStop=/bin/kill -15 $MAINPID (code=exited, status=0/SUCCESS)
  Process: 27686 ExecStart=/usr/bin/verynice -d /var/run/verynice.pid (code=exited, status=0/SUCCESS)
 Main PID: 27687 (verynice)
   CGroup: /system.slice/verynice.service
           └─27687 /usr/bin/verynice -d /var/run/verynice.pid

Dec 25 23:42:12 parch verynice[27687]: starting up
Dec 25 23:42:12 parch systemd[1]: Started A tool for dynamically adjusting the nice-level of processes.

Here is my /etc/verynice.conf:

# verynice.conf -- sample configuration file
#
# declare root immune (root owned processes will never be adjusted)
# immuneuser root

# declare immune program, matlab in this case. If the line is uncommented,
# any program with "matlab" in it's path will be immune to renicing.
# The quoted quantity must match a substring of the symbolic link in
# /proc/{pid}/exe 
# if there is a leading slash, the match must be precise
#immuneexe "matlab"

# declare "bad" program -- automatically niced to batch job level
#badexe "mathematica"

# declare "hungry" program -- always assumed to have 100% cpu usage,
#                             regardless of actual usage. For programs
#                             which tend to have lots of little subprocesses
#                             with short lifetimes to do their dirty work
#                             (such as "make")
# (we use leading slashes and various possible paths so that we will never
#  accidentally give this flag to another program)
# Note that it IS possible to set both the "hungry" and "runaway" flags
# simultaneously (process will always be killed after a certain amount of time)
hungryexe "/usr/bin/make"
hungryexe "/usr/bin/gmake"
hungryexe "/bin/make"
hungryexe "/bin/gmake"
hungryexe "/make"
hungryexe "/gmake"
hungryexe "/gnumake"
hungryexe "/usr/local/bin/make"
hungryexe "/usr/local/bin/gmake"
hungryexe "/usr/local/bin/gnumake"
hungryexe "/usr/bin/upx"
hungryexe "/usr/bin/openvpn"

# declare "good" program -- automatically negatively reniced to 
# multimedia job level. goodexe "xmms" reduces the chances of skipping when
# playing mp3's
# Also we do this for "xanim" and "realplay"
goodexe "mpd"
goodexe "cdrecord"
goodexe "xcdroast"
goodexe "firefox"
goodexe "chromium"
goodexe "vim"
goodexe "snapwm"
goodexe "pulseaudio"

# Making the X server a "good" program is usually a good idea too
#   -- X is essentially a multimedia app. These next few lines will 
#   work even if root is declared an "immune" user and X is run as root, 
#   because "goodexe"'s specified in verynice.conf are exceptions to
#   the "immuneuser" rule
# (these are appropriate for RedHat Linux, with XFree 3.x -- the appropriate
# file might be different on your system. To find the proper name, do a PS
# to find the X pid, then ls -l /proc/{pid}/exe
goodexe "/etc/X11/X"
goodexe "/usr/bin/Xorg.bin"
goodexe "Xorg.bin"
goodexe "/usr/X11R6/bin/XF86_SVGA"
goodexe "/usr/X11R6/bin/XF86_Mono"
goodexe "/usr/X11R6/bin/XF86_VGA16"
goodexe "/usr/X11R6/bin/XF86_S3"
goodexe "/usr/X11R6/bin/XF86_Mach32"
goodexe "/usr/X11R6/bin/XF86_Mach64"
goodexe "/usr/X11R6/bin/XF86_Mach8"
goodexe "/usr/X11R6/bin/XF86_8514"
goodexe "/usr/X11R6/bin/XF86_P9000"
goodexe "/usr/X11R6/bin/XF86_AGX"
goodexe "/usr/X11R6/bin/XF86_W32"
# These are for XFree86 4.0, but haven't been tested
goodexe "/usr/X11R6/bin/XFree86"
goodexe "/usr/X11R6/bin/X"

# declare "potential runaway" program. potential runaways can go to a lower
# priority (reniced all the way to +20), and if they exceed that will be
# killed. Other processes are never killed. This is good for netscape and 
# any other programs with a tendency to start eating the CPU for no reason.
runawayexe "netscape"
runawayexe "Fvwm"
runawayexe "xfig"
runawayexe "gimp"
runawayexe "python"
runawayexe "skype"


# Sample additional parameters, specifying the built in defaults
notnice    -4
batchjob   18
runaway    20
kill       22
badkarmarate .0167
badkarmarestorationrate .0167
periodicity 60
rereadcfgperiodicity 60

For example, mpd is still nice 0 (ps -axl):

F   UID   PID  PPID PRI  NI    VSZ   RSS WCHAN  STAT TTY        TIME COMMAND
1  1000  8279     1   1   0 614124 33108 ep_pol Ssl  ?          5:06 mpd

Any ideas?


Amateur web developer & Linux enthusiast

Offline

#2 2014-12-25 23:18:36

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: VeryNice not nicing programs?

I think this sort of thing is better handled by systemd using cgroups.
https://wiki.archlinux.org/index.php/Cgroups


Jin, Jîyan, Azadî

Offline

#3 2014-12-25 23:28:09

frash23
Member
From: Denmark
Registered: 2014-03-26
Posts: 49
Website

Re: VeryNice not nicing programs?

Hi Head_on_a_Stick,

CGroups seems like a lot of setup for what I am looking for - I don't want to manually set up a group for each application I want, and I want to automatically de-nice(?) applications that might just cause a leak or infinite loop without me knowing.

CGroups also seems to require starting applications in alternate ways - I don't want to change all my executables.


Amateur web developer & Linux enthusiast

Offline

#4 2014-12-26 11:23:02

frash23
Member
From: Denmark
Registered: 2014-03-26
Posts: 49
Website

Re: VeryNice not nicing programs?

I suppose I'll try writing my own daemon for this in bash - shouldn't be too hard.


Amateur web developer & Linux enthusiast

Offline

#5 2014-12-26 12:48:38

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,019

Re: VeryNice not nicing programs?

ulatencyd is a nice program taking advantage of cgroups - sadly, it seems to have been abandoned.

Offline

Board footer

Powered by FluxBB