Results 1 to 10 of 53

Thread: Let's boot with Upstart (GDM ready in 15s)

Threaded View

  1. #1
    Join Date
    Oct 2004
    Cupertino, CA
    Ubuntu 10.04 Lucid Lynx

    Let's boot with Upstart (GDM ready in 15s)

    I got bored and rewrite my entire system to boot up with Upstart. Yes, I rewrote all jobs, essentially wrapping them to call init scripts individually and tweaking the dependencies correctly.

    Short Statistics:
    Time spent hacking: 5+ hours. Ran into a lot of snags getting udev and filesystem mount ordered correctly, and each time I failed at that it meant needing a livecd!

    The Victim: Me. Err, oh you meant the computer: Macbook Core 2 Duo 2.16, 2GB RAM, running Hardy.

    Enjoyment: Infinite. This kind of nerdy thing keeps me going.

    Stopwatch/Visual statistics:
    I'll get to bootchart in a moment, but bootchart doesn't tell the whole story -- what bootchart calls a bootup time and what the user sees as the bootup time are two entirely different things. These boot times are from a stopwatch from GRUB to login chime:

    Native Upstart: 18s

    SysV Upstart: 30s

    Bootchart Stats:

    Native Upstart: (22s)

    SysV Upstart: (27s)


    (1) Note how slow my laptop hard drive is. Around 12MB/s is its peak read speeds. If I tried this with a powerful desktop hard drive, the 10 second long "readahead-list" could be shaved to 5 seconds or less.

    (2) Ignore the first 17s of both bootup charts for the time being: Time spent probing modules and slurping readahead cannot be optimized by parallelized startup and are more or less hardware and kernel limitations on bootup speed. Focus on what's after the big blue trapezoid @ 15s: The actual time it took to set up dbus, hal, avahi, GDM, anacron, sysklog, and other system services. It took 5 seconds to do all of that on Upstart while SysV took over 10s. That's effectively doubling the speed at which services are coming up. In addition, notice how Upstart was more consistently able to break the one-core barrier of CPU usage.

    The event.d:
    For educational purposes, here's how I wrote my upstart events:

    You're welcome to play with it all you want, but DO IT ON AN EXPERIMENTAL BOX. It's extremely easy for one typo or logic error to result in an unbootable system.


    As a proof-of-concept, I "defragged" (rewrote rapidly) all the files readahead identified as being used at bootup, and got peak IO to around 15MB/s and upstart boot time to 19s by bootchart

    EDIT 2: Youtube video of bootup: (note how rough around the edges it is )

    Bootchart for this bootup:

    EDIT 3: After some requests I am posting some dependency diagrams of my boot:

    For comparison, SysV:

    For the most part it fans out massively parallel quite well, which is encouraging news. Now, to optimize the longest chain length....

    You can generate this diagram on your own system by grabbing and

    They don't come with manuals; figure it out
    Last edited by jdong; March 18th, 2008 at 02:09 AM.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts