Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
OpenRC vs runit
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
pun_guin
Apprentice
Apprentice


Joined: 06 Feb 2018
Posts: 166

PostPosted: Tue Feb 20, 2018 10:20 pm    Post subject: OpenRC vs runit Reply with quote

Since we were talking about that:
I noticed that Gentoo with OpenRC has a notably slower startup than Void/runit.

Is that a Gentoo or a pun_guin problem?
_________________
I already use the new Genthree.
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 5444
Location: Removed by Neddy

PostPosted: Tue Feb 20, 2018 11:05 pm    Post subject: Reply with quote

How slow is slow?

Have you enabled parallel startup in /etc/rc.conf
_________________
The best argument against democracy is a five-minute conversation with the average voter
Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1353
Location: KUUSANKOSKI, Finland

PostPosted: Tue Feb 20, 2018 11:31 pm    Post subject: Reply with quote

*takes cover in a bomb shelter*

This might not end well...

Anyway. What I've read, runit is lighter and faster generally than OpenRC (so a big YMMV here.). I think runit can run with only busybox alongside of it. That would make it quite light at least.
But I really haven't bothered to switch. My uptimes tend to be around 60d, so boot time isn't a factor for me. :P

(I mainly posted here to follow replies. I'd like to know the technical differences on speed etc. *grabs popcorn*)
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5225

PostPosted: Wed Feb 21, 2018 7:52 pm    Post subject: Reply with quote

OpenRC is built around the completely broken Debian-ism of starting processes, forcing them into the background, inserting ad-hoc delays, and then checking to see if they've crashed or not (via pidfiles, another dirty hack). This is pretty ironic considering it usually runs atop sysvinit, which could do service management the right way already but gets completely bypassed in this arrangement.

So you've got artificial delays everywhere, made worse by the fact it's serial by default and parallelism is a hack that's still considered experimental (and with OpenRC's current maintaner, will likely never become safe to use).
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1353
Location: KUUSANKOSKI, Finland

PostPosted: Wed Feb 21, 2018 10:54 pm    Post subject: Reply with quote

Ant P. wrote:
inserting ad-hoc delays, and then checking to see if they've crashed or not (via pidfiles, another dirty hack).
This is because in case if some other service depends on the just started service? This basically adds every other yet to be started service in the delay line unless rc_parallel is enabled?
Shame it's still considered ~feature. :\
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5225

PostPosted: Thu Feb 22, 2018 1:10 am    Post subject: Reply with quote

It was probably done that way because it was easy to implement in shell scripts (which is what nearly all rc layers were built in back in the day). Most of OpenRC nowadays is compiled C code but they can't get rid of the original APIs without breaking everything. Which is to say, they probably will at some point without asking.
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1353
Location: KUUSANKOSKI, Finland

PostPosted: Thu Feb 22, 2018 9:51 am    Post subject: Reply with quote

Ant P. wrote:
Most of OpenRC nowadays is compiled C code but they can't get rid of the original APIs without breaking everything. Which is to say, they probably will at some point without asking.
There should be at least config switch for people to choose which method to use then (if it's feasible). Then slowly deprecate the old way.
Anyway, how does runit handle process failure checks? Can runit do parallel starvice startups?
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5225

PostPosted: Thu Feb 22, 2018 7:54 pm    Post subject: Reply with quote

runit is like sysvinit, where it autostarts every service and any that exit are auto-restarted (with a 1 second delay, to avoid crash loops eating all the CPU). There's no need for pid files because processes send a SIGCHLD when they exit. Everything is parallel by default, unless you go out of your way in writing service scripts to force them to serialize.

For the few cases where things need to be started strictly in order (e.g. nfsd) the common idiom is to have the service script check if all the dependencies are ready and exit/retry until they are, which is a one-liner.
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1353
Location: KUUSANKOSKI, Finland

PostPosted: Thu Feb 22, 2018 8:52 pm    Post subject: Reply with quote

I have to admit, I really like the simplistic nature of runit. I think I like epoch (github project) even more. Sadly its development seem to ceased.

Then another alternative I've been looking is nosh. But it seems to be too complex. It, however, has some tools to convert systemd service units to nosh service files. :P
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1353
Location: KUUSANKOSKI, Finland

PostPosted: Thu Mar 08, 2018 7:50 pm    Post subject: Reply with quote

I've installed Void Linux on my laptop (musl variant), and I have to say... So far runit has been an excellent. Maybe it's its simplicity that makes it perform so well/fast.

I might try runit out on my desktop. I just need to go more deep into the features of it vs. OpenRC.
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 3350
Location: Dallas area

PostPosted: Thu Mar 08, 2018 8:18 pm    Post subject: Reply with quote

Haven't heard of void linux before, of course I don't typically look around for a binary distro.
But it does sound interesting, I'll have to give it a look sometime.
_________________
Asus m5a99fx, FX 8320 - nouveau & radeon, oss4
Acer laptop E5-575, i3-7100u - i965, alsa
---both---
4.14.62 kernel, profile 17.0 (no-pie) amd64-no-multilib
gcc 4.9.4 & 7.3.0, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
Marcih
Tux's lil' helper
Tux's lil' helper


Joined: 19 Feb 2018
Posts: 86

PostPosted: Thu Mar 08, 2018 8:32 pm    Post subject: Reply with quote

Ant P. wrote:
OpenRC is shit.

Everyone not named Lennart wrote:
systemd is shit.

Well, shit... Time to stop browsing the forums and go write my own init scripts I suppose.
_________________
Bones McCracker wrote:
It wouldn't be so bad, if it didn't suck.
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1353
Location: KUUSANKOSKI, Finland

PostPosted: Thu Mar 08, 2018 9:52 pm    Post subject: Reply with quote

Marcih wrote:
Time to stop browsing the forums and go write my own init scripts I suppose.
... for runit. ;)
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
pun_guin
Apprentice
Apprentice


Joined: 06 Feb 2018
Posts: 166

PostPosted: Mon Mar 19, 2018 1:02 am    Post subject: Reply with quote

I totally forgot to check for answers here - ha!

Naib wrote:
Have you enabled parallel startup in /etc/rc.conf


I have not modified that. But according to what followed, OpenRC will never be as fast as runit ...?
So I'll leave it at that. One second more or less - probably not worth the ~feature.

Thank you all! :)
_________________
I already use the new Genthree.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum