View previous topic :: View next topic |
Author |
Message |
Dhaki Guru
Joined: 16 Jun 2004 Posts: 325 Location: Ticino - CH
|
Posted: Sun Nov 07, 2004 10:28 am Post subject: |
|
|
aragostaragazzo wrote: | baeksu wrote: | Tried adding xdm (i.e. gdm) to my boot run-level, works with no problems.
...I'm not familiar with the runlevels or depenencies, however. Xdm kicks in at the end of the boot levels, and as I have little on my default level, the speed increase is not very huge. Still, X starts a little earlier than before. |
I did the same thing, and it's a subtle improvement.
Does anyone know what the deps are for xdm?
I feel that it could be booting faster than it is, but I'm not sure what else I need to start...
(Edited to fix quote tags ) |
I've found in the dev ml this:
Quote: | That article in the forums suggests adding xdm to the boot runlevel to get it
started sooner. Ive been doing something for a while which is slightly
different, and IMO a little cleaner.
I use an additional runlevel called postx for services that shouldnt hold up
xdm. xdm and all the essential services are in the standard default runlevel.
Then in /etc/conf.d/local.start I have....
(sleep 20; /sbin/rc postx) > /var/log/postx &
The sleep allows enough time for xdm to start smoothly, then the postx
runlevel services are started in the background. |
But I dont know the exactly dependancies of xdm... |
|
Back to top |
|
|
asph l33t
Joined: 25 Aug 2003 Posts: 741 Location: Barcelona, Spain
|
Posted: Mon Nov 08, 2004 7:46 pm Post subject: |
|
|
you can check the depends of every service by editing the scripts at /etc/init.d
rmember that if X depends on Y, and Y depends on Z, X will also depend on Z _________________ gentoo sex is updatedb; locate; talk; date; cd; strip; look; touch; finger; unzip; uptime; gawk; head; emerge --oneshot condom; mount; fsck; gasp; more; yes; yes; yes; more; umount; emerge -C condom; make clean; sleep |
|
Back to top |
|
|
Dhaki Guru
Joined: 16 Jun 2004 Posts: 325 Location: Ticino - CH
|
Posted: Mon Nov 08, 2004 8:30 pm Post subject: |
|
|
Yes but for example if you need samba or I dont know what, it isn't in the /etc/init.d/xdm file... Yes, in 1 or 2 boot you would have a system that work and is ok... There isn't any other possible problems?
And for a very minimal system, witch rc-update I can delete? For example,
is really needed? |
|
Back to top |
|
|
castorilo Apprentice
Joined: 25 Dec 2002 Posts: 157
|
Posted: Mon Nov 15, 2004 3:32 pm Post subject: |
|
|
Pretty much the whole section 1 has problems, and I have written several patches to fix them.
/etc/init.d/modules
Your approach has problems because when a kernel changes, modules-update does not get run. Also, if only one of the scripts in /etc/modules.d changes, the directory itself does not get marked as changed and modules-update will not be run.
Check this bug for the appropiate way to do it.
/etc/init.d/localmount
This works fine unless you have something like /usr and /usr/local in fstab. In that case it can completelly fail. Maybe a warning should be put?
/etc/init.d/bootmisc
This does not work because if you change just one script inside /etc/env.d/, the directory itself does not change and env-update.sh will not be run.
Check this bug for the proper way to do it
/etc/conf.d/rc
RC_PARALLEL_STARTUP is currently a joke. At any given time during boot up, it is running either one script, or two scripts + a cpu hungry busy wait. It can even make things worse.
I wrote a patch that does true parallel startup with no busy waits, and it does save a lot of time, check this bug
I wrote a guide on how to apply these patches in some other thread, I'll quote it here:
paulpach wrote: |
I made 3 patches that speed up boot time dramatically. Initially, It took my computer 2:00 minutes from grub to kdm, and I have been able to reduce it to 1:09 (YMMV). Here is how you can do it:
make sure you have baselayout-1.11.6-r1.
Before you start, make sure you time your current boot time (so you can post it here later )
Do not calculate module dependencies if not needed
This patch saves me around 11 seconds
1) go to this bug and download the patch named "modules-update.patch" and save it as /tmp/modules-update.patch
2) apply the patch:
Code: |
cd /
patch -b -p0 < /tmp/modules-update.patch
|
Make parallel startup really parallel
This saves me around 20 seconds. RC_PARALLEL_STARTUP right now is a joke. At startup the computer is doing either one script or two scripts + a cpu hungry busy wait. This patch I made makes RC_PARALLEL_STARTUP trully parallel running as many scripts as posible with no busy waits, and fully maintain the dependencies and semantics of use, need and before.
Note the messages "starting xxx..." and the corresponding [ok] no longer show on the same line, they get screwed up, but the services start up fine like before.
1) go to this bug and download "parallel_startup.patch" and save it as /tmp/parallel_startup.patch
2) apply the patch:
Code: |
cd /
patch -b -p0 < /tmp/parallel_startup.patch
|
3) enable parallel startup. Edit the file /etc/conf.d/rc and change the line
Code: |
RC_PARALLEL_STARTUP="no"
|
to
Code: |
RC_PARALLEL_STARTUP="yes"
|
Start xdm as soon as posible
This gives me kdm login prompt 20 seconds sooner. This one is especially better after doing the previous one. Right now it has only been tested with kdm, I am emerging gnome to test it with gdm.
1) go to this bug and download the file "fastxdm". Save it in /etc/init.d/fastxdm
2) remove xdm from default boot level and add fastxdm
Code: |
chmod +x /etc/init.d/fastxdm
rc-update del xdm default
rc-update add fastxdm default
|
Reboot, time it and Enjoy.
|
|
|
Back to top |
|
|
vdboor Guru
Joined: 03 Dec 2003 Posts: 592 Location: The Netherlands
|
Posted: Tue Nov 16, 2004 7:08 pm Post subject: |
|
|
baeksu wrote: | Tried adding xdm (i.e. gdm) to my boot run-level, works with no problems.
...I'm not familiar with the runlevels or depenencies, however. Xdm kicks in at the end of the boot levels, and as I have little on my default level, the speed increase is not very huge. Still, X starts a little earlier than before. |
I can actually hardly believe it "starts a little earlier than before"... the /etc/init.d/xdm script just tells init it should run "runlevel a" after it completed all other runlevels.... so, how is this actually improving speed? (but it also explains why xdm always starts as last service)
Dhaki wrote: | But I dont know the exactly dependancies of xdm... |
Afaik xdm doesn't have any real dependencies (init starts runlevel 'a' once everything else is running) But the gentoo devs did this for a reason: if both X and agetty try to open the same terminal, your X session hangs. That's why X starts after init finished the entire boot process and started agetty to open the 6 terminals.
I've been playing with the postx script as well, but removed it too.. My desktop became a little unusable (because of all the services loading in the background), exactly the same problem I always have with MS-Windows. _________________ The best way to accelerate a windows server is by 9.81M/S²
Linux user #311670 and Yet Another Perl Programmer
[ screenies | Coding on KMess ] |
|
Back to top |
|
|
baeksu l33t
Joined: 26 Sep 2004 Posts: 609 Location: Seoul, Korea
|
Posted: Tue Nov 16, 2004 11:21 pm Post subject: |
|
|
Quote: | vdboor: I can actually hardly believe it "starts a little earlier than before"... the /etc/init.d/xdm script just tells init it should run "runlevel a" after it completed all other runlevels.... so, how is this actually improving speed? Embarassed (but it also explains why xdm always starts as last service) |
The difference is that when xdm was run on the default, you would have a couple of seconds of login prompt before X starts (almost enough time to login, actually).
When xdm was at boot, the login prompt barely flashed before X started. Granted, this was probably less than a three second improvement. _________________ Gnome:
1. A legendary being.
2. A never ending quest to make unix friendly to people who don't want unix and excruciating for those that do. |
|
Back to top |
|
|
Dhaki Guru
Joined: 16 Jun 2004 Posts: 325 Location: Ticino - CH
|
|
Back to top |
|
|
SerfurJ l33t
Joined: 10 Apr 2004 Posts: 824 Location: Texas
|
Posted: Thu Nov 18, 2004 1:04 am Post subject: |
|
|
mvila,
you should add fc-cache to your list. it really improved the performance of my system. application startup time was reduced several fold. |
|
Back to top |
|
|
gungholady Guru
Joined: 19 Oct 2003 Posts: 392
|
Posted: Thu Nov 18, 2004 2:33 am Post subject: |
|
|
Regarding the tip for swappiness. I've seen some information about this other places. I've been unable to find anything in /proc/sys/vm that is called swappiness. Is this something I've missed when I compiled my kernel? I'm using a 2.6+ kernel. |
|
Back to top |
|
|
robind Apprentice
Joined: 08 Oct 2004 Posts: 260 Location: California
|
Posted: Fri Nov 19, 2004 7:24 am Post subject: simple gdm |
|
|
But how exactly does one go about making it so that GDM will just start on boot? |
|
Back to top |
|
|
makzu n00b
Joined: 28 Jun 2004 Posts: 42
|
Posted: Mon Nov 22, 2004 3:01 pm Post subject: |
|
|
I don't know if this was said before or not, but I may as well throw my two cents in.
If you specify both -march AND -mtune in make.conf, it turns out that the last one you specify is the one that gets used. This might cause a small amount of slowdown in your programs, because GCC will use -mtune instead of -march.
The obvious solution is to change the order. Make sure -march is AFTER -mtune in /etc/make.conf, and you won't run into that little slowdown. _________________ 'Twas brillig, and the slithy toves
Did gyre and gimble in the wabe.
All mimsey were the borogroves,
And the mome raths outgrabe. |
|
Back to top |
|
|
licor n00b
Joined: 01 Sep 2003 Posts: 36
|
Posted: Wed Nov 24, 2004 8:02 pm Post subject: |
|
|
LOL!!!!
Long live HHGTTG!
Chaosite wrote: | What happened to the times when all we had to do was try to hit the ground and miss?
|
|
|
Back to top |
|
|
Seabeast n00b
Joined: 30 Oct 2004 Posts: 25
|
Posted: Mon Nov 29, 2004 5:09 pm Post subject: |
|
|
I'm having some problems with /etc/init.d/bootmisc
After editing it with the env-update part (and just that part) described on the HOW-TO it looks just like this:
Code: | if [ -x /sbin/env-update.sh ]
then
if [ /etc/env.d -nt /etc/profile.env ]
then
ebegin "Updating environment"
/sbin/env-update.sh >/dev/null
eend 0
else
einfo "Environment up-to-date"
fi
fi |
As it should be, right?
But then, at startup, after setting the hardware clock (i don't use XDM or it derivatives) the system says:
Code: | /var/lib/init.d/bootmisc-372: line 115: syntax error unexpected token '}'
ERROR: "/etc/init.d/bootmisc" has syntax errors in it not executing. |
Even when line 115 is empty, or when it has '}'.
Can someone help me? I've felt no downgrade or malfunctioning due to this message but it's kinda annoying. _________________ ROCK OVER LONDON |
|
Back to top |
|
|
DFanick Tux's lil' helper
Joined: 30 Aug 2004 Posts: 78 Location: Norderstedt
|
Posted: Sun Dec 12, 2004 4:38 pm Post subject: just sharing experiences |
|
|
hi!
here my make.conf for pentium4 with gf5200. i didn't use them from scratch, but eveything i compile now seems to work fine (&FAST) with the newest gcc (3.4.3 20041125).
Code: | CHOST="i686-pc-linux-gnu"
CFLAGS="-O4 -mtune=pentium4 -march=pentium4 -pipe -fforce-addr -falign-functions=4 -fprefetch-loop-arrays -fomit-frame-pointer -ffast-math"
CXXFLAGS=${CFLAGS}-fvisibility-inlines-hidden
MAKEOPTS="-j2"
LDFLAGS="-Wl,-O1,-z,now"
USE="x86 oss apm -arts avi berkdb crypt cups devmap dga directfb divx4linux dvd dvdr eds encode fbcon foomaticdb gdbm
gif gpm gstreamer gtk gtk2 hal -hardened pgo imlib jpeg kde gnome jack kde libg++ libwww mad mikmod mmx motif mpeg ncurses nls
nptl npltonly oggvorbis opengl pam pdflib pic png python qt quicktime quotes readline sdl slang spell sse ssl svga
tcltk tcpd truetype -unicode X xml2 xmms xprint xv x86 zlib"
|
that's all.
bye |
|
Back to top |
|
|
alctraz Tux's lil' helper
Joined: 12 May 2004 Posts: 117 Location: belgium
|
Posted: Mon Dec 27, 2004 4:14 pm Post subject: |
|
|
just made a benchmark with bootchart to measure the efficiency of the init scripts optimization
http://www.groulala.net/alctraz/bootchart/
result: boot time reduced from 32s to 25s |
|
Back to top |
|
|
unix l33t
Joined: 06 Jul 2003 Posts: 615 Location: Dürnten ZH Switzerland
|
|
Back to top |
|
|
blixel Guru
Joined: 19 Jul 2004 Posts: 403 Location: Central, Florida
|
Posted: Tue Feb 15, 2005 8:37 pm Post subject: Re: [HOWTO] Flying with gentoo |
|
|
asph wrote: | 11. Halt vs Suspend
Have you never asked yourself why you shutdown you computer, when you can suspend it to ram or disk?
If you suspend to ram, it has the handicap that it will still need AC input in order to keep the system alive. But suspending to disk is very useful (specially for laptops), because the laptop will "shutdown", but we will keep our sesion.
Doing it this way we avoid to boot all the system services everytime (it not an instant recuperation from the "sleep", but seems faster).
I have used swsusp2 in my laptop and works fine, but you have to patch the kernel sources. You can find info in THIS post on how to do this. Try it and you won't regret. |
Nice guide. I was especially interested in the hibernate part because I have *NEVER* been able to suspend my machine. It goes doen fine, but bringing it back up is another story. I followed your links and tips and got it more or lesss working. I'm pretty happy just to have what I have now. Which is the ability to suspend to the disk and shutdown completely. However, I'm far more interested in the sleep mode and that seems to not be working quite right. When I type "hibernate", the machine goes to sleep but then instantaneously reboots. Besides being an undesirable effect, I feel that it is probably very hard on my computer hardware (primarily the hard-drive) to have it shutdown and reboot so quickly. So I don't want to do much experimenting until I learn a little more about this. Has anyone else had this problem?
Here's a look at my complte /etc/hibernate/hibernate.conf (I removed all comments so it wouldn't be so long.) "PowerdownMethod 5" is the only one that works the way I would expect. If I use 3 or 4, the system goes down, and then instantly reboots. Not quite the same as hitting the reset button. More like pulling the power cord and plugging it right back in.
Code: | UseSwsusp2 yes
Reboot no
## Powerdown method - 3 for suspend-to-RAM, 4 for ACPI S4 sleep, 5 for poweroff
PowerdownMethod 5
Verbosity 1
LogFile /var/log/hibernate.log
LogVerbosity 1
SaveClock yes
UnloadBlacklistedModules yes
LoadModules auto |
|
|
Back to top |
|
|
Dhaki Guru
Joined: 16 Jun 2004 Posts: 325 Location: Ticino - CH
|
|
Back to top |
|
|
kalestic n00b
Joined: 01 Dec 2004 Posts: 23
|
Posted: Mon Feb 21, 2005 3:09 am Post subject: |
|
|
Great HowTo! _________________ Always Remeber to focus on your goal, not the obstacle you have to face!
MyWebsite: http://blaze.ath.cx |
|
Back to top |
|
|
Bigun Advocate
Joined: 21 Sep 2003 Posts: 2196
|
Posted: Thu Feb 24, 2005 1:13 pm Post subject: |
|
|
The link you gave for more info on the acpi runlevel, was in Spanish. Is there a version in English?
*EDIT*
Here is the URL for the English version, just scroll down a bit. _________________ "It's ok, they might have guns but we have flowers." - Perpetual Victim |
|
Back to top |
|
|
Gogiel Guru
Joined: 11 Nov 2004 Posts: 347
|
Posted: Wed Mar 09, 2005 7:24 pm Post subject: Re: [HOWTO] Flying with gentoo |
|
|
Quote: |
6. Managing the swap
In this section I just wanted to mention some things that can help us.
First of all, if you have two harddisks it is better to put the swap partition on the second disk (having the root partition in the first one) as this will improve the read/write times.
Also you should NOT use a file as swap. I tried it once in an old computer, deleted the swap partition and set a file as ./swap of 256 MB.¡ and modified fstab. This method is slower, as it has to find the file, open the file, find were it was writting to it, writte to it, save, and close the
file. With a partition in the disc this process is pretty much faster.
Another concept to know about is swappiness (kernel 2.6+). When an application needs memory and the RAM is full, there are two options: or the RAM gets empties a little bit cleaning out old used memory, or swap memory gets used (slower than ram). In the new kernels, you can set a variable to define if the kernel should empty some ram or use the swap partition.
/etc/sysctl.conf
This value can be between 0 and 100. Close to 0 will mean that the kernel should empty some ram, and a higher value close to 100 will tell the kernel to use the swap memory more often.
The default value is 60. I set this to 25 in my laptop, so that i can reduce the disk access. You can use ´free -m´ to see the stats of your memory useage.
|
I tried set swappines on 0, 30, 60, 100 but it still uses swap
Code: | gogiel@gogiel gogiel $ uname -r
2.6.10-gentoo-r6 |
|
|
Back to top |
|
|
asph l33t
Joined: 25 Aug 2003 Posts: 741 Location: Barcelona, Spain
|
Posted: Mon Apr 11, 2005 3:56 pm Post subject: |
|
|
are you sure the value is being used? do you use /proc or /etc/sysctl.conf?
please paste the sysctl and free -m outputs _________________ gentoo sex is updatedb; locate; talk; date; cd; strip; look; touch; finger; unzip; uptime; gawk; head; emerge --oneshot condom; mount; fsck; gasp; more; yes; yes; yes; more; umount; emerge -C condom; make clean; sleep |
|
Back to top |
|
|
Kestutis n00b
Joined: 22 Mar 2005 Posts: 10
|
Posted: Mon Apr 11, 2005 5:38 pm Post subject: |
|
|
I did:
/etc/init.d/modules
change:
Code:
ebegin "Calculating module dependencies"
/sbin/modules-update &>/dev/null
eend $? "Failed to calculate dependencies"
for:
Code:
if [ /etc/modules.d -nt /etc/modules.conf ]
then
ebegin "Calculating module dependencies"
/sbin/modules-update &>/dev/null
eend $? "Failed to calculate dependencies"
else
einfo "Module dependencies are up-to-date"
fi
Doing this, modules-update will only run if it´s really needed because you made changes in the system.
and now my modules doewsn't load anymore. What should I do? I cannot load to graphical mode:(.
Here is modules file:
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/modules,v 1.30 2004/04/21 17:09:18 vapier Exp $
depend() {
need checkroot hostname
use isapnp
}
load_modules() {
local x=
local i=0
local retval=0
local modules=
local modargs=
local modcount=0
local config="$1"
[ -z "${config}" ] && return 0
[ ! -r "${config}" ] && return 0
# Loop over every line in $config
eval $(awk '
BEGIN {
COUNT = 0 # Make sure COUNT is set
}
$0 !~ /(^[[:space:]]*(#|$))/ {
if (MODULES == "")
MODULES = $1
else
MODULES = MODULES " " $1
# Not the greatest method to remove $1 from $0, but it works
sub(/^[[:space:]]*[^[:space:]]*[[:space:]]*/, "")
ARGS[COUNT] = $0
COUNT++
}
END {
# 'eval' will make sure these are set to proper bash variables
print "modcount=" COUNT
print "modules=\"" MODULES "\""
for (x = 0;x < COUNT;x++)
print "modargs[" x "]=\"" ARGS[x] "\""
}
' "${config}")
if [ "${modcount}" -gt 0 ]
then
einfo "Using ${config} as config:"
for x in ${modules}
do
ebegin " Loading module ${x}"
modprobe -q ${x} ${modargs[${i}]} &>/dev/null
retval=$?
eend ${retval} " Failed to load ${x}"
i=$((i+1))
[ "${retval}" -eq 0 ] || modcount=$((modcount-1))
done
einfo "Autoloaded ${modcount} module(s)"
fi
return 0
}
start() {
# Should not fail if kernel do not have module
# support compiled in ...
[ -f /proc/modules ] || return 0
# Here we should fail, as a modular kernel do need
# depmod command ...
if [ ! -x /sbin/depmod ]
then
eerror "ERROR: system is missing /sbin/depmod !"
return 1
fi
if [ -z "${CDBOOT}" ]
then
if [ /etc/modules.d -nt /etc/modules.conf ]
then
ebegin "Calculating module dependencies"
/sbin/modules-update &>/dev/null
eend $? "Failed to calculate dependencies"
else
einfo "Module dependencies are up-to-date"
fi
if [ -f /etc/modules.autoload -a ! -L /etc/modules.autoload ]
then
# Loop over every line in /etc/modules.autoload.
load_modules /etc/modules.autoload
else
local KV="$(uname -r)"
local KV_MAJOR="`KV_major "${KV}"`"
local KV_MINOR="`KV_minor "${KV}"`"
# New support for /etc/modules.autoload/kernel-$KV
if [ "$(get_KV)" -ge "$(KV_to_int '2.5.48')" ] && \
[ -f /etc/modules.autoload.d/kernel-"${KV_MAJOR}.${KV_MINOR}" ]
then
load_modules /etc/modules.autoload.d/kernel-"${KV_MAJOR}.${KV_MINOR}"
elif [ ! -f /etc/modules.autoload.d/kernel-"${KV_MAJOR}.${KV_MINOR}" ]
then
ewarn "Missing /etc/modules.autoload.d/kernel-${KV_MAJOR}.${KV_MINOR}"
load_modules /etc/modules.autoload.d/kernel-2.4
else
load_modules /etc/modules.autoload.d/kernel-2.4
fi
#
# Just in case a sysadmin prefers generic symbolic links in
# /lib/modules/boot for boot time modules we will load these modules
#
if [ -n "$(modprobe -l -t boot)" ]
then
modprobe -a -t boot \* &>/dev/null
fi
}
# vim:ts=4
Where is a misstake? Please someone help me. |
|
Back to top |
|
|
asph l33t
Joined: 25 Aug 2003 Posts: 741 Location: Barcelona, Spain
|
Posted: Tue Apr 12, 2005 11:31 am Post subject: |
|
|
i don't think the modules are not beign loaded because of that tweak, if you just changed that.
are you sure you didnt change something more? when you say that they dont load, is it because of some errors or they are just not loaded?
i guess that you have your modules on /etc/modules.autoload/kernel-2.X (change X for your kernel version, which you can know by typing uname -a).. then modules-update
also use lsmod to make sure the modules are not loaded, and you can also try to modprobe them manually "modprobe module_name", to see if they contain errors. If they load correctly, they should when you boot the system (running modules-update each time makes no sense on a typical users system, where changes are really only made once in a while) _________________ gentoo sex is updatedb; locate; talk; date; cd; strip; look; touch; finger; unzip; uptime; gawk; head; emerge --oneshot condom; mount; fsck; gasp; more; yes; yes; yes; more; umount; emerge -C condom; make clean; sleep |
|
Back to top |
|
|
zayhen n00b
Joined: 26 Nov 2004 Posts: 36
|
Posted: Thu May 19, 2005 11:43 am Post subject: Which is the best accelerating method? |
|
|
Hey people,
All of you have great ideas! This gives me a lot of doubts! Before complaining me, remember, I worried about STABILITY vs VELOCITY. Truth is:
Code: | I run a network with 14 Gentoo/Win2000 and 8 Win2000 machines in my College Math Lab.
We offer email, system accounting, ssh and httpd for our users. All these are run in 1 server only! Yeah! Just one!!! I know this madness.
The Gentoo machines have (against my will) every litle scientific pkg and WM and X aplication. OKay that's not everyone. But the major ones!
|
The workstations will be turned in a cluster. So will be the server. It will receive two clone machines.
Now the questions:
Code: | Would you risk reiserfs4?
What about nptlonly machines?
Which WM runs faster? Does compensate using KDE or may continue offering every litle X shit to my users?
Which techinques may speed my boot time?
My kernel is like a module archipelago (diferent hardware problems). Does anyone may suggest a good, stable and reliable kernel?
|
Too many questions will come to mind. You might be sure. But this is my strongest concernings right now. I know some of you might think this isn't concerned with this topic. But yes, this is! Speed without realiability isn't a good thing. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|