Boot-time improvements

Jonathan Carter (highvoltage) jonathan at ubuntu.com
Tue Sep 9 18:31:33 UTC 2008


Hi

Some systems have been really successful at making it *appear* as if the 
system starts up faster. In my opinion, where the system can't be made 
to boot faster, it should be made to appear so.

Here are some ideas around improving boot speed and making it appear faster:

1. Have as few transitions in the boot process as possible

When a transition occurs, ie, the screen colour changes or flashes, it 
distracts the user, and gives an illusion that something is happening. 
It also makes it appear that more things are busy happening, and it 
makes the user notice the periods between the transitions (the 
watching-paint-dry effect). What happens before Ubuntu start is 
unfortunately not controllable. This is where Apple seems to have a very 
good advantage in their boot-up process. I think Ubuntu at least, should 
minimise all the transitions where it is possible.

2. Login dialog needs to be displayed as early as possible

Currently, the system does what it has to in order to start X and start 
up GDM. It would be nice if Usplash (or something) could have a field 
where you could enter a username and password so long, which could be 
passed on to GDM when it's good and ready. This way GDM doesn't have to 
load its interface and possibly not do so much as it does now. Having a 
username/password dialog as early as possible usually gives a good 
impression of boot-up time, and while the user types in their 
username/password, the system will be busy booting in the meantime.

The problem with both points above is the amount of integration that 
happens in the various boot phases. Usplash throws its graphics out on 
the framebuffer, while GDM uses X. We probably don't want to get rid of 
GDM entirely, or at all, since, from what I've seen in concept 
screenshots, GDM will be getting some real nice composited usability 
features, and most users would probably want to use it.

So in terms of getting boot speed as fast as possible, I've wandered a 
bit on the following:

1. Attempt to get an X server up much sooner

Perhaps the bare minimum X server files could be stored in the 
initramfs? I guess this could probably make the image too alrge which 
wouldn't make this option very viable. If it could be done, the program 
that would display an initial boot logo on this X server should also get 
support for detecting that a disk check is about to happen, and display 
the appropriate output. I think Red Hat once (or still does?) used an X 
server for their boot up display. I think they started up GDM seperately 
though (causing X to start twice during the boot-up process). The 
greeter should be started with the same X session, so that only one X 
session is started during the boot process. This may also allow 
composited effects to be displayed during the boot-up process. Users 
wouldn't want their boot-process to end too soon if it looks uber-cool :)

2. Remove the flashes and brown screens when starting Gnome

Personally, my biggest annoyance as a user is the brown screen that 
flashes between GDM and when Gnome starts. It would be much nicer if gdm 
displayed the greeter for half a second longer, and when Gnome has the 
desktop wallpaper ready, it would do some nice GL transition to the 
actual desktop environment. Where there has to be transitions, it would 
be good to keep it as smooth as possible.

 From a technical level, I guess it comes down to keeping the following 
to a minimum during boot:

  * CPU usage
  * Disk reads/writes (and probably more specific, disk seeks)

It seems that with the current process, it's close to as fast as it can 
be at the moment. Readahead avoids unnecessary disk seeks. Upstart gets 
the services started in an optimal (well, let's assume so for now) way 
so that the right services start at the right time. It seems that 
boot-up speeds on laptops and desktops are the most important. Servers 
shouldn't ideally be restarted unless there is security updates that 
require it or when hardware is added. Laptop users are probably less 
likely to care whether things like apache (some people run it on laptops 
for testing, etc) or cron are started immediately. A lot of things are 
probably safe to start way after the login dialog is displayed. Some 
things probably even far after the user is logged in. It would probably 
be nice if Upstart had some kind of inetd service support, so that if 
you happen to have a server (such as openssh-server) installed on your 
laptop or desktop, that the service will be started up when something 
(or someone) tries to access its associated port.

Perhaps making the boot-process longer, by loading any non-essential 
software as late as possible (even long after the user has logged on), 
but getting the user interface ready as early as possible, should be the 
target, instead of trying to get everything to complete as soon as possible.

If something like Usplash continues to be used, I think it's important 
that it transitions well into the next phase. Not sure if that's even 
possible when using X.

Sorry for the blabbering, I can't wait to see what ideas the Ubuntu crew 
comes up with to get the boot-speed super-fast :)

-Jonathan




More information about the Ubuntu-devel-discuss mailing list