Hi,
Recently there were some articles on Slashdot proposing alternative boot procedures. Most of them advocate parallelizing of SysV-init tasks. Motivated by these I've decided to make a detailed analysis of boot procedure and see how can I make it faster. I have an oldish PC that can run most modern software fast enough. This is a vanilla Mdk 9.2 install and I use the auto-login feature with KDE. Complete time from pressing enter in lilo to a usable desktop is exactly 81 seconds. On this same computer Win98 is usable in around 35 seconds (I did some tweaking though). Here is a detailed account of the boot procedure. I made it using logs and a stopwatch. It should clearly point the likely targets for optimization. kernel loading into memory ~2s screen is blank ~2s kernel boots, mounts initrd, performs various configuration tasks ~5s rc.sysinit kicks in, some config tasks ~1s running devfsd 3s unmounting initrd, applying sysctl.conf 1s setting up date & time, loading keymap, setting hostname ~1s starting USB service** *9s fsck 1s root is remounted rw, run swapon <1s execute depmod -A 4s a bunch of config tasks are completed 4s run mandrake_everytime service 3s switching to runlevel 5 <1s harddrake service looks for new hardware and saves configuration 4s services: network, portmap 2s services: syslog, partmon, nfslock, sound, random 3s xfs *1s netfs <1s apmd *2s dm service goes to background, screen goes blank 1s services: atd, tmdns, rawdevices; kdm_config is being read 1s xinetd; screen still blank 4s cups; blue screen with a cursor is shown 8s services: keytable, numlock, internet 1s crond 1s kheader <1s devfsd actions 1s service "local" sets the console screens <1s KDE is starting up (splash screen)*** 23s KDE session is restored 5s * proces is just spawned to the background; these figures should not be included when summarizing ** I have a USB scanner so it is detected and the appropriate config tool (scannerdrake) is started *** at ~11th second scannerdrake is run for the second time total: 81 seconds Some conclusions: - Overall time to boot a minimal usable console is 27 seconds which is IMHO too much. The biggest problem is kernel. Unfortunately there seems to be no tool that can show a log of kernel activities with times (please correct me), but it seems that most of the time was spent initializing my two hard disks (more than a second each). A recompile should solve remaining problems. - Why is devfsd taking so long? - Do we need to run depmod if no new modules are installed (many ways to check)? - Sysv is already mostly parallelized. It takes 26 seconds which is better than I expected. Actually, as I understand, on this single-cpu machine the overhead of context switching is so high that xinetd and cups would probably start faster if they were not parallelized with X. - Idea: sshd is the only service that uses xinetd. Standalone sshd would probably boot faster? This computer connects to the Internet using a modem, I don't even own a network card. Therefore I probably don't need sshd at all. - While I'm at it, I also don't need netfs, nfslock (thus portmap) or tmdns. Isn't it possible to disable these services if no NIC is detected during installation? Also since this is a desktop pc i don't need apmd. Can't this also be detected? - I just can't understand why kde takes so long to start!??!? Unfortunately, gnome isn't much better. The "loading session" part in kde can be accellerated by disabling KOrganizer (if someone wants to use it, he/she can find it in the menus) - Idea: postpone cups and scannerdrake startup for 60 seconds to give desktop a chance to start and avoid unnecessary context switching. It's very unlikely that someone would like to print or scan something in the first 60 seconds? The same trick could be used for crond and atd I believe. What do you think? Should I apply these optimizations to my Pc? will anything burn up (except the lg cd-rom) ;) __________________________________ Do you Yahoo!? Exclusive Video Premiere - Britney Spears http://launch.yahoo.com/promos/britneyspears/