You are not logged in.

#51 2009-01-25 13:26:43

Duologic
Member
From: Belgium
Registered: 2007-11-11
Posts: 249

Re: 2 days of tweaking for a faster boot time

I gues gdm takes more time then SLiM or agetty. So yeah It would be faster.

Offline

#52 2009-01-25 14:56:14

tjwoosta
Member
Registered: 2008-12-18
Posts: 453

Re: 2 days of tweaking for a faster boot time

I have got a funny result, not autoloading modules and inserting them in rc.conf  in modules=() . Gave me a slowdown of 2 sec. My default boot time with no tweaking gives me a boottime of 18 sec. Would be nice if it where 10 sec. I use gnome and gdm, can i not use gdm to start gnome because i dont need the login manager, but would it be faster?

why not just skip the login manager completely  by using xinitrc to start gnome?

http://wiki.archlinux.org/index.php/GNOME

http://wiki.archlinux.org/index.php/.xinitrc

Last edited by tjwoosta (2009-01-25 14:57:05)

Offline

#53 2009-01-25 16:54:31

Themaister
Member
From: Horten, Norway
Registered: 2008-07-21
Posts: 647
Website

Re: 2 days of tweaking for a faster boot time

Did most of the stuff smile Noticable lower boottime, but not that great of an improvement on my rig. From 15s to maybe 13 tongue Will do bootchart. Hah, I guessed well. From 18s to 16s^^ nice one.

Last edited by Themaister (2009-01-25 17:18:03)

Offline

#54 2009-01-25 19:02:20

jelly
Trusted User (TU)
From: /dev/null
Registered: 2008-06-10
Posts: 711

Re: 2 days of tweaking for a faster boot time

tjwoosta wrote:

I have got a funny result, not autoloading modules and inserting them in rc.conf  in modules=() . Gave me a slowdown of 2 sec. My default boot time with no tweaking gives me a boottime of 18 sec. Would be nice if it where 10 sec. I use gnome and gdm, can i not use gdm to start gnome because i dont need the login manager, but would it be faster?

why not just skip the login manager completely  by using xinitrc to start gnome?

http://wiki.archlinux.org/index.php/GNOME

http://wiki.archlinux.org/index.php/.xinitrc

Skipping the login manager decreases the boot time 2 secs . Now it is 16 seconds without even tweaking tongue . Only starting the xfce or gnome takes much time, first the window is black then i see gnome then i get a flash then it is loaded. With XFCE i have the same problem can this be tweaked or is this because i use Xfce & Gnome instead or for example Openbox? I also use compiz maybe not loading compiz will solve the problem

Last edited by jelly (2009-01-25 19:04:20)

Offline

#55 2009-01-25 19:24:41

Duologic
Member
From: Belgium
Registered: 2007-11-11
Posts: 249

Re: 2 days of tweaking for a faster boot time

Skipping login is not an option for me, I'm working on a laptop and don't want people accessing my data directly.
I use Openbox and the flashing happens with me to, I gues its just X starting smile

Btw nice boot times

About the modules, I've experienced this on some systems too, I think the NOT-autoload script is a lot slower than the autoload, need to figure that out. But now I'm on a mini-ITX project, so tweaking has to wait.

Offline

#56 2009-01-25 22:02:34

jelly
Trusted User (TU)
From: /dev/null
Registered: 2008-06-10
Posts: 711

Re: 2 days of tweaking for a faster boot time

Duologic: the only thing i want to tweak now for my laptop is udev that's taking 2000 ms, i am going to do some research for myself. If i find something interesting i'll post it

Offline

#57 2009-01-26 01:20:49

dyscoria
Member
Registered: 2008-01-10
Posts: 1,007

Re: 2 days of tweaking for a faster boot time

I've found so far that backgrounding daemons provides the biggest gain (18 secs), while all the edits to rc.sysinit (no swap, no lvm/raid/encrpytion, set time/locale/keymap, background commands, background udevadm) show no visible improvement at all in bootchart.

Maybe my Intel Core 2 Duo is too fast to see a difference.


flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)

Offline

#58 2009-01-26 07:34:27

tinhtruong
Member
From: Việt Nam
Registered: 2008-12-18
Posts: 109

Re: 2 days of tweaking for a faster boot time

Duologic wrote:

I never touched the part for filesystem checks, I find that too important to rumble with it.
If something goes on mounting, do a e2fsck on those filesystems from the root command line. Maybe it came with the new kernel, some exotic bug? Just mindstorming...

I did not touch the code about filesystem check!
There are some code comments in the rc.sysinit file about setting the system clock to fix the filesystem check, I'll give that a look and report back.

Offline

#59 2009-01-26 07:40:21

tinhtruong
Member
From: Việt Nam
Registered: 2008-12-18
Posts: 109

Re: 2 days of tweaking for a faster boot time

jelly wrote:

Duologic: the only thing i want to tweak now for my laptop is udev that's taking 2000 ms, i am going to do some research for myself. If i find something interesting i'll post it

If you find a solution, please let me know:). I want to do that too! cool

Offline

#60 2009-01-28 17:55:25

LeoSolaris
Member
From: South Carolina
Registered: 2008-03-30
Posts: 354

Re: 2 days of tweaking for a faster boot time

Thank you, DuoLogic!

Not only did you provide a great tutorial over in the wiki, but you also did it for the Inspiron 1525, which is only a slight processor bump from the 1520 (that's the only difference I have every found, any ways.)

I dropped my power on to desktop from ~26-30 seconds, to 14 by bootchart, and another 2 sec for everything to load up in Openbox.

I did have to make a few little changes to the modules in rc.conf, disabled that annoying pc speaker, added my wireless, and swapped locals and keyboard in your rc.sysinit. Easy stuff!

Edit: By the way, in your modules, which one is your wireless? I would like to delete it, too. We apparently have different wireless cards.

Edit 2: One more minor weirdness... the startup text (Starting blah blah ... [DONE]) is a little messed up. Right before loading the daemons from rc.conf, it goes to vc/1 with the login request, then prints out the loading of the daemons. It doesn't effect logging in on vc/1, but it does make it look strange.

Last edited by LeoSolaris (2009-01-28 18:03:03)


I keep getting distracted from my webserver project...

huh? oooh...  shiny!

Offline

#61 2009-01-28 19:42:02

Duologic
Member
From: Belgium
Registered: 2007-11-11
Posts: 249

Re: 2 days of tweaking for a faster boot time

LeoSolaris wrote:

Thank you, DuoLogic!

Not only did you provide a great tutorial over in the wiki, but you also did it for the Inspiron 1525, which is only a slight processor bump from the 1520 (that's the only difference I have every found, any ways.)

I dropped my power on to desktop from ~26-30 seconds, to 14 by bootchart, and another 2 sec for everything to load up in Openbox.

I did have to make a few little changes to the modules in rc.conf, disabled that annoying pc speaker, added my wireless, and swapped locals and keyboard in your rc.sysinit. Easy stuff!

Edit: By the way, in your modules, which one is your wireless? I would like to delete it, too. We apparently have different wireless cards.

Edit 2: One more minor weirdness... the startup text (Starting blah blah ... [DONE]) is a little messed up. Right before loading the daemons from rc.conf, it goes to vc/1 with the login request, then prints out the loading of the daemons. It doesn't effect logging in on vc/1, but it does make it look strange.

Move iwl3945 to the bin, I gues you don't have the drivers installed so it won't be loaded either.
The scrambling I'm aware of, but I don't care, It all disappears when I get into agetty. When something doesn't get loaded, I'll see it afterwards.

Btw thanks for the compliments, you should make a nice wiki for the Inspiron 1520, It doesn't really take that much time. PM me if you want need help on this.

Offline

#62 2009-01-29 18:04:55

LeoSolaris
Member
From: South Carolina
Registered: 2008-03-30
Posts: 354

Re: 2 days of tweaking for a faster boot time

I'm thinking about making the wiki for the 1520, but there really isn't much to wiki about. The speed up is nearly verbatim from yours, and most everything works perfectly as expected, even the webcam.

By the way, I found an odd solution to the start-up text glitch... I moved startx to initab (had to make sure that vc/7 respawned, too.) That made my start up small enough and fast enough to beat the console's start up. Just barely. I still get a [DONE] from wicd's start up, but that is less noticeable because it moves to a blank screen before slim loads.

One more question, the system beep...   what modules can I kill to get rid of that blasted thing? I removed snd-pcm...  what else can I get rid of without disable sound altogether? It got be a glare from my prof yesterday. >.<


I keep getting distracted from my webserver project...

huh? oooh...  shiny!

Offline

#63 2009-01-29 18:14:55

Duologic
Member
From: Belgium
Registered: 2007-11-11
Posts: 249

Re: 2 days of tweaking for a faster boot time

You just think there isn't much to write about, but giving to the community is inheritable. So you start, people will follow! :-)
Search for the 'pcsp' module, but you can use alsamixer for mute 'PC Beep' as for any other sound. Alsamixer comes with alsa-utils. (snd-pcm is not for pc speaker)

Offline

#64 2009-01-29 18:49:51

LeoSolaris
Member
From: South Carolina
Registered: 2008-03-30
Posts: 354

Re: 2 days of tweaking for a faster boot time

that's strange, snd-pcm iswhat I blacklisted back when I actually used blacklist to get rid of that loud beep that occurs everytime I do something like push the down button at the terminal when it was empty...


Here is an incredibly simplistic question...  how do I search for 'pcsp'?

I was hunting through alsamixer for a way to mute it, but I haven't found it yet.

It's weird moments like this that remind me that I haven't been using Linux for more than a year yet.

Edit: Nevermind, I did not have the foresight to try alsamixer again, after doing all of this.  Geesh...  It's been one of those days.

Last edited by LeoSolaris (2009-01-29 18:52:47)


I keep getting distracted from my webserver project...

huh? oooh...  shiny!

Offline

#65 2009-01-29 19:41:14

qlus
Member
From: Tychy, Poland
Registered: 2006-06-15
Posts: 74

Re: 2 days of tweaking for a faster boot time

snd_pcsp is what you are searching for.

Offline

#66 2009-01-29 20:32:14

LeoSolaris
Member
From: South Carolina
Registered: 2008-03-30
Posts: 354

Re: 2 days of tweaking for a faster boot time

qlus wrote:

snd_pcsp is what you are searching for.

Thank ya!


I keep getting distracted from my webserver project...

huh? oooh...  shiny!

Offline

#67 2009-01-30 12:14:53

Duologic
Member
From: Belgium
Registered: 2007-11-11
Posts: 249

Re: 2 days of tweaking for a faster boot time

You got what you found, but next time you could use:

lsmod | grep pcsp

Offline

#68 2009-01-31 03:34:39

Raccoon1400
Member
From: Ontario, Canada
Registered: 2008-04-14
Posts: 853

Re: 2 days of tweaking for a faster boot time

fwojciec wrote:

Amount of seconds used to achieve faster boot time: 60*60*24*2 = 172800
Amount of seconds saved each boot: 11

Great!  Now you just need to boot your computer 15709 times to make up the time tongue

EDIT: Nice writeup, by the way -- I'm sure people will find it useful.

That's the irony of this.

Thanks for the writeup, I've been tweaking boot, and your writeup and sources have been useful.
I've only lost about 10sec so far, 55 sec grub to full gnome.

EDIT: I took usbinput out of mkinitcpio. All the usb stuff still works.
The mkinitcpio hack chopped off about 5 sec, once I realized I had to rebuild the ramdisk for it to have any effect.

Last edited by Raccoon1400 (2009-01-31 03:39:48)


Fustrated Windows users have two options.
1. Resort to the throwing of computers out of windows.
2. Resort to the throwing of windows out of computers.

Offline

#69 2009-01-31 14:16:36

Peterix
Member
Registered: 2008-05-05
Posts: 23

Re: 2 days of tweaking for a faster boot time

Hello,
I'm looking into shortening my boot times too. That and adding more daemons, so it may end up taking the same time to do more smile
Bootchart so far:
bootchart.png

I'm eyeing that redundant hwclock... it looks like it uses up two seconds just for setting up the clock... twice. Why it does that I have no idea.
I can see the time in BIOS without setting it up this way. Optimizing away fsck in a safe manner could be nice smile
load-modules.sh is a link to modprobe
Another thing is to somehow solve the horrible IO throughput. Only thing remotely fast to load is the nvidia module, which is ~9MB.
Stuff I would like to add is ngflushd (after I clean up the code and makefiles and send it back to the guy) and a better shutdown script - when KDM stops, I only care about MPD,CUPS and SAMBA state. Everything else can pretty much go to hell including ALSA.

Some rc.conf snippets:
Long-ass list of sound modules. I have no idea how this works yet, so I didn't mess with it. Powernow-k8 for my Athlon64 (maybe redundant due to a huge lump of copper on top of the CPU), forcedeth for ethernet.

MODULES=(powernow-k8 forcedeth ac97_bus snd-mixer-oss snd-pcm-oss snd-page-alloc snd-pcm snd-timer snd snd-ac97-codec snd-intel8x0 soundcore)

Static network setup. dhcpcd still runs for some weird reason and overwrites my resolv.conf... FAIL. I'll probably tear this out and use ifconfig and route directly.

eth0="eth0 192.168.1.2 netmask 255.255.255.0 broadcast 192.168.1.255"
INTERFACES=(eth0)
gateway="default gw 192.168.1.1"
ROUTES=(gateway)

My computer is used as a local print server and I have some samba shares set up. MPD takes music from a samba share. KDM is run from /etc/inittab. I'll probably mix network netfs and mpd - mpd needs only one share mounted, the rest can mount asynchronously.

DAEMONS=(!syslog-ng @alsa @hal @fam @samba @cups network netfs @mpd)

Offline

#70 2009-01-31 19:56:44

Peterix
Member
Registered: 2008-05-05
Posts: 23

Re: 2 days of tweaking for a faster boot time

This is crazy. I'm definitely on to something here. I haven't started optimizing the kernel. There's still some cruft in rc.sysinit that could be removed - hwclock! Also, I'm going to investigate if vol_id and that instance of find are really crucial to booting up my machine.
So far, I've removed the network, netfs and mpd scripts from DAEMONS and added my custom dethnet one:

DAEMONS=(@alsa @hal @fam @samba @cups @dethnet)

Everything starts in parallel now! (well, not really, dethnet brings up ethernet, route, first cifs mount, mpd and second cifs mount in sequence)
I'm completely replacing arch network scripts right now, but I might reinstate some kind of control over the networking in rc.conf later.
DethNet script:

#!/bin/bash
# dethnet for my forcedeth :D

. /etc/rc.conf
. /etc/rc.d/functions

case "$1" in
    start)
        if ! ck_daemon dethnet; then
            echo "DethNet is already running.  Try 'dethnet restart'"
            exit
        fi

        stat_busy "Starting DethNet"
        error=0
        ifconfig eth0 192.168.1.2 netmask 255.255.255.0 broadcast 192.168.1.255 || error=1
        route add default gw 192.168.1.1 || error=1
        echo "nameserver 192.168.1.1" > /etc/resolv.conf || error=1
        mount /mnt/puclik-pub
        stat_done
        /etc/rc.d/mpd start
        mount /mnt/puclik&
        ;;
    stop)
        #if ck_daemon network; then
        #    echo "DethNet is not running.  Try 'dethnet start'"
        #    exit
        #fi
        rm_daemon dethnet
        error=0
        /etc/rc.d/mpd stop
        stat_busy "Stopping DethNet"
        umount -l /mnt/puclik-pub
        umount -l /mnt/puclik
        route del default gw 192.168.1.1 || error=1
        ifconfig eth0 down || error=1
        echo "#lol" > /etc/resolv.conf || error=1
        if [ $error -eq 0 ]; then
            stat_done
        else
            stat_fail
        fi
        ;;
    restart)
        $0 stop
        /bin/sleep 2
        $0 start
        ;;
    *)
        echo "usage: $0 {start|stop|restart}"  
esac

As you can see, it's lean and mean - just the basics. I haven't removed all the error checking stuff yet, but I'm going to do so.

Current bootchart:
bootchart2.png

Offline

#71 2009-01-31 20:31:41

EVRAMP
Member
From: Czech Republic
Registered: 2008-10-03
Posts: 173
Website

Re: 2 days of tweaking for a faster boot time

Nice one Peterix!
Suggestion: Try to replace FAM with Gamin - it doesn't require any daemon (simply pacman -S gamin and confirm removing FAM).

Offline

#72 2009-01-31 21:28:35

Raccoon1400
Member
From: Ontario, Canada
Registered: 2008-04-14
Posts: 853

Re: 2 days of tweaking for a faster boot time

I just switched to ext4. It took about 3 sec off my boot.
Here's how I familiarized myself with the procedure:
-converted my vbox arch install
-converted a partition I was trying to install lfs on, on my real hard drive
-the real thing

The vbox test told me exactly what to expect. I have everything on one partition, no seperate /var, or /home, so it was all or none.


Fustrated Windows users have two options.
1. Resort to the throwing of computers out of windows.
2. Resort to the throwing of windows out of computers.

Offline

#73 2009-01-31 21:57:03

Peterix
Member
Registered: 2008-05-05
Posts: 23

Re: 2 days of tweaking for a faster boot time

EVRAMP: Díky!
Raccoon1400: I backed up all my data to an external drive, installed Arch from FTP, converted the EXT3 partition to EXT4 and rebooted to a clean Arch64 with EXT4. I's pretty speedy, especially fsck. I'm rebooting a lot and it's not much of a hassle.

I added back syslog-ng which set me back 3 seconds. I don't really need logging most of the time, so I'll add an another boot option to grub for when I need it. Thanks to that tip I removed fam. Now I'm at 14 seconds to boot with syslog-ng smile
It seems I can remove the second instance of hwclock by using the TZ variable instead of making symlinks every boot. Or just make the symlink once and never change it - my box is highly unlikely to change timezones.

man hwclock wrote:

--hctosys
              Set the System Time from the Hardware Clock.

              Also set the kernel's timezone value to the  local  timezone  as  indicated  by  the  TZ  environment  variable  and/or
              /usr/share/zoneinfo
, as tzset(3) would interpret them.  The obsolete tz_dsttime field of the kernel's timezone value is
              set to DST_NONE. (For details on what this field used to mean, see settimeofday(2).)

              This is a good option to use in one of the system startup scripts.

Still no work on the kernel... I need to research this properly before I start hacking on it.

Edit: I gained nothing from messing with hardware clocks.

Last edited by Peterix (2009-01-31 23:13:38)

Offline

#74 2009-02-01 18:24:13

cywhale
Member
Registered: 2008-03-10
Posts: 31

Re: 2 days of tweaking for a faster boot time

Thank you for this thread, my 1GHZ Celeron Travelmate C110 now boots  up in 16 sec. (used to be 33sec) without mkinitcpio or kernel modifications and a Thinkpad A31p in about 15 sec.

Starting GDM earlier as described here may be an option for some of you, too. It works on the C110 but does not on the thinkpad (no keyboard/mouse/trackpoint in GDM).

Offline

#75 2009-02-02 01:51:00

Ranguvar
Member
From: Our collective subconscious
Registered: 2008-08-12
Posts: 2,515
Website

Re: 2 days of tweaking for a faster boot time

Bah! Login managers? Who needs 'em? It'll save a bit off your time if you just login through the console, and it's just less bloat, etc. You can do some pretty cool things, like having one tty always log in to X, having different ones go to different DEs, etc... it's been discussed.

Offline

Board footer

Powered by FluxBB