LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-13-2007, 11:21 PM   #46
XGizzmo
Member
 
Registered: Mar 2007
Distribution: Slackware
Posts: 264

Rep: Reputation: 69

Fantastic, I am glad we got this solved all thought I wish I could get it to work with lilo but thats just me I hate loose ends.
 
Old 03-14-2007, 02:31 PM   #47
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928

Original Poster
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Maybe you can try the 'compact' option in lilo.conf ? Technically it doesn't always work. Either way, I installed grub on my desktop too and it boots in 29 sec (saved 2 sec off lilo boot time of 31 sec). (now, my desktop is much more powerful than the old laptop)
 
Old 03-14-2007, 03:55 PM   #48
General Failure
Member
 
Registered: Jan 2007
Location: Germany
Distribution: Slackware 13.37
Posts: 387

Rep: Reputation: 37
I don't wanna go off topic, but...

I have to
Quote:
Originally Posted by H_TeXMeX_H
In fact I rarely ever use more than 45-50 MB or RAM ... ever.
Is this a console only machine or how do you get that done?

I btw second duryodhans suggestions concerncing rc-scripts. These fellers can save you some more boot time if you tweak them a little. You for example don't need fontconfig on boot time unless you just installed fonts, you could disable cron and atd and so forth...
 
Old 03-14-2007, 06:16 PM   #49
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928

Original Poster
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Well my RAM usage varies with what I'm doing. With fluxbox running, it's usually between 22-50 MB (usually just watching movies, viewing images) unless I run firefox ... like now ... and then it's 90 MB (at this very moment) or up to 100 MB or so if I visit many pages and use it for hours. If I open lots of stuff, it might go above 100 MB, but usually no. Now I restarted FF and it's down to 59 MB used. Games also use more memory. Scanned images can take all my RAM (1 GB).

Either way, 90 % of the time, when I check RAM usage it is under 100, or slightly above.

Last edited by H_TeXMeX_H; 03-14-2007 at 06:26 PM.
 
Old 03-16-2007, 02:12 PM   #50
General Failure
Member
 
Registered: Jan 2007
Location: Germany
Distribution: Slackware 13.37
Posts: 387

Rep: Reputation: 37
Looks like you've been quite successful in tweaking your machine... Would you mind posting your ps aux and/or sum up a little bit what you did? This might be a nice howto I suppose some people would be interested in (including me as you already noticed )
 
Old 03-16-2007, 03:14 PM   #51
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928

Original Poster
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Ok, here's what I did:

1. Optimize scripts in '/etc/rc.d'

a) disable gpm, so just re-title
Code:
mv rc.gpm rc.gpm-sample
this way you can still execute it when you need it. You could also make it non-executable if you want.

b) disable hotplug, so
Code:
chmod a-x rc.hotplug
this should work just fine for most people running the 2.6.x kernels, but if you have trouble, just make it executable again.

c) modify 'rc.inet1' if you use dhcp as follows:
Code:
113,114c113,114
<         echo "/etc/rc.d/rc.inet1:  /sbin/dhcpcd -d -t ${DHCP_TIMEOUT[$i]:-60} ${DHCP_OPTIONS} ${1} &" | $LOGGER
<         /sbin/dhcpcd -d -t ${DHCP_TIMEOUT[$i]:-60} ${DHCP_OPTIONS} ${1} &
---
>         echo "/etc/rc.d/rc.inet1:  /sbin/dhcpcd -d -t ${DHCP_TIMEOUT[$i]:-60} ${DHCP_OPTIONS} ${1}" | $LOGGER
>         /sbin/dhcpcd -d -t ${DHCP_TIMEOUT[$i]:-60} ${DHCP_OPTIONS} ${1}
That's the output of 'diff' on the two files. Basically just add the '&' in those places, that way booting will continue without waiting for dhcpcd to finish getting an IP ... which can take a really long time.

d) modify 'rc.M' as follows:
Code:
128a129,140
> # Update all the shared library links:
> if [ -x /sbin/ldconfig ]; then
>   echo "Updating shared library links:  /sbin/ldconfig"
>   /sbin/ldconfig
> fi
> 
> # Update the X font indexes:
> if [ -x /usr/X11R6/bin/fc-cache ]; then
>   echo "Updating X font indexes:  /usr/X11R6/bin/fc-cache"
>   /usr/X11R6/bin/fc-cache
> fi
> 
189,193c201,205
< #if [ -x /sbin/accton -a -r /var/log/pacct ]; then
< #  /sbin/accton /var/log/pacct
< #  chmod 640 /var/log/pacct
< #  echo "Process accounting turned on."
< #fi
---
> if [ -x /sbin/accton -a -r /var/log/pacct ]; then
>   /sbin/accton /var/log/pacct
>   chmod 640 /var/log/pacct
>   echo "Process accounting turned on."
> fi
203,205c215,217
< #if [ -x /usr/sbin/atd ]; then
< #  /usr/sbin/atd -b 15 -l 1
< #fi
---
> if [ -x /usr/sbin/atd ]; then
>   /usr/sbin/atd -b 15 -l 1
> fi
So, basically, just comment out or delete those sections. I never use accton, and rc.M warns you that using it will result in a huge log file ... which I don't want. It is off by default, but I wanna make sure I also never use atd, so kill it.

e) Now, that first part from part 'd)' about 'Update all the shared library links' and 'Update the X font indexes' I copied to 'rc.local'. So 'rc.local' now contains:
Code:
#!/bin/sh

# Update all the shared library links:
if [ -x /sbin/ldconfig ]; then
  echo "Updating shared library links:  /sbin/ldconfig"
  /sbin/ldconfig
fi

# Update the X font indexes:
if [ -x /usr/X11R6/bin/fc-cache ]; then
  echo "Updating X font indexes:  /usr/X11R6/bin/fc-cache"
  /usr/X11R6/bin/fc-cache
fi

# Add anything else to be run at startup below this line !
This should be added at the very beginning of 'rc.local', put everything else you want to run at startup after these two commands. This is mostly in response to the concern that if "you want to start something in rc.local that uses libraries in a non-standard location" as gnashley states in another thread, 'ldconfig' must be run before these other programs run.

Also, to 'rc.M', put an '&' after the call to 'rc.local' to background the script, like this (at the bottom of rc.M)

Code:
# Start the local setup procedure.
if [ -x /etc/rc.d/rc.local ]; then
  . /etc/rc.d/rc.local &
fi
So, now it will not slow down the boot up process.

f) To 'rc.S' I added:
Code:
38,41d37
< # Boost HDD speed with hdparm
< echo "hdparm -c3 -m16 /dev/hda"
< /usr/sbin/hdparm -c3 -m16 /dev/hda
<
(that's from diff, so omit the '<'), also you need to know what is best for your HDD. I think -c3 should be ok for most HDDs. Read 'man hdparm'.
Also do:
Code:
hdparm -i /dev/hda
you'll get something like:
Code:
/dev/hda:

 Model=ST380023A, FwRev=3.33, SerialNo=3KB1BZNK
 Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs RotSpdTol>.5% }
 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4
 BuffType=unknown, BuffSize=2048kB, MaxMultSect=16, MultSect=16
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=156301488
 IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio1 pio2 pio3 pio4 
 DMA modes:  mdma0 mdma1 mdma2 
 UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5 
 AdvancedPM=no WriteCache=enabled
 Drive conforms to: ATA/ATAPI-6 T13 1410D revision 2:  ATA/ATAPI-1 ATA/ATAPI-2 ATA/ATAPI-3 ATA/ATAPI-4 ATA/ATAPI-5 ATA/ATAPI-6

 * signifies the current active mode
Check the 'MaxMultSect=16, MultSect=16', MaxMultSect is the maximum setting for '-m' option. Thus I run 'hdparm -c3 -m16 /dev/hda'. Again, read 'man hdparm'.

If know that you have no 'non-root file systems in fstab' to mount, and every time you boot it says "Mounting non-root local filesystems:" and then nothing was mounted, then you can probably also comment the following section out of rc.S:

Code:
# Mount non-root file systems in fstab, but not NFS or SMB 
# because TCP/IP is not yet configured, and not proc or sysfs
# because those have already been mounted.  Also check that
# devpts is not already mounted before attempting to mount
# it.  With 2.4.x kernels devpts is mounted from an fstab
# entry while with a 2.6.x or newer kernel udev mounts it.
# We also need to wait a little bit to let USB and other
# hotplugged devices settle (sorry to slow down the boot):
echo "Mounting non-root local filesystems:"
sleep 3
if /bin/grep -wq devpts /proc/mounts ; then
  /sbin/mount -a -v -t nonfs,nosmbfs,nocifs,noproc,nosysfs,nodevpts
else
  /sbin/mount -a -v -t nonfs,nosmbfs,nocifs,noproc,nosysfs
fi
NOTE: the above may not be safe for all setups ... try at your own risk. It works fine for me.

g) Make un-executable anything else in '/etc/rc.d' that you do not need.

2. Compile a new kernel. Here is a good guide:
http://www.kroah.com/lkn/

Personally, I did the following, which is applicable to pretty much everyone, first start with the generic kernel and work from there:

a) Search for the words 'not', 'found', 'no', and 'error' in 'dmesg', and take appropriate action ... removing what fails anyway.

b) disable 'pcspkr', unless you like annoying beeps every time you make an error. (disable raid/md if you don't use it)

c) make floppy a module rather than built-in (on some machines, this is the only way it will work)

d) Under 'Block layer -> IO Schedulers' read the help on all of them and see which one you think is best. IMO, best are CFQ for desktop, and deadline for database/server.

e) Under 'Processor type and features' make sure to select your processor, to enable/disable SMP if you have or don't have it, disable 'Generic x86 support' unless you're making your own distro, put max # CPUs (for multi-core), enable/disable hyperthreading for P4, enable/disable multi-core scheduler suppport, (disable local apic), read and choose 'Preemption Model' (Voluntary is good for desktop), enable/disable high memory support (if you have near 1GB RAM), and set timer frequency acordingly (1000 Hz for desktop), also to make gcc generate a smaller, faster kernel you can select 'use register arguments', but use it at your own risk ... it hasn't caused me problems.

f) don't forget to fully enable your filesystem

I think those are most important performance-wise, the rest is also important, but harder to get right The guide should help with that.

3. Install grub ... or maybe use lilo 'compact' option ? You choose. Grub is faster from what I can tell.

That's pretty much all I did. Tell me if there is something wrong or if I did something wrong

Last edited by H_TeXMeX_H; 09-27-2007 at 05:29 AM. Reason: modified 2. adding numbering and some info
 
Old 03-17-2007, 05:37 AM   #52
duryodhan
Senior Member
 
Registered: Oct 2006
Distribution: Slackware 12 Kernel 2.6.24 - probably upgraded by now
Posts: 1,054

Rep: Reputation: 46
Are you sure grub speeds the boot up time? did you read that somewhere? Any references?
 
Old 03-17-2007, 07:59 AM   #53
pdw_hu
Member
 
Registered: Nov 2005
Location: Budapest, Hungary
Distribution: Slackware, Gentoo
Posts: 346

Rep: Reputation: Disabled
Quote:
* Under 'Block layer -> IO Schedulers' read the help on all of them and see which one you think is best. I think Deadline looks to be very good. So I choose that one under 'Default I/O scheduler'. (the help says Anticipatory is slower that Deadline in most cases)
It also seemed to me that deadline is good, but actually it's far more slower than CFQ (which i use). Big noticeable differences while for ex. unrar-ing files, updatedb, etc. It might just be HDD dependent tho. I'd opt for 'trial-and-see-results' for I/O schedulers.

Apart from the tweaks H_TeXMeX_H mentioned, I also deleted (commenting out is enough, i just want to keep my initscripts clean) every stuff i don't need from the init scripts. (like cups or apache or etc.) These probably won't result in a faster boot time tho... I'm just too minimalist
 
Old 03-17-2007, 08:55 AM   #54
duryodhan
Senior Member
 
Registered: Oct 2006
Distribution: Slackware 12 Kernel 2.6.24 - probably upgraded by now
Posts: 1,054

Rep: Reputation: 46
why not the CFQ schedular .. the docs say its suitable for Desktops
 
Old 03-17-2007, 12:57 PM   #55
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928

Original Poster
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Quote:
Originally Posted by duryodhan
Are you sure grub speeds the boot up time? did you read that somewhere? Any references?
Yes, my old laptop is a decent reference ... it saved at least 15 sec of boot time. On my desktop it only saved 2 sec. Do some testing and see. Try the lilo compact option too.

As for CFQ, try it out. It might work better than deadline ... I never said deadline was better than CFQ ... I said deadline was better than anticipatory in many cases. Try them all out (if you have the time) and see which one is best. I edited my post to mention the presence of CFQ.

It is likely that CFQ might be better for a desktop and maybe deadline is better for a server or something.

Last edited by H_TeXMeX_H; 03-17-2007 at 01:00 PM.
 
Old 03-18-2007, 10:30 PM   #56
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928

Original Poster
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Just so you know, grub is also 2 sec faster on my new laptop ... 45 sec w/ lilo, 43 sec w/ grub.
 
Old 05-13-2007, 03:58 PM   #57
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928

Original Poster
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
I'm wondering what would be the best thing to do concerning 'ldconfig' ? I see at least three possibilities, and there have been many questions on this, so I'd like to have it right on here, so I don't mess things up for other ppl.

The main problem is, what if "you want to start something in rc.local that uses libraries in a non-standard location"

I think the best solution might be to put the '/sbin/ldconfig' command at the beginning of rc.local and background the call to rc.local in rc.M. That way if you run anything that uses libraries in a non-standard location from rc.local, ldconfig would be run first, and this problem would be solved. And, of course, it would not slow down your boot time.

Is that a good idea ?
 
Old 05-13-2007, 04:43 PM   #58
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
Why not
(or just run manually)
 
Old 05-13-2007, 04:49 PM   #59
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928

Original Poster
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Great, well I just tried it here on my computer and it seems to work great, everything runs in the right order. I'll make this change above.
 
Old 05-14-2007, 02:13 AM   #60
pdw_hu
Member
 
Registered: Nov 2005
Location: Budapest, Hungary
Distribution: Slackware, Gentoo
Posts: 346

Rep: Reputation: Disabled
I second Alien_Hominid's starting it manually approach. Why have it run everytime you boot the machine? You need to run it anyway if you install a new lib...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
what is the scripts in /etc/init.d for? blackzone Linux - General 7 09-06-2006 11:10 PM
starting named on boot without init scripts evilchild SUSE / openSUSE 1 03-05-2005 07:46 AM
Optimize boot process? on RedHat9.0 Forced2Morph Linux - General 1 10-12-2004 06:48 AM
X not starting on boot (init scripts) cootetom Mandriva 11 05-05-2004 08:37 AM
slack init scripts gui10 Slackware 11 05-15-2002 11:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration