Development/Howto/Boot Time Optimisation

From Mandriva

Jump to: navigation, search
How to Profile Your Boot Time

The goal of this page is to gather all the ideas to improve Mandriva Linux's Boot Time.

You may also vote to ask for Boot Time improvement in Bugzilla.

Contents


[edit]

How To Profile?

  • Install the sysstat package: Sysstat is in Contributions RPMs. If the Contributions RPMs Media is not yet installed, install it with the 2 following commands (as root):
# urpmi.addmedia contrib_10.1 ftp://mandrake.contactel.cz/Mandrakelinux/official/10.1/i586/media/contrib with ./hdlist.cz
# urpmi sysstat
  • Install Bootchart:
  1. Install bootchart and bootchart-logger packages (available from contrib) or download the latest Bootchart release
  2. Follow the installation instructions
  3. Reboot
  4. Upon reboot change the kernel command line interactively with the command init=/sbin/bootchartd. LILO : You do this in LILO by pressing ESC at LILO boot screen, and typing [your-lilo-entry] init=/sbin/bootchartd.
  5. After boot, verify that /var/log/bootchart.tgz was created and contains the log files.
  6. Produce the chart by uploading your /var/log/bootchart.tgz file on http://www.bootchart.org/download.html (Renderer Web Form section). Or you can also generate the bootchart graph yourself by running bootchart on your system.
  7. Rename the downloaded chart "bootchart-testXX.png", and create an attachment for it in this page, meaning you're the XX'th person reporting its test (see reports below)

For more information, see: http://www.bootchart.org/

[edit]

Trial Results

Put the results you've had on your system here, describing:

  1. Your hardware
  2. The services that were running (if it is not a fresh basic installation)
  3. The amendments you've applied to improve time of successive boot processes
  4. Time results for each trial

To ease comparisons, it would be best to do your first test with a fresh basic installation, without modifying anything.

[edit]

Test 1 (BuchanMilne)

[edit]

Hardware

  • HP NX 7010 laptop
  • 512MB RAM
  • 1.4 GHz Centrino
  • 40GB 4200rpm IDE disk
  • Radeon 9200 Mobility
  • On-board RTL8139 and IPW2100 NICs
[edit]

System / Services / Modifications (Configuration 1)

  • Mandrake 10.0 install with many services upgraded to 10.1. This is not your average desktop (or even your average server) ...
  • bluetooth, winmodem, firewire, ldap, mb, clamav, squid, httpd, sshd, Win4lin
[edit]

Results (Configuration 1)

Boot Chart

Total Boot Time: 87sec (to KDM login screen)

[edit]

System / Services / Modifications (Configuration 2)

  • Mandrake 10.1 new install on a 2GB partition, mostly default but actually testing an auto_install configuration with some non-standard (ie xprint) software installed). This is a more typical corporate desktop setup.
  • cups, bluetooth, xprint
[edit]

Results (Configuration 2)

Boot Chart

Total Boot Time: 47s (to KDM login screen)

[edit]

Test 2 (FredericConrotte)

[edit]

Hardware

  • AMD Duron 1200 Mhz
  • 256Mo DDR
  • SoundBlaster Live
  • NVidia GeForce2
  • Carte Ethernet RTL-8139
  • Modem ADSL USB Speedtouch
[edit]

System / Services / Modifications

No additional services, just those selected by default with 10.1 PowerPack

[edit]

Results

Boot Chart

Total Boot Time: 33s

[edit]

Test 3 (DickGevers)

[edit]

Hardware

  • Pentium II @ 350 MHz
  • 458Mb SDRAM
  • ESS1887 soundcard (isa)
  • S3 ViRGE
  • 3C509B-TPO ethernet card
[edit]

System / Services / Modifications

  • Running current Cooker 10.2, usb commented out in rc.sysinit, intel-agp not loaded in kernel.
  • Internet not running (LAN only, which connects to router which connects to ADSL)
  • Additionally running: Prelude-manager, microcode_ctl, lm_sensors, shorewall, Guarddog (at boot time only), IPtables IPv6, iplog
[edit]

Results

attached "bootchart_dvg.png"

Total Boot Time:

  • 59s, according to bootchart
  • 133s counting from entering password in lilo until appearance of mdkkdm
[edit]

Test 4 (GregorP) (testing some optimisations)

[edit]

Hardware

  • CPU: AMD Duron 750 Mhz
  • RAM: 512MB SDR SDRAM
  • Disk: 5400 RPM
[edit]

System / Services / Modifications

  • alsa, dm, kheader, network, partmon, xinetd, keytable, syslog, crond, xfs, atd, udev, cups, shorewall
  • filesystem: ext3
[edit]

Results

Boot Chart (& update)

Boot Chart (KDE autologin - it take 60s from LILO to KDE login sound)

[edit]

Test 5 (AustinActon)

[edit]

Hardware

  • HP TC1100 laptop
  • Pentium M, Centrino
  • Nvidia GeForce 4
  • 512 MB ram
[edit]

Results

cooker - Nov 2004

cooker - Aug 2005

Total Boot Time:

As you can see, boot time has been cut in half over the last year.

[edit]

Remaining gaps

  • zombie at end of fsck
  • big hole during pcmcia
  • big hole during alsa
  • harddrake has to be disabled for decent boot time
[edit]

Test 6 UPDATED (PieroOttuzzi)

[edit]

Hardware

  • Athlon 2200+ Desktop PC NONAME
  • NForce2
  • ATI Radeon9000
  • 1024 MB ram
[edit]

System / Services / Modifications

I use Mandrake for work... I've disabled CUPS and Apache because I need them very seldom and I know how to start them when needed ;-)

[edit]

Results

see here

Total Boot Time:

I'm really satisfied about my boot time... It is not on par with Windows XP but it is OK for me.

[edit]

Update

I made another test with a fresh Mandrake 10.1 Official Edition: boot times are equals but graphs are a bit different.

[edit]

Test 7 (RobinRosenberg)

This is more than a minimal configuration.

[edit]

Hardware

  • Dell Inspiron 8500 2GHz
  • GeForce4 Ti 4200 Go (nvidia 6111 driver)
  • 512MB RAM
  • Wireless pcmcia prism54
[edit]

System / Services / Modifications

  • Mandrake 10.1, Kernel 2.6.10-rc3, KDE 3.3.1
  • acpi acpid alsa atd bluetooth cpufreq crond cups dkms dm gpm hotplug iptables irda keytable kheader mdadm messagebus netfs netplugd network ntpd partmon pcmcia pcscd proftpd rawdevices smartd smb sound sshd syslog udev xfs xinetd KDE-autologin
[edit]

Results

SVG here

[edit]

Test 8 (LoicBaudry)

[edit]

Hardware

  • Duron 1,2 Ghz
  • 256 MB RAM
[edit]

System / Services / Modifications

  • Mandrake 10.2 Beta 3
  • KDE 3.3.1
[edit]

Results

Time from lilo key press until kde splash screen disappear :

  • Fresh install : 1'21
  • After disabling unused applets (net_applet, mdkonline, kdiskfree etc.) and unused services (harddrake, blutooth*, howl* ) : 1'15
  • With lilo option "compact" : 1'15
  • Starting service dm earlier : S30dm -> S02dm : 1'08
  • Using grepmap : 1'04
  • Using prelink : 1'02
  • Using noatime mount option on "/" : 1'01

For me, the last bootleneck is:

  • mount -a during rc.sysinit : 6 secs.

For kde startup, i wanted to try to disabling kbuildsyscoca but the panel to do it is not present in mandrakelinux kde version...

(strange that fresh 10.2 install takes more time (1'21) with basically the *same* hardware than test2 (0'33) with fresh 10.1 install...) (FredericConrotte)

(Same hardware but probably not the same method. My method is until kde splash disappear. Not sure that test2 use the same end point.) (LoicBaudry)

[edit]

Test 9 (JohnKeller)

[edit]

Hardware

  • Pentium II 400 MHz
  • 256 MB RAM
[edit]

System / Services / Modifications

  • 2005 LE updated to Cooker (10 May 2005)
  • all services at default
  • no configuration tweaks
[edit]

Results

attached "bootchart_2005-05-10.png"

Total Boot Time: approximately 2m15s from LILO to GDM login (services still starting on VT 1).

[edit]

Test 10 (LuisMenina)

[edit]

Hardware

  • AMD 3000+
  • 512 MB RAM
  • ATI Radeon 9800 PRO
  • ADSL Modem : SAGEM Fast 800 (first test)/ Bewan Eternet 100 (second test)
  • USB Zip 100
  • nVidia nForce2 MCP Networking Adapter 10/100
[edit]

System / Services / Modifications

  • 2005 LE fresh install
  • all services, with some exceptions
    • - all bluetooth related services
    • + wine, ddclient
  • no configuration tweaks
[edit]

Results

Test with SAGEM Fast 800:

  • Total Boot Time*: 1m15s from LILO to the end of GDM autologin

attached "bootchart-test10.png"

Test with BeWan Ethernet 100:

  • Total Boot Time*: 55s from LILO to the end of GDM autologin

attached "bootchart-test10-1.png"

[edit]

Ideas to improve Boot Time

  • iptables/shorewall takes about 6 seconds ([How can I speed up start (restart)?])
  • harddrake takes 5 seconds at every boot => automatically activate harddrake service only when system detects new hardware before rebooting.
  • Add boot image [kernel name]-New_Hardware. When this boot image is selected, HardDrake/other hardware detection software runs. Otherwise skip the hw detection.
  • KDE Performance Tips (How to turn off system configuration startup check (kbuildsycoca) in Mandrakelinux 10.1?) (GregorP)
  • Run some services in background.
  • Start services xfs & dm sooner.
  • Use prelink.
  • Use dash instead of bash.
  • Start CUPS later in the boot process; it's rarely needed before login.
  • Start gpm later in the boot process
  • Add readahead support
  • Optimise file layout on disk (e.g. with a set aside partition)
  • Integrate highly experimental Ubuntu patches (hacked up xorg loader, hotplug changes)
  • Take a look on what Ubuntu is doing regarding Faster Boot (http://www.ubuntulinux.org/wiki/FasterBootProcess)
  • Parallelization of startup scripts (see below)
[edit]

Parallelization of Startup Scripts to Save Bootup Time

According to this article, it's possible to greatly shorten system startup time by parallelizing execution of startup scripts.

Dependencies between services are handled by using make instead of linearizing their invocation as with current approach.

This way, computer's resources (CPU, I/O throughput) are better utilised to launch services and the time needed to statup is much shorter.

This would be especially useful for desktop computers and laptops.

See also this discussion on Slashdot, Initng and the Serel tool that do this thing too.

See also ParallelInit project : Parallel Init

[edit]

Current status

With udev-065-8mdk, hotplug-2004_09_23-16mdk, sound-scripts-0.28-1mdk dynamic-0.26-1mdk, and harddrake-10.3-0.43mdk, the startup time has been dramatically reduced, especially on old machines. What takes time now at this stage is rc.sysinit, shorewall. Where we really spent time now is between the time X and the dm are forked off and the time the desktop is usable.

[edit]

More information

Personal tools