You are not logged in.

#1 2011-06-13 12:27:02

armanatz
Member
Registered: 2011-06-13
Posts: 8

Speeding up boot process

Hey guys,
I am new to the whole Arch Linux community and I have been using Arch for well over 3 months now and I can say I am loving it over Ubuntu! I just had a question about my boot speeds that I was hoping someone could solve.

On Lucid Lynx I used to be able to get my system booted up in around 20 seconds but on Arch it is taking me twice that, around 43 seconds according to Bootchart. I have tried many of the suggestions in this wiki article https://wiki.archlinux.org/index.php/Im … erformance and this one https://wiki.archlinux.org/index.php/Ma … erformance but to no avail.

I hope that someone can check out my bootchart out and tell me where to begin tinkering with to bring down my boot time.

BOOTCHART:
bootchart.png

Thanks for your time!

Offline

#2 2011-06-13 12:42:44

Wey
Member
Registered: 2011-04-22
Posts: 217

Re: Speeding up boot process

Ubuntu uses upstart for a partially parallel boot process. For arch, i recommend to have a look at systemd, there is an excellent article in the wiki: https://wiki.archlinux.org/index.php/Systemd and a dedicated forum thread: https://bbs.archlinux.org/viewtopic.php?id=96316&p=1 I'm using it here without problems and

$ systemd-analyze 
Startup finished in 3230ms (kernel) + 4499ms (userspace) = 7730ms

(which gives a total boot time of ~20 seconds from pressing the power switch to the login screen)

Offline

#3 2011-06-13 12:50:46

armanatz
Member
Registered: 2011-06-13
Posts: 8

Re: Speeding up boot process

Is it recommended to perform parallelization of init on Arch? Won't something go wrong if a process doesn't load up properly?

Offline

#4 2011-06-13 13:20:31

Wey
Member
Registered: 2011-04-22
Posts: 217

Re: Speeding up boot process

As far as i know, systemd uses some graph theory to deal with dependencies between its *.service and *.socket units.

In theory, you could use systemd to mostly replace rc.conf and the like, however there is initscripts-systemd for compatibility, like parsing the DAEMONS arry in rc.conf, as  described in the wiki. There are also native systemd service files packaged in systemd-arch-units for various daemons like cups, vsftp, sshd etc. Therefore, my DAEMONS array looks like this:

$grep DAEMONS /etc/rc.conf 
# DAEMONS
DAEMONS=()

For problems people were encountering using systemd, skim over the forum thread (e. g. no separate /usr partition, /etc/mtab has to be a symlink to /proc/self/mounts, etc. )

Offline

#5 2011-06-13 13:50:22

ChoK
Member
From: France
Registered: 2008-10-01
Posts: 346

Re: Speeding up boot process

There is definitely something going on there. I have a mobile C2D at 2GHz and a 5400RPM disk and it boots Arch in 17 seconds while you have a i5.

Few notes :
- using UUID may be slower because it will need to load udev (which will be needed anyway)
- elevator=deadline, on traditional hard-drive I'm not sure it's an improvement over cfq
- blkid seems to take a long time
- rc.multi and Xorg are starting in the 12 and 16 seconds mark which is ok, what it's waiting for during the next 30 seconds is a bit unclear though, could be dbus, or policykit or console kit maybe or bootchart2 doesn't stop logging when it should. Can you paste your /etc/inittab and /etc/rc.conf ?


Ah, good taste! What a dreadful thing! Taste is the enemy of creativeness.
Picasso
Perfection is reached, not when there is no longer anything to add, but when there is no longer anything to take away.
Saint Exupéry

Offline

#6 2011-06-13 16:05:33

armanatz
Member
Registered: 2011-06-13
Posts: 8

Re: Speeding up boot process

Thanks for the reply ChoK.

My /etc/inittab file:
http://pastebin.com/DvpbCtGD

/etc/rc.conf:
http://pastebin.com/ZREGArpf

I hope that that helps!

Also, I am using elevator=deadline due to using JFS as my root FS... I thought that by using the deadline scheduler, JFS partitions outperform EXT4.
And what do I check with regards to the gap between Xorg and rc.multi loading up?
I will also look into checking why blkid is taking so long

Offline

#7 2011-06-13 16:53:48

Wey
Member
Registered: 2011-04-22
Posts: 217

Re: Speeding up boot process

Your xorg log might be of interest.

If you don't need them, you can remove the at-spi* packages. Metacity is started, though you are using gnome-shell, I propose to uninstall it. Also, consider that gdm is not exactly lightweight, have a look at alternatives.

Offline

#8 2011-06-13 17:14:04

armanatz
Member
Registered: 2011-06-13
Posts: 8

Re: Speeding up boot process

Here is my Xorg log:
http://pastebin.com/MH955PRZ

I will remove the at-spi* packages and Metacity but I need GDM due to it interfacing with ACPI calls very well... Like for example, SLiM and LXDM don't allow me to change my brightness or volume using the keys on my keyboard... so yea. Although, I have managed to write a script for brightness, there are still some quirks that I occasionally encounter!

EDIT: So I just tried removing the at-spi packages and it wants to pull down the entire GNOME framework with it... So the packages are here to stay but I did remove them from autostart... Hope that helps

EDIT2: I am also really confused with how to use systemd. The wiki doesn't really provide useful info on how to actually use it to replace SysV (or maybe I still too much of Newb in that section). Can anyone help me with that?

Last edited by armanatz (2011-06-13 17:23:21)

Offline

#9 2011-06-13 17:36:43

Wey
Member
Registered: 2011-04-22
Posts: 217

Re: Speeding up boot process

Regarding your xorg log i assume you have set up nouveau following the wiki. You could try to install the proprietary nvidia driver temporarily to see if that changes anything. See https://wiki.archlinux.org/index.php/NVIDIA and https://wiki.archlinux.org/index.php/Nouveau

Which pacman switches did you use when you tried to remove the at-spi packages? Check pacman -Qi for their dependencies.

For systemd, you have to pass init=/bin/systemd to the kernel in the same fashion you did for your bootchart.

Offline

#10 2011-06-13 17:45:55

armanatz
Member
Registered: 2011-06-13
Posts: 8

Re: Speeding up boot process

So I managed to get the at-spi2 packages to uninstall without pulling down my entire GNOME system. I am also trying out Qingy as a login manager instead of GDM (screw the ACPI calls for now, I can fix those when I come to that bridge).

I didn't think systemd was that easy... No set up required at all?
I thought that I would have to enable the services I required at boot.

And yes, I did set up nouveau like on the wiki and I am actually trying to see if having it start up earlier will make much of a difference.
Wish me luck. Will be rebooting now!

EDIT: Ok so nouveau died on me when starting it earlier in the boot process and so I configured it back to the way it used to start. Also, I tried the nvidia binaries from the repos and that takes longer to boot up the system, if not the same as now

EDIT2: Qingy was also being a bitch and so I replaced it with SLiM and after doing all of this I am now booting at a blazing speed of... 1min and 04secs!! I don't know why the hell it is regressing!

Thanks for all the help Wey!

Last edited by armanatz (2011-06-13 18:19:05)

Offline

#11 2011-06-13 18:57:43

Wey
Member
Registered: 2011-04-22
Posts: 217

Re: Speeding up boot process

mh that seems strange. Could you remove the bootchart flags (initcall_debug printk.time=y init=/sbin/bootchartd) and measure with systemd's own profiling tools, e. g.

systemd-analyze
systemd-analyze blame
systemd-analyze plot > plog.svg

Also, to take advantage of systemd, you would remove some of your daemons from rc.conf, e. g. remove the @acpid and then

systemctl enable acpid.service

(the service file is from systemd-arch-units).

Offline

#12 2011-06-13 19:15:18

armanatz
Member
Registered: 2011-06-13
Posts: 8

Re: Speeding up boot process

I tried that but it give me this error:

[arman@archlinux ~]$ systemd-analyze
Traceback (most recent call last):
  File "/usr/bin/systemd-analyze", line 3, in <module>
    import dbus, sys
ImportError: No module named dbus

And when I try to load the dbus.service file it says, "Unit files contain no applicable installation information. Ignoring."

Any ideas?

Offline

#13 2011-06-13 19:17:38

Wey
Member
Registered: 2011-04-22
Posts: 217

Re: Speeding up boot process

systemd has some optional dependencies, see: http://www.archlinux.org/packages/commu … 6/systemd/
So you probably need dbus-python and python2-cairo.

Offline

#14 2011-06-13 19:29:04

armanatz
Member
Registered: 2011-06-13
Posts: 8

Re: Speeding up boot process

Thanks for that! Now it seems fixed and systemd-analyze gives me this:

[arman@archlinux ~]$ sudo systemd-analyze 
Startup finished in 5061ms (kernel) + 10914ms (userspace) = 15976ms

That is an improvement but no where near as good as you are getting with 7000+ms
I guess I have to tinker with the services to get it lower... any recommendations?

Also, GNOME takes a good chunk of my boot time... After everything has booted, I still have to wait for gnome to load so I am wondering if there was anyway to cut down on the horrid startup time of GNOME... probably going to check with Openbox and see how that works and whether it improves the speed at all

Offline

#15 2011-06-13 19:34:27

Wey
Member
Registered: 2011-04-22
Posts: 217

Re: Speeding up boot process

Could you also post the output of systemd-analyze blame and upload the picture generated by systemd-analyze plot > plot.svg? (They don't need sudo capabilities by the way)

Last edited by Wey (2011-06-13 19:34:53)

Offline

#16 2011-06-13 19:45:06

armanatz
Member
Registered: 2011-06-13
Posts: 8

Re: Speeding up boot process

Here are the stuff you asked for:

[arman@archlinux ~]$ systemd-analyze blame
  2393ms systemd-vconsole-setup.service
  1817ms NetworkManager.service
   823ms remount-rootfs.service
   792ms home.mount
   555ms var.mount
   501ms boot.mount
   373ms dbus.service
   323ms udev-trigger.service
   313ms systemd-tmpfiles-setup.service
   279ms console-kit-log-system-start.service
   219ms systemd-sysctl.service
   217ms media.mount
   216ms systemd-modules-load.service
   216ms systemd-remount-api-vfs.service
   204ms udev.service
   120ms console-kit-daemon.service
    93ms accounts-daemon.service
    73ms systemd-user-sessions.service
    26ms var-lock.mount
    14ms rtkit-daemon.service
     0ms var-run.mount

And the plot.svg:
http://ubuntuone.com/p/z1Q/

Offline

Board footer

Powered by FluxBB