Yesterday slashdot had an article about a project to visualize the GNU/Linux boot process. For no reason other than satisfying my inner geek, I rebooted this server and obtained my own visualization. Read on for gory details.
I can see right away that a huge chunk of time is spent by the SCSI driver (aic7xxx). From experience, I know that this driver spends 15-20 seconds doing nothing at all. This is done so that SCSI devices have a chance to “settle.” In the not-so-distant past of computer technology, some SCSI devices would take a really long time to initialize. If the operating system reset the SCSI bus and didn’t wait for those devices to finish initializing, major problems would ensue. I can safely reduce that wait time to about one or two seconds, because the lone SCSI hard drive in this system resets quickly.
After the SCSI driver is loaded, the RAID monitor (mdadm) loads, the filesystems are checked for errors (fsck), then mounted (mount), and the PCI bus is probed for hardware (discover). No time savings are possible here. The next step has to do with hot-pluggable hardware — USB, PCMCIA. This computer does not have any of that, so I can save another 7 seconds or so on my boot by removing hotplug and anything that depends on it.
Next, the nameserver process (bind9) is started, then a program called amavis. Once that’s started, the master antivirus process (clamav) is started.
I need to take a moment here and talk about amavis. It is a very complex program written in perl. It takes forever to start, because it pulls in an enormous number of perl libraries. One of those libraries is SpamAssassin. Another is an antivirus client that talks to clamav. The reward for such a slow startup time is an extremely fast and efficient spam filter and virus scanner. This system is so central to my server’s operation that I recently rebuilt the whole server and re-modeled my entire mail system around it.
After amavis and clamav start, a lot happens all at once. Processes that get started include the mailing list manager (mailman), the SQL database server (mysql), the mailserver (postfix and courier), the TACACS+ server (tac-plus), the ssh server (sshd), the FTP server (proftpd), and the webserver (apache).
Still with me? You can now join me in the summary: “Very cool.”