On Fri, 13 Jan 2017 21:12:27 -0800
39066dd5_at_gmail.com wrote:
> I'm using runit as my primary init on Linux to good effect but have
> noticed that it accumulates CPU time even while the system is idle. I
> suspect that this is a consequence of runsvdir polling the service
> directory for changes and that using inotify would reduce this. This
> would introduce some complexity and variance between platforms but
> bring the benefit of removing a source of CPU wake-ups. Has using
> inotify been considered and rejected for another reason?
How much time in how much uptime? Which process are you looking at with
this accumulated time? Here's what I get:
============================================================
[slitt_at_mydesk ~]$ ps ax | grep run | grep -v 0:00
    1 ?        Ss     2:07 runit
  693 ?        Ss    32:59 runsvdir -P /run/runit/runsvdir/current log:
c: Module load failed. E: [pulseaudio] main.c: Failed to initialize
daemon. Traceback (most recent call last):   File
"/d/at/python/reminder_check/reminder_check.py", line 6, in
<module>     import tkinter ImportError: No module named 'tkinter'
Traceback (most recent call last):   File "/d/bats/warnform.py", line
9, in <module>     from tkinter import * ImportError: No module named
'tkinter' 
709 ?        Ss    12:19 runsv supervise 
711 ?        Ss    12:44 runsv wpa_supplicant 
720 ?        Ss    12:52 runsv pulseaudio 
722 ?        Ss    21:06 runsv reminder_check 
723 ?        Ss    12:06 runsv current 
[slitt_at_mydesk ~]$
============================================================
That's a total of roughly 1 hour and 45 minutes. Now consider my uptime:
============================================================
[slitt_at_mydesk ~]$ uptime
 15:51:03 up 13 days,  2:35,  1 user,  load average: 0.28, 0.32, 0.35
[slitt_at_mydesk ~]$ 
============================================================
That means my runit time is 0.56 of the time my computer's been up. I
can easily live with that for the simplicity benefit of runit,
including the fact that it polls.
Besides, a lot of the runsv's had times of 0, including the ones for
the virtual terminals. Of the ones that had times, a lot were
supervising iffy apps, such as pulseaudio, wpa_supplicant, which
terminates at the drop of a hat, and reminder_check, a home-grown
Python reminder system that I run as a daemon, and which I never tested
for stability.
I wouldn't care to guess how much time these apps would consume
supervising or respawning with other init systems.
On my computer, none of this in any practical way affects my computing.
I would guess on a more heavily used computer, any deleterious effects
of runit time consumption could be solved by running runsvdir and all
the runsv's with a positive nice value.
In my opinion, by far the greatest benefit of runit is its simplicity,
and there's no way I'd trade that for a theoretical efficiency benefit.
SteveT
Steve Litt 
January 2017 featured book: Troubleshooting: Just the Facts
http://www.troubleshooters.com/tjust
Received on Sat Jan 14 2017 - 21:10:07 UTC