About boot time optimization in Linux

published Aug 19, 2006, last modified Jun 26, 2013

I disagree partially with this statement: The thing that should be talked instead should be linearizing, i.e. making sure that related files (not one, files) are one contiguous area of the disk. This is lifted off Lubos Lunak's blog post about defragmenting on Linux.

The first areas that should be looked (in this order) into:

  1. Reduce the amount of files loaded upon app startup.
  2. Reduce footprint of loaded files on disk. That is, reduce size on disk.
  3. Increment the amount of shareable data, whether it's libraries, icons or other data.
  4. Reduce the amount of work the dynamic loader has to do when loading an application. Prelink or kdeinit help, but they're domain-specific. We need a more general solution that applies to all applications. E.g., the ideal number of relocations should be 0.
  5. Preload the resident set upon boot.
  6. Disk caching the resident set as a contiguous block on disk. This measure should be looked upon as a last resort, sort of what Mac OS X does. This of course entails issues with software upgrades and the like.

Changing on-disk layout should be reserved as a last-resource measure, because it means you have to dig deep into the core system structure, which of course isn't exactly a shareable optimization among Unices, and because it might bring more fragility to an already extremely interdependent system.

All those changes are small time-savers that add up big time. Plus, those all tend to reduce disk head seek and thus startup time.