weird science experiments with init systems - part one

Forum rules
We believe in Hello and Thank You.
pidsley
Hermit
Posts: 2539
Joined: Wed Oct 17, 2012 12:31 pm

weird science experiments with init systems - part one

Unread post by pidsley » Sat Jan 25, 2014 7:11 pm

Init system wars have been flaring up everywhere lately. Several init systems are in the Debian repos and are easy to install, so I tried a few.

Let me say this right up front -- this is not an invitation to discuss the political merits of each init system. I don't want to hear about how you don't like pulseaudio or think canonical is evil. If you want to rant, get a blog. If you have real technical knowledge to share (without political bias), that would be interesting. If you think using upstart means you have to use Mir or Unity, just STFU.

I'm also not going to explain how each init system is different, or how an init system works in general. Frankly, I'm not qualified to do either of those things. I will try to provide some links so you can go read for yourself. But very simply put (from the upstart description)
The init system handles starting of tasks and services during boot, stopping them during shutdown and supervising them while the system is running.
That's all it does. It doesn't steal your identity, it doesn't kill kittens, and you don't have to name your first male child "Lennart."

In part one, I will look at the easily installed init systems and show some numbers from my experiments. If I feel like going on to part two, I will try a few more difficult variations.

I started with a minimal sid netinstall. I measured boot and shutdown times using a very unscientific method ("time cat" on another machine) -- I know there are other ways to measure boot times, like bootchart and systemd-analyze, but I wanted to use something that was available for every init system and gave a better impression of the time the user sees. I booted the system with the default sysv, then installed other systems and booted into and out of them. I wrote down the result of running "free" immediately after login. Here are the numbers.

Code: Select all

           boot    free    shutdown
sysv       10.8    27096   6.7
upstart    12.2    29772   4.8
openrc     12.1    25876   7.5
systemd    10.7    31384   2.7
As you can see, there is very little real difference in the numbers. systemd is slightly faster on boot and especially shutdown, but it uses more memory. One interesting note -- all of these systems use udev from systemd (yes, even the default sysv install). This really bothers some Gentoo users, so they have forked udev to remove it from systemd (the fork is "eudev"). I have eudev running on my Gentoo system, just as a test. I may try using it on Debian in part two. I may also try to get one or two of the more obscure init systems running, along with busybox init.

The bottom line is that changing your init system on Debian is almost as easy as changing your window manager. It's not something I'd recommend you play with on anything other than a test machine, but it's also not something I lie awake at night worrying about. If anything, the "init system wars" have increased choice by prompting some people to code alternatives and port things from one distro to another. What I hope everyone takes away from this is that no one is "forcing" you to use a particular init system. Learn how your system works and you can use whatever you want.

screenshots or it didn't happen:

sysv:

Image

upstart:

Image

openrc:

Image

systemd:

Image

References:

https://wiki.gentoo.org/wiki/Comparison_of_init_systems
http://www.ibm.com/developerworks/linux ... linuxboot/
http://upstart.ubuntu.com/
https://wiki.debian.org/OpenRC
http://wiki.gentoo.org/wiki/OpenRC
https://wiki.debian.org/Debate/initsystem
http://lwn.net/Articles/529314/
https://github.com/gentoo/eudev

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: weird science experiments with init systems - part one

Unread post by DebianJoe » Sat Jan 25, 2014 7:36 pm

Thanks for sharing.
This is really very interesting, and it will take me a bit to get through the links. I have never really bought into the wars, and have no vested interest, and enjoy a good "side-by-side" comparison of stats.
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: weird science experiments with init systems - part one

Unread post by dkeg » Sat Jan 25, 2014 7:46 pm

Pids, great write up, thank you. And with any project, just as important as stating what is, have to state what its not. Well done

Work hard; Complain less

User avatar
ivanovnegro
Minister of Truth
Posts: 5449
Joined: Wed Oct 17, 2012 11:12 pm

Re: weird science experiments with init systems - part one

Unread post by ivanovnegro » Sat Jan 25, 2014 9:49 pm

/Me likes Pid's science experiments. Great job Oppenheimer.

User avatar
rhowaldt
Dog
Posts: 4565
Joined: Wed Oct 17, 2012 9:01 am
Contact:

Re: weird science experiments with init systems - part one

Unread post by rhowaldt » Sat Jan 25, 2014 10:35 pm

pidsley, you just wrote a simple answer to any discussion about init systems. some mighty valid points were made. copy-paste this link to <random ignorant penisface>.
plus, you are a good writer. keep on experimenting please :)
All statements are true in some sense, false in some sense, meaningless in some sense, true and false in some sense, true and meaningless in some sense, false and meaningless in some sense, and true and false and meaningless in some sense.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: weird science experiments with init systems - part one

Unread post by machinebacon » Sun Jan 26, 2014 1:22 am

Thanks for the write-up and actual numbers. There has been too much biased BS going on on some forums by people who judge everything on hearsay and 'political correctness'.
..gnutella..

User avatar
vic
Godot
Posts: 2118
Joined: Wed Oct 17, 2012 10:11 am
Location: /bin

Re: weird science experiments with init systems - part one

Unread post by vic » Sun Jan 26, 2014 7:59 am

Thanks for the enlightening pidsley, appreciate a good read.

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: weird science experiments with init systems - part one

Unread post by GekkoP » Sun Jan 26, 2014 11:50 am

Interisting stuff, thanks for sharing it. I was planning to do something similar but only with systemd/sysv on different PCs. I thought systemd was faster though.

pidsley
Hermit
Posts: 2539
Joined: Wed Oct 17, 2012 12:31 pm

Re: weird science experiments with init systems - part one

Unread post by pidsley » Sun Jan 26, 2014 2:38 pm

GekkoP wrote:Interisting stuff, thanks for sharing it. I was planning to do something similar but only with systemd/sysv on different PCs. I thought systemd was faster though.
Please try your experiments. Mine is only one data point on one machine. It would be interesting to see more data comparing systemd and sysv.

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: weird science experiments with init systems - part one

Unread post by GekkoP » Mon Jan 27, 2014 3:04 pm

My first try, using my Dell Inspiron 1525 with Elektra:

systemd: 26s
free: 219036
shutdown: 14.1s or 4.8s

sysv: 27s
free: 213660
shutdown: 10.4s

Boot times taken right after X's ready. Shutdown with systemd randomly changes: sometime works fast, other times just hangs in there and then goes. I'll do the same with Coal on the HP Pavilion and Pony Muncher on the Asus EeePC to see if there are any differences.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: weird science experiments with init systems - part one

Unread post by machinebacon » Mon Jan 27, 2014 3:07 pm

^ +1 Similar results with Sushi <-> Shark Fin in boot time and RAM usage, before X. Interesting, because I was always under the impression that sysv was notably slower at boot. Maybe they added '&'? ;)
..gnutella..

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: weird science experiments with init systems - part one

Unread post by machinebacon » Mon Jan 27, 2014 3:24 pm

Okay here are some stats, comparing a full feat systemd with PAM and polkit running vs a pure sysvinit, both boots obtain DHCP from the router, up to tty login prompt:

systemd
19.7213 sec
36.024 MB

sysV
15.1696 sec
24.900 MB

running on a T43, if anybody wants to compare.
..gnutella..

User avatar
ChefIronBelly
Approved BBQer
Posts: 1044
Joined: Mon Jan 13, 2014 6:01 am
Location: Michigan

Re: weird science experiments with init systems - part one

Unread post by ChefIronBelly » Mon Jan 27, 2014 3:54 pm

Good read thanks
(1/1) Installing: LinuxBBQ...................................[69%]==============[/]

pidsley
Hermit
Posts: 2539
Joined: Wed Oct 17, 2012 12:31 pm

Re: weird science experiments with init systems - part one

Unread post by pidsley » Mon Jan 27, 2014 3:55 pm

On the P4

tiny with systemd: 16.7s to tty prompt, 25.9M used, 2.1s shutdown
tiny with sysv: 18.4s to tty prompt, 23.4M used, 7.4s shutdown

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: weird science experiments with init systems - part one

Unread post by machinebacon » Mon Jan 27, 2014 4:21 pm

Pidsley, have you already tried OpenRC (should be in experimental) on Debian? I wonder if/how it is compatible to live-config or if there is a live-config-openrc in experimental already. Haven't checked yet and honestly, I am not quite sure how it does differ (speaking from the remix point of view).
..gnutella..

pidsley
Hermit
Posts: 2539
Joined: Wed Oct 17, 2012 12:31 pm

Re: weird science experiments with init systems - part one

Unread post by pidsley » Mon Jan 27, 2014 4:26 pm

I did try it (see my first post). It is easy to install from experimental, but does require a bit more configuration. It is slightly slower than sysv on my test machine (about the same as upstart) but used less memory. I don't know how it would complicate the remix process.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: weird science experiments with init systems - part one

Unread post by machinebacon » Mon Jan 27, 2014 4:37 pm

Sorry, I just noticed there are scrots :)

Absolutely side note:
making a live ISO would need the liveconfig scripts (the repos have upstart, sysvinit and systemd), so it seems for now openrc is not an option for the bbq (yet).
..gnutella..

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: weird science experiments with init systems - part one

Unread post by GekkoP » Mon Jan 27, 2014 7:22 pm

Other test, this time with Asus EeePC and Pony Muncher just dist-upgraded:

systemd: 38.2s
free: 265992
shutdown: 3.2s

sysv: 42.8s
free: 270240
shutdown: 8.3s

User avatar
gurtid
Uninstaller
Posts: 239
Joined: Thu Oct 18, 2012 7:53 am

Re: weird science experiments with init systems - part one

Unread post by gurtid » Mon Jan 27, 2014 8:48 pm

What does systemd-analyze give for the startup time on that GekkoP? What up with high ram use? (not that it matters of course. Is pony muncher a 'full' release?)
The Beaver Destroys Forests

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: weird science experiments with init systems - part one

Unread post by GekkoP » Mon Jan 27, 2014 9:24 pm

systemd-analyze says 17.163s. But that Pony Muncher is bloat: cups enabled, ibus enabled, xfce4-power-manager and I don't remember what else. :)

Post Reply