View previous topic :: View next topic |
Author |
Message |
lyallp Veteran
Joined: 15 Jul 2004 Posts: 1579 Location: Adelaide/Australia
|
Posted: Fri May 21, 2010 12:10 pm Post subject: Bootchart - 25 seconds until gdmgreeter |
|
|
I am trying to improve my boot times.
I can have my login screen appear 25 seconds after bios startup, according to http://www.krizka.net/2007/08/20/howto-bootchart-with-bsd-process-accounting-on-gentoo/
Any suggestions? References? Is there a way to document my boot priorities such that others can compare configs and possibly suggest improvements?
My main mechanism for improvement has been to tweak the 'depends upon' entries in /etc/init.d _________________ ...Lyall |
|
Back to top |
|
|
erik258 Advocate
Joined: 12 Apr 2005 Posts: 2650 Location: Twin Cities, Minnesota, USA
|
Posted: Sat May 22, 2010 6:36 am Post subject: |
|
|
switch to openrc (slight improvement), allow rc scripts to start in parallel (modest improvement), or rewrite all of init system as a custom bash script (ridiculously fast, system can boot in almost the time it takes to start kernel). _________________ Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit! |
|
Back to top |
|
|
ak47gen n00b
Joined: 15 Feb 2007 Posts: 43
|
Posted: Sat May 22, 2010 8:32 am Post subject: |
|
|
Use openrc/baselayout2
Clean up all unneeded init.d
Don't use initrd and reconfigured kernel to the basics
Use a lighter software....slim instead of gdm
If possible for fastest boot time use SSD, they have the quickest response time.
If all done correctly you can do things like this.
http://www.youtube.com/watch?v=ozA2ie10A6w |
|
Back to top |
|
|
lyallp Veteran
Joined: 15 Jul 2004 Posts: 1579 Location: Adelaide/Australia
|
Posted: Sat May 22, 2010 12:01 pm Post subject: |
|
|
Ok, switched to slim.
Nice and simple.
It did not seem to like my default XSESSION setting in my /etc/rc.conf file so I put a file in /etc/env.d/99xessions to set XSESSION there) as the environment is loaded by the time I run chooser.sh
I Liked the fingerprint theme but it didn't play nice on my dual head monitor - minor little hack on my part to make the background image as wide as my 2 screens so it didn't get 'stretched' and a minor tweak to the theme config to put the input fields back where they belong after the image changed size.
Already running parallel startup with no splash screen. Fiddling continues. No SSD, just want to see what I can do with my mirrored XFS SATA hard disks.
Slim starts at about 17 seconds. _________________ ...Lyall |
|
Back to top |
|
|
ak47gen n00b
Joined: 15 Feb 2007 Posts: 43
|
Posted: Sat May 22, 2010 12:33 pm Post subject: |
|
|
What about your kernel, are you using genkernel, gentoo sources, and do you have everything additional removed that you don't need? |
|
Back to top |
|
|
lyallp Veteran
Joined: 15 Jul 2004 Posts: 1579 Location: Adelaide/Australia
|
Posted: Sat May 22, 2010 12:34 pm Post subject: |
|
|
gentoo-sources, slimmed down to the hardware I use.
_________________ ...Lyall |
|
Back to top |
|
|
lyallp Veteran
Joined: 15 Jul 2004 Posts: 1579 Location: Adelaide/Australia
|
|
Back to top |
|
|
Xytovl Tux's lil' helper
Joined: 15 Mar 2009 Posts: 92
|
Posted: Sat May 22, 2010 4:47 pm Post subject: |
|
|
Are you using devtmpfs ? (a kernel compile-time option)
You can remove hwclock if your kernel is configured to set clock from rtc.
If you want to reduce I/O wait, there is ureadahead that might help https://bugs.gentoo.org/show_bug.cgi?id=303044
ntfs mount seems to take some time, if nothing depends on it, use noauto in fstab and create a script to run it after, in parallel with services depending on localmount. |
|
Back to top |
|
|
lyallp Veteran
Joined: 15 Jul 2004 Posts: 1579 Location: Adelaide/Australia
|
Posted: Sun May 23, 2010 1:26 am Post subject: |
|
|
I am not using devtmpfs, it's marked experimental and I tend to avoid that.
RTC, which option does the RTC setting in kernel?
NTFS, good point. I will think about that one, that requires a bit more work than simply editing the /etc/init.d/ depends values - get it wrong and I will be in a world of pain
Still, 17 seconds isn't too bad _________________ ...Lyall |
|
Back to top |
|
|
erik258 Advocate
Joined: 12 Apr 2005 Posts: 2650 Location: Twin Cities, Minnesota, USA
|
Posted: Sun May 23, 2010 4:51 am Post subject: |
|
|
Quote: | I am not using devtmpfs, it's marked experimental and I tend to avoid that. |
Seems to work pretty well; but apparently new, so it would be unfair to call it anything but experimental. The linux devs are pretty careful but aren't perfect. That having been said, things tend to stay experimental for some time. I personally don't think much of EXPERIMENTAL anymore.
Quote: | RTC, which option does the RTC setting in kernel? |
CONFIG_RTC_HCTOSYS (Device Drivers=>Real Time Clock=>Set system time from RTC on startup and resume) _________________ Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit! |
|
Back to top |
|
|
lyallp Veteran
Joined: 15 Jul 2004 Posts: 1579 Location: Adelaide/Australia
|
Posted: Sun May 23, 2010 9:31 am Post subject: |
|
|
CONFIG_RTC_HCTOSYS does not appear to set the RTC on shutdown, at least from the very brief lookup I have done.
Linux is the primary OS on this machine, windoze is a secondary boot (for gaming ).
I happen to like the RTC being right, even after daylight savings changes. _________________ ...Lyall |
|
Back to top |
|
|
Xytovl Tux's lil' helper
Joined: 15 Mar 2009 Posts: 92
|
Posted: Sun May 23, 2010 11:03 am Post subject: |
|
|
It is up to you, what I mean is that hwclock wastes half a second during boot and that there is a kernel option that does the same thing at no cost (apparently). You can alter the init script to make it do nothing on boot, but save the time on shutdown.
The most important thing is to be able to read the bootchart : when there is no CPU activity and no disk activity at the same time, this means that we are waiting on some HW setup, network etc. It is a god starting point to investigate what could be done at the same time. |
|
Back to top |
|
|
frostschutz Advocate
Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Sun May 23, 2010 11:43 am Post subject: |
|
|
It's possible to shave some seconds here and there by optimizing init scripts.
For example Gentoo's LVM init scripts waste 10 seconds on boot and 820 seconds on shutdown for me, although that's a bit of a special case in my system ( https://bugs.gentoo.org/show_bug.cgi?id=319017 )
The reason for the 10 seconds on bootup in my case is that it does an additional pvscan I believe, which is rarely ever necessary but takes time nevertheless as it has to look at every attached device. The more devices you have the more time it takes to complete...
That's just an example - if you notice an init script taking a lot of time at bootup, taking a closer look at the particular script and commenting out the stuff you're 100% sure you don't need, can save you quite some time. Of course if you remove something that you actually need you're in a world of pain...
I'd not go for the single bash script approach - hard to maintain IMO. And even if it boots 2 seconds faster it's not worth it using a system that's as far away from standard as it ever could be. Makes emerging stuff and additional services so much harder. |
|
Back to top |
|
|
erik258 Advocate
Joined: 12 Apr 2005 Posts: 2650 Location: Twin Cities, Minnesota, USA
|
Posted: Sun May 23, 2010 6:18 pm Post subject: |
|
|
Quote: | I'd not go for the single bash script approach - hard to maintain IMO. And even if it boots 2 seconds faster it's not worth it using a system that's as far away from standard as it ever could be. Makes emerging stuff and additional services so much harder. |
You're right about everything except the 2 seconds. A few systems I've done this to boot in about the time it takes to boot the kernel. Then it thinks for - I mean this literally - a second or two and then the system is up. There's no way to get that kind of speed without removing the sophisticated init subsystems that handle dependencies, failover, etc, and there's no way to get the robustness of a full featured init system without a huge performance hit. It's just the way it is.
Frankly, I wouldn't recommend it to anybody either, at least not in general, but it's a lot of fun to see your init process take less than 2 seconds. The stout-hearted can base their rc script off the existing scripts and save it to a new location, and then update /etc/inittab to point to your rc script rather than /sbin/rc. In this way, you can actually develop a custom initscript alongside the standard, existing init system - that is, it can be nondestructive.
I've never heard of anybody doing this but me, by the way. Specifically, anyone whose eyes grow wide and heart skips a beat when their init process chokes in one way or another, or, to quote frostschutz, is "in a world of pain" if they have to take corrective action on boot-up, shouldn't even think about it. But there's simply no comparison in speed. _________________ Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit! |
|
Back to top |
|
|
frostschutz Advocate
Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Sun May 23, 2010 6:59 pm Post subject: |
|
|
Hmmm, a good init system should have its dependencies cached though, so no calculations should need to be done at boot.
I wonder if the difference for your single bash script approach is really that huge? I mean, the main difference between your single bash script and the full fledged init system will not be the separate scripts or its dependencies, but the fact that in your own bash script, you'll only put the things that are absolutely necessary. How big is the difference if you do the same for init scripts? I mean, most init scripts are slow because they have to work on every system and need to be able to handle every situation, so they do a lot of checks that are not relevant to you. For example the alsa init script has to be able to load the correct alsa modules for your card, even if you personally don't use alsa modules at all, so it does some checks that are a complete waste of time on your system, but makes stuff work for others.
The Gentoo init system is the one thing that lacks the modularity you get for packages with use flags; however making a minimalized init system for a distro, is rather complicated and would break things for so many people, that it's not a feasible solution, not even for Gentoo. |
|
Back to top |
|
|
lyallp Veteran
Joined: 15 Jul 2004 Posts: 1579 Location: Adelaide/Australia
|
Posted: Mon May 24, 2010 9:22 am Post subject: |
|
|
I think the Gentoo init system is really good, particularly the automatic dependency calculation.
I would/do gladly pay the 2 seconds start up time for this. After all, what's 2 seconds in the whole uptime? _________________ ...Lyall |
|
Back to top |
|
|
|