Kernel Summit: kexec and fast booting
Posted Jul 22, 2004 3:02 UTC (Thu) by
stock (guest, #5849)
Parent article:
Kernel Summit: kexec and fast booting
http://wiki.linuxquestions.org/wiki/Scripting
SLEEP COMMANDS
sleep command
usleep command
Today's typical developer main PC at home is a P4 or AMD screaming fast
iron. These new programmers actually miss the resource limiting
constraints of a Atari St, Amiga 3000, Commodore 64 or even a 8088 Intel
PC with only 640 kbyte RAM. For sake! Even Bill Gates once said the 640
kb RAM limit would never be exceeded.
Nowadays, besides RAM abuse, CPU cycles are really abused in god
forbidden ways and methods. For e.g. pcmcia and hotplug to work, its
common practice that inside a startup script the kudzu program is called
several times in a row. Next if one counts inside /etc/rc.d/init.d
directory the number of "sleep 1" calls, one finally understands why that
P4 3.0 GHz hotrod iron is still slower at booting up as my old pentium
P75 with RedHat 4.2 :
[root@tinker init.d]# grep sleep * | wc -l
31
[root@tinker init.d]#
So booting might at least take 30 seconds extra due to sleep commands.
One might check /etc/init.d/functions where the sleep command is used
inside a loop! Why not use the usleep command? This command uses a
microsecond as its time unit instead of a whole second. My solution would
be to replace all sleep shell scripting commands with usleep and put 2 or
3 zeros behind the number of seconds . so one would replace :
sleep 1 ==> usleep 1000
1 second ===> 1 msec
Your Linux machine and its scripts might boot/run a 1000 times faster
after this.
Robert
(
Log in to post comments)