With Slackware 13.37 just around the corner, I will look at ways to speed up the
boot process. This is work in progress.
The classical way of boot-time analysis is
bootchart.
It has a ridiculous depency on Apache Ant, but who cares. I've got it installed
already, but not working yet. (Possibly just a target directory matter.)
Be careful, though, I seem to recall it didn't recognize the end of the startup
process properly last time I tried it (5 years ago?), possibly because Slackware's X runlevel is
4, not 5.
Take a look at this:
[0 1051 10:56:46] ~ % ls -l /bin/*sh
-rwxr-xr-x 1 root root 109680 2010-04-26 03:07 /bin/ash
-rwxr-xr-x 1 root root 794864 2010-05-15 20:12 /bin/bash
-rwxr-xr-x 1 root root 84136 2011-04-16 17:58 /bin/dash
-rwxr-xr-x 1 root root 977876 2007-04-16 01:32 /bin/ksh
-rwxr-xr-x 1 root root 317860 2007-03-31 01:56 /bin/tcsh
-rwxr-xr-x 1 root root 542216 2009-07-16 02:22 /bin/zsh
[0 1052 10:56:53] ~ %
There's quite a bit of calling new scripts explicitly around in etc/rc.d.
If we can get around bash-isms, using dash will be worth it. (This is the
standard sbo dash.)
I don't need JFS drivers, nor bluetooth support, etc pp. Having some of the stuff you need
linked statically into the kernel is good, not having the stuff I don't need is good.
Upstart. That'll keep me occupied for a bit.
Stuff that might make sense, but I haven't tried them:
-
Lots of access to /etc/ goes on during bootup, and most of that in small files,
so seek matters.
-
Easy fix: buy a SSD, which has negligible seek time. But I'm too cheap to do that.
-
A good USB pen drive might work. It's only 1/3rd the speed of a hard drive and 1/10th that of a SSD
(my rule of thumb here is that my HD is ~80MB/s, a modern SSD will do 200+MB/s, and 30MB/s is pretty darn
fast for a pen drive), but no seek might be worth it. Recall that /etc/ is really mostly read-only, so
yes, do keep your shadow copy on the HD as a backup, but your pen drive is not going to be a consumable.
-
/etc isn't all that large, 14 MB on my machine. It might be worth having that in RAM.
This means we have to populate it at some point during startup. But copying the entire /etc
over might have performance benefits over small-file access. Further nerd credits to be had by
compressing /etc into a cramfs or similar and going from that. A cramfs image is a contiguous file,
you're pretty unlikely to have fragmentation in a single file these days. Copying that image into
a tmpfs should be quick. Possible problem: ISTR that Slackware puts its "did I shutdown correctly"
file into /etc, so it might need to be writable.
-
Actually, the previous bit sounds like I'm reinventing initrd. Hmmm...