Blog

Toughts about Linux, Windows and Mono influence – Part I

Each time I boot a Windows XP machine I wonder why the hell is it still faster than my tuned Linux box which only starts the needed daemons? Why does Outlook startup under 2 seconds and Evolution takes ages? And questions like that.

If you ever have done a Windows Service or even look carefully into the Windows Service Administrator you will find that not every application is elegible as a Windows Service, you need to implement a specific API where the basic Start, Stop and Restart operations are implemented, and you have the option to specify the dependent services your service needs to run.

That anwsers a bit of the main question – the boot time. Linux uses the Init application to manage the running “profiles” (single or multi-user mode, console or graphical, etc…) and, to do that it uses a set of scripts loaded in a specific order. Init doesn’t provide anything to help implementing the Start, Stop and Restart behaviours lefting that job to the scripts and the distributions. Usually you use a graphical or console-based application that helps you managing those scripts and specifing the services load priority. As a consequence, each service must be loaded at its own time to avoid loading another service that depends on an unloaded service (an example comes to mind: iptables services need the network services to be operational before it can be started).

What I think that should be done its a new implementation of Init that takes into account the services dependencies, creating a tree and load plans that when executed would load the service trees in separate threads (of course it should wait if at some point of one tree service needs another from another tree). This way, and if the load planner was good, we could archive much better Linux boot times using the machine resources at their full potencial. To the ceptic, think of the network daemon, if you’re using dhcp and either your modem is booting, you have the cable unplugged or you’re using a laptop and switching networks all the time, the network daemon will take ages trying to connect to a dhcp server just to tell you, after 90 seconds or so, it couldn’t connect – wouldn’t that time be better wasted if going ahead and starting GNOME or KDE?

To be continued… I’ll be posting two more posts on the subject soon.

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

11 Responses to “Toughts about Linux, Windows and Mono influence – Part I”

  1. Evolution might take ages to
    start, but we still have other clients which don’t. Sylpheed, Thunderbird.. I use Kmail =)

    Oh and the linux boot time thingie is nothing new, and there are a lot of solutions available.
    Gentoo init system allows you to launch many tasks at once, depeding on their relations. I’ve achieved a 22 seconds from Grub to GDM in a 4-5 years old laptop in Gentoo just tunning the init
    services. Suse too. And there are other alternatives.. but they’re just not being used because there’s not a standard for it. Maybe freedesktop could be used as a platform for
    that.

  2. asabil says:

    Maybe Init-NG is what you are looking for ?
    http://initng.thinktux.net/index.php/Main_Page

  3. Still, the question remains — why it takes around 20secs on this 8 months old laptop
    to start OpenOffice 2.0 vs 3-4secs for Microsoft Word on Windows?

    That’s just pathetic and it’s not going to change soon. It’s not even a matter of optimizing the code. It’s just crappy
    software design.

  4. OOo says:

    Well, at least for the price of Word you can upgrade your computer instead and start openoffice faster :)
    InitNG looks like exactly what you are talking about.

  5. Miguel de Icaza says:

    On
    Office Startup speed: read Michael Meeks blog on which he describes the changes he is doing to the linker to reduce startup time.

    OpenOffice startup issues are now well known, and there are
    various paths being pursued to improve it.

  6. Jimjawn says:

    All too true, especially the DHCP stuff. Nothing
    drives me crazier than the 90 second boot time twice a day on my laptop because I’m in a different wireless network. Is there anyway to cut down that wait time?

  7. alexmipego says:

    Jimjawn, you can easly avoid that in fact. Just make your network interfaces off at boot time and use netplugd. Netplugd activates/deactivates your network interfaces when you plug/unplug
    the network cable. Not sure if it works nice with wireless….

  8. Hi,

    You should take a look at the latest Ubuntu (Dapper Drake). They are
    working on some faster init system that is supposedly event-based and launches stuff as needed, in parallel when possible.
    Not sure how much they have achieved, but Dapper drake definitely boots
    faster than previous versions..

    Concerning Outlook, etc.. Well, I think it’s a completly different story. The Linux / Open Source community has way too many libraries and applications
    everywhere, disorganized. This means that when you boot, let’s say, evolution, it will load 20 or 25 libraries, managed by 25 different developer teams, each one re-implementing some logic already
    programmed in some other library (simple example: GLib implements an argument parsing API that is already existing in popt, but there are 100 of other examples like that).
    So, you end up running
    bloat..

    Another problem is that since there is so much stuff, it’s really hard to optimize everything. Everything is stacked on top of everything, so when you want to profile your
    application, you’d better be a C/UNIX guru with 15 years programming experience….

  9. G?.┬Âtz Waschk says:

    Latest Mandriva Cooker
    already has a parallel init implementation that is working really nice and is fully compatible with the LSB specs: http://qa.mandriva.com/twiki/bin/view/Main/Pinit

  10. Shahms King says:

    Just a minor nit, but it’s not actually true that networking needs to be up for iptables to start. At most
    the network drivers need to be present, but it’s definitely possible (and indeed, ideal) to start the firewall before bringing up the network interfaces.

Leave a Reply

For spam filtering purposes, please copy the number 1291 to the field below: