Ubuntu 9.10 boot optimizations: 5 second startup with an SSD

Canonical has announced the availability of Ubuntu 9.10 alpha 6, the final alpha release before the transition to beta testing. Ubuntu 9.10, codenamed Karmic Koala, introduces a number of important architectural improvements and also improves boot performance, especially on computers with solid state hard drives.

Earlier this year, Canonical revealed plans to significantly optimize boot performance. It aims to deliver 10-second startups for the Ubuntu 10.04 release, which is due in 2010. In the latest Karmic alpha, the team has already taken some important steps toward achieving this goal. Their roadmap indicates that 25 seconds is the target for Karmic, and the reference device used to benchmark progress is the Dell Mini 9 netbook. We did some testing of our own to see how the OS is coming along.

I installed Ubuntu 9.10 alpha 6 on a Dell Inspiron 1420n, the Ubuntu laptop that I reviewed in 2007. I conducted extensive startup performance testing and used the bootchart utility to measure the results. My average boot time was 22 seconds, with Xorg starting roughly 13 seconds into the boot process.

Users with solid state drives will see a far more dramatic improvement in boot performance. Canonical external developer relations coordinator Jorge Castro (a former Ars Linux contributor) supplied us with a boot chart from his computer, which has an SSD and boots Karmic alpha 6 in only five seconds. If you examine his chart, you will see that Xorg comes up in only two seconds.

One of the most significant technical factors contributing to awesome SSD boot performance is the inclusion of sreadahead, a system service that uses prefetching to load data that is used by the boot process before it is needed. It will also cache the prefetched data and store it so that it can be used during subsequent boots, but it's less effective on conventional hard disks where seek latency introduces some challenges. Ubuntu developer Scott James Remnant explained some of the technical nuances in a mailing list post a few months ago.

In Ubuntu 6.10, which was released several years ago, Canonical introduced a new event-based boot daemon called Upstart to replace the traditional System-V init. One of the primary advantages of Upstart is that it is highly conducive to parallelizing the boot process. In previous versions of Ubuntu, Upstart has largely been used with traditional init scripts. Karmic is the first version where it's really being used to its full potential. On an interesting side note, Upstart has been gaining a whole lot of traction in the mobile space and is used in both the Palm Pre and Nokia's upcoming N900.

Not just boot time

In addition to the improvements to boot performance, a number of other significant enhancements are also featured in Ubuntu 9.10. This is the first Ubuntu version to use GRUB2 and Ext4 by default. Another major change is the adoption of DeviceKit, which will displace HAL, the previous hardware abstraction layer. Pidgin has been replaced in favor of Empathy, a new instant messaging client built on the Telepathy framework that has been adopted by the GNOME community. Client software for Canonical's Ubuntu One cloud storage service is also included by default for the first time.

Ubuntu 9.10 alpha 6 is available for download from the Ubuntu web site. According to the release schedule, the first beta is due on October 1, and the final release is coming on October 29.

Hmm, sounds very nice. Though in my use, I would much prefer a suspend (to ram) that worked properly. One of the things I really really miss from osx. Guess it is kinda my fault as well for buying a macbook and thinking it would be as compatible as my previous Lenovo Thinkpad in linux... Hah!

Fast boot times?? This is low on my list of desired Linux improvements...

Ah well, when people work for free (as I assume most people who develop for Linux does), you'll find they do what they like rather than take opinion polls (though I also find the ones I emailed about problems with their software to actually fix stuff I report broken, and seem to enjoy it too!).

Fast boot times?? This is low on my list of desired Linux improvements...

Ah well, when people work for free (as I assume most people who develop for Linux does), you'll find they do what they like rather than take opinion polls (though I also find the ones I emailed about problems with their software to actually fix stuff I report broken, and seem to enjoy it too!).

That's the problem with trying to get FOSS to compete with commercial offerings in the OS space. The FOSS guys are developing the system they want, the commercial guys are (supposed to be) developing the system the USERS want and will therefor buy etc.

Anyhow, I'm not sure why people are having problems with uptime, the Ubuntu servers i manage tend to stay up indefinitely until i reboot them or break something

One of the advantages of Linux has been its fantastic uptimes, who cares how long it takes to boot up. I'd rather have a stable and efficient system. I don't know what else Koala is going to have, but if the main feature of 0910 is faster boot times, I'll be disappointed

As far as I can tell, Linux is faster than Windows to boot up on most systems. Anyway, when can we expect to see Upstart on Mac? You know, b/c Apple is doing everything in parallel now w/ Grand Central Dispatch...

I haven't had a problem with Linux ever crashing... even the Mac has crashed once or twice since I've had it (mainly when waking up from sleep). So I have no idea where those reports of Linux being more unstable than others are coming from... unless it's from a certain company based in Redmond

Originally posted by bartfat:As far as I can tell, Linux is faster than Windows to boot up on most systems. Anyway, when can we expect to see Upstart on Mac? You know, b/c Apple is doing everything in parallel now w/ Grand Central Dispatch...

Mac has Launchd, that's where Canonical got the idea for upstart when Apple refused to license launchd under agreeable terms.

I use Virtual Box and originally played with openSUSE using KDE. I think switched to Ubuntu 9.04 for the Mac4Lin theme. I have to say besides getting used to bash (I am a windows command line guy) it has been OK. If it were not for the games I could see using this on a laptop as a secondary OS.

Originally posted by bartfat:As far as I can tell, Linux is faster than Windows to boot up on most systems. Anyway, when can we expect to see Upstart on Mac? You know, b/c Apple is doing everything in parallel now w/ Grand Central Dispatch...

Mac has Launchd, that's where Canonical got the idea for upstart when Apple refused to license launchd under agreeable terms.

Ya.. the point of those things is that they are event-driven init systems rather then serial execution of init scripts. The advantage being is that with changing network conditions and hardware the system can, at least have a good chance, adapt to those changing conditions. Although until recently most of what upstart did was just run in old sysv-style serial execution init compatibility mode.

Honestly...who cares about boot times? I usually boot my (Windows) notebook once a month, after updates are installed. Otherwise I just put it to sleep, which takes a breathtaking 3 seconds. Faster boot will not convince a single new user to migrate to the Ubuntu platform.

How about fixing sleep so that it works reliably on all sorts of hardware? And while we're at it...please do something do enable smooth window resizing on GTK while displaying the contents. And finally make Gnome and GDM resolution independent, so that I can have a large enough font size even on my 1080p HDTV with my Ubuntu media center PC.

Originally posted by falling:Ubuntu's uptime is great as long as you don't install the regular updates. If you do, then uptime is limited to about a week, since updates often require reboots.

More like a month I find. Of course, I'm still using Hardy Heron. I usually don't care about boot times, but lately I've found that on those occasions (laptop) where I do have to turn it off and on, waiting for the thing to boot up gets boring in a hurry. I think I'd rather have them start working on porting over more up-to-date versions of available packages once Karmic Koala is here and boots all fast-like as they wanted it to.

How's Telepathy compared to Pidgin in terms of simplicity and usability? Features?

Originally posted by bartfat:As far as I can tell, Linux is faster than Windows to boot up on most systems. Anyway, when can we expect to see Upstart on Mac? You know, b/c Apple is doing everything in parallel now w/ Grand Central Dispatch...

Mac has Launchd, that's where Canonical got the idea for upstart when Apple refused to license launchd under agreeable terms.

Launchd is published under the open source Apache License 2.0.

Edit: in actual fact, it was originally published under the GPL-incompatible Apple Public Source License. Apple actually re-licensed launchd under Apache, specifically to make it easier for open sourcers to implement.

Anyway, I'm sure you can wikipedia with the best of us. Less fuddy more facty svp.

but it's less effective on conventional hard disks where seek latency introduces some challenges.

Conventional hard disks can be pretty fast once a sector has been found. So I think that if you could put the appropriate boot information onto the disk in consecutive sectors, then you could theoretically get the same kind of speed-ups. Just one seek latency plus one burst read and you're done.

Originally posted by Tremelune:Fast boot times?? This is low on my list of desired Linux improvements...

What would you want then? Better drivers? Better GUI? Those seem to be pretty popular in various wishlists. Did it ever occur to you that the people who work on improving boot-times are not the same who work on drivers and GUIs? Why do people assume that when people work on improving some aspect of Linux, it automatically means that some other area gets less resources?

quote:

Also, my XP machine boots in 5 seconds with an SSD...A fast disk will do that.

And Windows 3.11 probably boots even faster, so what's your point? That old OS'es boot faster?

Originally posted by arser:Honestly...who cares about boot times? I usually boot my (Windows) notebook once a month, after updates are installed. Otherwise I just put it to sleep, which takes a breathtaking 3 seconds. Faster boot will not convince a single new user to migrate to the Ubuntu platform.

So, waking up from sleep in Windows is about as fast (or slow) as booting Ubuntu is? Why would I want to sleep my machine if booting is about as fast?

Sure, faster boots might not make anyone switch to Ubuntu. But it does make the system more pleasant to use. Besides, you could make that claim about any single feature. Smooth window-resizes in Ubuntu is not going to make anyone switch to Ubuntu. But when you combine lots of improvements, some people might switch.

quote:

And while we're at it...please do something do enable smooth window resizing on GTK while displaying the contents. And finally make Gnome and GDM resolution independent, so that I can have a large enough font size even on my 1080p HDTV with my Ubuntu media center PC.

What makes you think that if they work on boot-times it means that they are not working on those things as well? Do you think that it's the GTK+-developers and GNOME-developers who are working on making Ubuntu boot faster? Maybe those are totally different people?

Honestly...who cares about boot times? I usually boot my (Windows) notebook once a month

yeah sure. I had a system with 73 background processes after I got a clean business client. Sadly this results in 5-10 min boots and reboots every 2-3 days because some thing or another has shot itself to death.

Windows is quite nice unless lots of programs are installed. My home notebook can go on forever as well.

Originally posted by JPan:[QUOTE]yeah sure. I had a system with 73 background processes after I got a clean business client. Sadly this results in 5-10 min boots and reboots every 2-3 days because some thing or another has shot itself to death.

I agree, same problem in my company. Sometimes I can just wonder how much a corporate IT department can shoot a Windows installation. It's not that my office notebook had any more perceivable features than my home laptop (which btw also runs a lot of software).

Originally posted by Janne:So, waking up from sleep in Windows is about as fast (or slow) as booting Ubuntu is? Why would I want to sleep my machine if booting is about as fast?

Because all my programs are still running!

quote:

What makes you think that if they work on boot-times it means that they are not working on those things as well? Do you think that it's the GTK+-developers and GNOME-developers who are working on making Ubuntu boot faster? Maybe those are totally different people?

I am just amused (hence the smiley) about the priorities of the Ubuntu team... Both problems (perceived slowness of GTK redrawing because of asynchronous X and "black-screens-of-death" after ACPI resume) have been open for decades, and keep on negatively impacting my warm fuzzy feelings about using open source software.

However, even my mom can perceive the flickering mess GTK is when it redraws a few widgets. Ever recognized how smoothly and beautifully any recent version of Windows, OS/X and the iPhone can move, slide, transition, fade in, fade out, etc? This is 2009, I could do with some visual beauty...keep those gforces entertained! Compiz did a great contribution here, I am aware of that, but the toolkits are just not keeping up.

Boot times, on the other hand, never bothered me at all...unless of course accidentially my ACPI was once again not functioning. Not even to mention the sad fact that sleeping and resuming after the monthly kernel upgrade is still Russian roulette, in 2009! My Windows 2000 Laptop ten years ago (with APM) was better at resuming than my Linux laptop today (AND it would boot faster :-)

So be assured, I recognize it's different people working at different problems etc. But it is a company like Ubuntu who has the means to tackle big issues, and seeing them focusing their efforts on speeding-up init scripts just makes me wonder whether they know about the priorities of Desktop users.

I agree that boot times are not a big issue for the typical desktop user, but for laptop and netbook users a quick boot time is nice. It's nice that they're tackling this now, as it will move ubuntu (and perhaps other dists) to parallel booting, away from SYSV. It will be debugged and working quite well for future builds. It's not a must-have feature for everybody, but it will be a nice foundation.

Usability and compatability need ongoing focus. I've moved several windows users over to ubuntu lately. They've had few complaints, and are quite happy to say goodbye to bloat, norton, wga, etc. So far, so good, but I'd like to see other tech advances for SSDs (logfs, etc) and continued refinement to trouble areas (sound, fixing X not starting, etc).

It's always nice to have servers that say up for months and workstations that stay up for weeks.

Originally posted by arser:I am just amused (hence the smiley) about the priorities of the Ubuntu team... Both problems (perceived slowness of GTK redrawing because of asynchronous X and "black-screens-of-death" after ACPI resume) have been open for decades, and keep on negatively impacting my warm fuzzy feelings about using open source software.

[...]

Boot times, on the other hand, never bothered me at all...unless of course accidentially my ACPI was once again not functioning. Not even to mention the sad fact that sleeping and resuming after the monthly kernel upgrade is still Russian roulette, in 2009! My Windows 2000 Laptop ten years ago (with APM) was better at resuming than my Linux laptop today (AND it would boot faster :-)

So be assured, I recognize it's different people working at different problems etc. But it is a company like Ubuntu who has the means to tackle big issues, and seeing them focusing their efforts on speeding-up init scripts just makes me wonder whether they know about the priorities of Desktop users.

I'll take it that you've never even tried to do the ACPI hacking necessary to make things work.

(Note: the following is based upon my personal experiences and may be wholly contrary to fact. I'm mostly just ranting, since this issue tends to piss me off.)

Hardware companies don't give a fuck about any OS except for Windows, except for on servers and embedded platforms. The people who program the DSDT for use with ACPI don't seem to know how to code, either. I know I'm merely looking at the disassembly, but some of the methods have logic errors. Sometimes, they even have compile errors, because they only use MS's ASL compiler and not Intel's. I should hesitate to call the MS version "garbage", but it does seem to be far less strict than the Intel one. Hell, even my Linux netbook has a DSDT done by the MS compiler.

But the DSDT doesn't seem to be where the STR issues lie. (If they are, then a fixed version seems to need to be flashed into the appropriate section of the BIOS.) Basically, I think we'd need more hardware documentation to figure all that out, and none of it is forthcoming anytime soon.

I'd love if the resume from Suspend to Disk was even half as fast as the boot. I prefer to suspend to disk at times, because I need to boot into windows natively rather than in Vbox occasionally, and don't want to close everything.

I really hope this one is better, my Primary issues are the SYSTEM BEEP, and the wireless client software. i would also like to see permission elevations in drag and drop. Are they tackling any of those issues?

In this day an age, who cares about a computer's boot performance? That's like caring about boot performance of a phone. My unoptimized and quite old machine with Windows 7 recovers from Sleep in two seconds, and that's all I care for. I haven't reboot my machine since I installed it, other than for installing fixes, which performs reboots automatically without me noticing.

If hibernation/suspend worked more reliably then I wouldn't care so much about boot times. But as it stands, half the time my laptop won't come out of suspend or hibernation properly, if at all, so I HAVE to shutdown. And 50-60 second boot times can be annoying when trying to quickly get to something.