Development/Howto/Boot Time Optimisation

From Mandriva Community Wiki

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

  1. Install the bootchart-logger package from contribs, with following command urpmi bootchart-logger
  2. Reboot
  3. 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.
  4. After boot, verify that /var/log/bootchart.tgz was created and contains the log files.

[edit] Producing the graph

Either:

  • Uploading your /var/log/bootchart.tgz file on http://www.bootchart.org/download.html (Renderer Web Form section).
  • Install the bootchart package and generate the bootchart graph yourself by running bootchart /var/log/bootchart.tgz.

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 Run - 23 October 2007

[edit] Hardware

  • IBM Thinkpad T60pw
  • CPU: Intel Core 2 CPU T7400 @ 2.16GHz
  • Memory: 2.0 GiB

[edit] System / Services / Modifications

  • Distribution: Mandriva Linux 2008.0 x86_64
  • Kernel: Linux 2.6.22.9-laptop-1mdv SMP x86_64
  • Desktop: Gnome 2.20.0
  • Service at run level 5: acpi, acpid, alsa, apmd, atd, avahi-daemon, bluetooth, consolekit, cpufreq, crond, cups, dkms, dm, fuse, haldaemon, harddrake, iptables, keytable, kheader, laptop-mode, mandi, messagebus, netfs, network, network-up, nfs-common, nscd, partmon, portmap, resolvconf, shorewall, sound, syslog

[edit] Results

  • Total Boot Time: 42s
BootChart Results
BootChart Results

[edit] Test Run 2 - 27 Apr 2008

[edit] Hardware

  • Compaq nc6320
  • CPU: Intel Core 2 CPU T5600 @ 1.83GHz (Centrino Duo)
  • Memory: 1.0 GiB

[edit] System / Services / Modifications

  • Distribution: Mandriva Linux 2008.1 i586
  • Kernel: Linux 2.6.24.4-laptop-1mnb #1 SMP i686
  • Desktop: Gnome 2.22 (does it really matter ?)
  • Service at run level 5: aaeventd acpid alsa anacron apmd apparmor atd avahi-daemon bluetooth cpufreq crond cups ddclient dkms dm fuse gpm haldaemon harddrake hddtemp iptables keytable kheader laptop-mode lisa lm_sensors mandi messagebus netfs network network-up nfs-common nscd ntpd partmon portmap psacct resolvconf shorewall smartd sound sshd syslog virtualbox

[edit] Results

  • Total Boot Time: 56s
BootChart Results
BootChart Results

[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 -- NOW IMPLEMENTED AS DEFAULT

[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