LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 05-29-2005, 04:39 PM   #1
gunnix
Member
 
Registered: Apr 2004
Distribution: Arch, Debian and FreeBSD
Posts: 243

Rep: Reputation: 30
Optimizing boot speed


Hi, I'm trying to optimize debian's boot speed. Atm I'm trying to load as few modules as possible. But after booting up I always end up have ext3 ext2 fat vfat .. modules loaded (seen in lsmod). I don't have a need for those as I use reiserfs. I don't have them in my /etc/modules and I don't have discover or hotplug running at boot.

Why do those modules load ??



By the way, here's what I wrote on optimizing performance and boot time in debian (for those looking for some tips, guided by the topic..):


3.24 Speeding it up

The first 3 points can reduce boot time a lot. The other points can be tried but don't change that much in my experience.
Also read Tuning a debian system:
http://www.debian.org/doc/manuals/re...h-tune.en.html

3.24.1 Minimise modules loaded at startup

In /etc/modules. I have only five: the reiserfs module, Ethernet card driver module, sound card module, videocard module and mouse module.


3.24.2 Minimise services loaded at startup

A handy tool is rcconf or sysvconfig. I run only the necessary services.

3.24.3 Minimise startup script actions

/etc/rcS.d/ contains the startup scripts. I have taken away the script that runs portmapper, as also the script that restores nvi editor sessions. They are useless to me.
I also removed hotplug and discover scripts. Instead of letting those detect the modules needed I put all moduules I need in /etc/modules. To know which modules you need become root and type "lsmod". Then copy all those modules running to /etc/modules. But it has to be in the reversed order, so the one at the bottom of the lsmod list should be at the top of /etc/modules.


3.24.4 noatime

Whenever a file is accessed in Linux, the current time and date are recorded. This is not usually needed, and you can gain a small amount of speed (which won't show up using hdparm -Tt) by disabling this option. This is done by editing your /etc/fstab file, and where on your hard drive line it says defaults, change it to defaults,noatime.


3.24.5 dash

Install dash (it was named ash before). Make /bin/sh a simlink to /bin/dash. Normally it's linked to bash, which is slower. /bin/sh is the shell used to start up and shutdown the computer. Using dash will make it faster.
You can also make dash your user shell with 'chsh'. That will save some more ram, but I advice you then to use bash in [xae]term/rxvt. For example: 'aterm -e bash'. Dash is no good interactive shell.


3.24.6 /etc/inittab

Change the number of virtual consoles from 6 to 2 by adding a # in front of the lines.
Here you can also change CTRL+ALT+DELETE behaviour to shut the pc down instead of rebooting (if you'd ever want to).
 
Old 05-29-2005, 05:16 PM   #2
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,530

Rep: Reputation: 178Reputation: 178
" Why do those modules load ??"

The modules that load unexpectedly may be dependencies of the modules that you have asked to load. Look in /lib/modules/kernel-name/modules.dep and see if ext3, ext2, fat, and vfat are dependencies of some of the modules that you have listed to be loaded.

-------------------
Steve Stites

Last edited by jailbait; 05-29-2005 at 05:27 PM.
 
Old 05-29-2005, 05:39 PM   #3
gunnix
Member
 
Registered: Apr 2004
Distribution: Arch, Debian and FreeBSD
Posts: 243

Original Poster
Rep: Reputation: 30
thx for your reply

These are the only modules I load in /etc/modules:
reiserfs
snd_cmipci
sis900
psmouse
radeon


And they don't depend on ext3 or ext2.

grtz
 
Old 05-29-2005, 07:00 PM   #4
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 46
Quote:
And they don't depend on ext3 or ext2.
$ dict -d math transitive
 
Old 05-29-2005, 07:32 PM   #5
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,530

Rep: Reputation: 178Reputation: 178
gunnix,

Nowhere in your post do you mention initrd. Are you using an initrd? If so, are the unnecessary modules loaded by initrd?

----------------------------
Steve Stites
 
Old 05-30-2005, 05:24 AM   #6
gunnix
Member
 
Registered: Apr 2004
Distribution: Arch, Debian and FreeBSD
Posts: 243

Original Poster
Rep: Reputation: 30
I have no clue whether an initrd starts it or not. I'm using a generic kernel (2.6.8-13). I would not understand why it for example would load fat modules by default.

In dmesg I find these entries:
VFS: Can't find ext3 filesystem on dev hda1.
VFS: Can't find ext2 filesystem on dev hda1.
FAT: bogus number of reserved sectors
VFS: Can't find a valid FAT filesystem on dev hda1.

I guess VFS is part of the kernel. And it probably loads the ext3, ext2, fat modules, when I look at what it says in dmesg.
So then I'll probably just have to start recompiling a kernel?

grtz

Last edited by gunnix; 05-30-2005 at 05:42 AM.
 
Old 05-30-2005, 06:32 AM   #7
samael26
Member
 
Registered: Oct 2004
Location: France, Provence
Distribution: Debian
Posts: 848

Rep: Reputation: 30
I noticed a significant increase of speed by setting the "swappiness" to 10 instead of the standard 60.

the value you must have is :

cat /proc/sys/vm/swappiness = 60

set it to :

# sysctl -w vm.swappiness=10

It will be much faster.

cheers
EDIT : provided you run a 2.6 kernel (does not exist for 2.4)

Last edited by samael26; 05-30-2005 at 06:36 AM.
 
Old 05-30-2005, 06:36 AM   #8
McCloud
Member
 
Registered: Sep 2004
Distribution: Debian Etch
Posts: 179

Rep: Reputation: 30
Linux Virtual File System

You are writing a document about optimization and you haven't even recompiled your kernel.

That's the first thing where you can get some speed improvement. Compile only the necessary stuff, compile necessary modules directly into the kernel, etc.

Also, why would you manually remove startup-scripts when you can turn them off using rc-conf (or sysv-rc-conf)???
 
Old 05-30-2005, 07:32 AM   #9
gunnix
Member
 
Registered: Apr 2004
Distribution: Arch, Debian and FreeBSD
Posts: 243

Original Poster
Rep: Reputation: 30
Nah I just wrote how I install debian on my webpage and there's a small part about optimizing. I know it's funny but I haven't recompiled my kernel yet, shame on me

I'm gonna recompile now

I also just found out about sysv-rc-conf, it's great

I also just changed that swappyness to 10. What would be faster by doing that?

grtz

Last edited by gunnix; 05-30-2005 at 07:39 AM.
 
Old 05-30-2005, 08:15 AM   #10
comptiger5000
Member
 
Registered: May 2005
Distribution: Fedora Core Since version 3
Posts: 193

Rep: Reputation: 30
it will swap less data to disk, and use more ram, and it will be faster because ram is usually faster than swap
 
Old 05-30-2005, 09:03 AM   #11
Dead Parrot
Senior Member
 
Registered: Mar 2004
Distribution: Debian GNU/kFreeBSD
Posts: 1,597

Rep: Reputation: 46
Andrew Morton, the 2.6 kernel maintainer, says he sets swappiness to 100 on his desktop machines. http://kerneltrap.org/node/3000
 
Old 05-30-2005, 09:45 AM   #12
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,530

Rep: Reputation: 178Reputation: 178
"I have no clue whether an initrd starts it or not. I'm using a generic kernel (2.6.8-13). "

Look in your bootloader configuration file to see if the line for your generic kernel (2.6.8-13) specifies an initrd. If you are using grub the configuration file is /boot/grub/menu.lst. If you are using lilo the file is /etc/lilo.conf.


-----------------------------
Steve Stites
 
Old 05-31-2005, 10:24 AM   #13
gunnix
Member
 
Registered: Apr 2004
Distribution: Arch, Debian and FreeBSD
Posts: 243

Original Poster
Rep: Reputation: 30
After recompiling the kernel I haven't got ext2, ext3 or fat loading as modules. Great

But it doesn't boot faster, maybe a bit slower, my kernel probably sucks

grtz
 
Old 05-31-2005, 02:11 PM   #14
thegeekster
Member
 
Registered: Dec 2003
Location: USA (Pacific coast)
Distribution: Vector 5.8-SOHO, FreeBSD 6.2
Posts: 513

Rep: Reputation: 33
Re: Optimizing boot speed

Quote:
Originally posted by gunnix
Hi, I'm trying to optimize debian's boot speed. Atm I'm trying to load as few modules as possible. But after booting up I always end up have ext3 ext2 fat vfat .. modules loaded (seen in lsmod). I don't have a need for those as I use reiserfs. I don't have them in my /etc/modules and I don't have discover or hotplug running at boot...
Usually it's a good idea to be able to access those types of filesystems whenever the occasion calls for it, like reading floppy disks that may be using one of those filesystems (dos-formatted floppies come to mind here)............I mainly use reiserfs (except for my /boot partition which is ext2), but like to be able to access the more common Linux and Windows filesystems if necessary............
 
Old 06-03-2005, 01:06 PM   #15
gunnix
Member
 
Registered: Apr 2004
Distribution: Arch, Debian and FreeBSD
Posts: 243

Original Poster
Rep: Reputation: 30
Yea, but those filesystem modules get automaticly loaded when I need them. There was no point in having them load at boot time.

Anyway, boot time still is much slower then FreeBSD's. I probably have to look into those start up scripts some more.

grtz
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Optimizing drive speed linuxhippy Fedora 10 07-22-2005 05:00 AM
optimizing drive speed with raid linuxhippy Fedora 5 07-22-2005 04:59 AM
How to speed-up boot process? registering Mandriva 4 04-21-2005 02:21 AM
question on optimizing fedora 2 CFLAGS to speed up programs opioid Linux - Software 1 11-21-2004 09:58 AM
how to speed up the boot time? taoweijia Fedora 4 07-07-2004 08:01 AM


All times are GMT -5. The time now is 03:02 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration