HOWTO: Speeding up Debian

Share your own howto's etc. Not for support questions!

HOWTO: Speeding up Debian

Postby Lou » 2007-04-19 16:37

The purpose of this exercise is to make Debian faster by editing some files
and saving resources. The first thing you should do,
if possible, is to add RAM to your pc, it works wonders.

I did a minimal installation and installed my favorite window manager:
IceWM.

Other window managers (fluxbox, openbox, blackbox, windowmaker) are
excellent and will acomplish the job, XFCE4 is great too. Window managers
weigh one hundreth of what a desktop environment like Gnome or KDE weighs,
by doing a minimal installation you only install what you need, and avoid
the avalanche of apps that you never use. The less crud you got installed,
the less bugs, and the less complications will arise, thus, the KISS protocol:

Keep It Simple, Stupid.

BOOTING

The first thing i did was to edit the grub menu.lst:

$ sudo nano /boot/grub/menu.lst

once there, i edited the line that deals with the color of the booting menu.

***********************************************************************
# Pretty colours
#color cyan/blue white/blue
***********************************************************************
You can comment the second line (i deleted both lines), this will change
the color to the default white, if you dual boot, this will save resources.

If like me you only use Linux, and have no other OS, change the timeout line
to zero, this will save you 5 seconds of the booting time.

Example:
***********************************************************************
## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the
default entry
# (normally the first entry defined).
timeout 0
***********************************************************************

I installed the package 'sysvconfig' and launched from the terminal as root:

$ sudo sysvconfig <Enter>

I chose Enable/Disable and pressed OK.

WARNING: here we are going to disable boot processes, the less processes,
the faster it boots. This is a very SUBJECTIVE matter, every user has
different needs. Myself, i don't belong to a LAN, nor do i need complex
configuration, i just navigate the internet, e-mail, write articles, etc.
So do accordingly, i wrote down which processes i disabled, in case of any
problems, i could launch sysvconfig again and enabled them.

I disabled:

ifupdown
networking
openbsd-inetd
rc.local

and left all the other default options as they were, obviously, i stayed
away from the ones that said: "Don't mess with this"

When i was finished, i pressed Enter and from the main menu, chose Quit, it
took me back to terminal.

XORG

Next, i edited the file /etc/X11/xorg.conf, and added these lines in the
Monitor section:

***********************************************************************
Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
Option "StandbyTime" "3" # Turn off screen in 3 minutes (DPMS)
Option "SuspendTime" "8" # Full hibernation in 8 minutes (DPMS)
Option "OffTime" "15" # Turn off DPMS monitor (DPMS)
EndSection
***********************************************************************
save/exit, this will save you resources with the monitor.

Next, i edited the file /etc/inittab and commented the TTYS except two, this
will save around 3 MB of RAM.


***********************************************************************
1:2345:respawn:/sbin/getty 38400 tty1
#2:23:respawn:/sbin/getty 38400 tty2
#3:23:respawn:/sbin/getty 38400 tty3
#4:23:respawn:/sbin/getty 38400 tty4
#5:23:respawn:/sbin/getty 38400 tty5
6:23:respawn:/sbin/getty 38400 tty6
***********************************************************************

Next, i edited /etc/fstab and left it looking like this:

***********************************************************************
# /etc/fstab: static file system information.
#
#
proc /proc proc defaults 0 0
/dev/hda1 / ext3 defaults,noatime,errors=remount-ro 1 1
/dev/hda9 /home ext3 defaults,noatime,nodev,nosuid 1 2
/dev/hda8 /tmp ext3 defaults,noatime,nosuid 1 2
/dev/hda5 /usr ext3 defaults 0 2
/dev/hda6 /var ext3 defaults,noatime 1 2
/dev/hda7 none swap sw 0 0
/dev/hdb /media/cdrom0 iso9660 ro,user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0
***********************************************************************

This article: (http://tinyurl.com/wurfw), explains the differences between
noatime, nodev, and nosuid and in what partitions you use them.

ENTERING THE X SYSTEM

$ nano .xinitrc

and i added the following lines:
***********************************************************************
#!/bin/sh


numlockx &
unclutter &

icewm
***********************************************************************
save/exit, you're back to the prompt, type 'startx'

$ startx <Enter>

And last, but not least, install NO wallpapers, icons, or put flying birds
in the desktop, it looks great but it sucks RAM, and slows you down.

I rebooted the box and clocked it:

Time elapsed on my machine (Sempron 2600/512 MB RAM):

POST -> startx: 23 seconds
startx -> icewm: 5 seconds
icewm -> opera: 2 seconds

If you know other tips to make Debian faster, please post them :D

Luis Lima aka Lou/macondo
19 April 2007
This was written with the editor jpico.
Last edited by Lou on 2007-04-25 18:59, edited 10 times in total.
Wheezy - Ratpoison - vimperator - no DM
KISS - Keep It Simple, Stupid
Lou
 
Posts: 1767
Joined: 2006-05-08 02:15
Location: Panama

Postby hash » 2007-04-19 17:10

compiling a custom kernel?

Its not as difficult as ppl generally believe,

viewtopic.php?t=4468

I havent used an off the shelf config in a long time, so not really sure how much it helps..have heard stories where it makes a lot of difference!

Lou's point about start up services is the first place to start, I remember some apple talk thing in default sarge which took forever.

Again, for ppl who never used anything other than GNOME/KDE, Just *try* a window manager once..you'll be surprised.

Not sure if these fit:
I use M2 (opera's email client), which prolly saves a bit of resources and starts faster than using a seperate app. (You always open a browser dont you?)
Disclaimer: Any errors/misstakes in spilling, glammer, tact, or fact are transmission errors
User avatar
hash
 
Posts: 160
Joined: 2007-04-14 05:59
Location: Vancouver, BC, Canada

Postby rathskunk » 2007-04-20 02:25

Compiling a custom kernel makes a booting speed difference. The trick is to unconfigure all the things you don't use but making sure you have the things you really need still.

If you compile into the kernel all the drivers needed to get the relevant partitions mounted then you can get away without using an initrd.

Also kernels compile much faster without having a lot of drivers configured.
rathskunk
 
Posts: 77
Joined: 2007-03-23 14:08
Location: Cambridge, Ontario, Canada

Postby rickh » 2007-04-20 03:23

macondo
19 April 2007
This was written with the editor jpico.
Does this mean that Lou and macondo are the same person?

********
This one is only peripherally related and certainly not Debian specific. It's about speeding up websurfing. Add thes lines to /etc/hosts

127.0.0.1 doubleclick.net
127.0.0.1 ad.doubleclick.net
127.0.0.1 ad.ca.doubleclick.net
127.0.0.1 adremote.timeinc.net
127.0.0.1 adsremote.scripps.net
127.0.0.1 a.as-us.falkag.net
127.0.0.1 interclick.com
127.0.0.1 a1.interclick.com
127.0.0.1 media.fastclick.net
127.0.0.1 network.realmedia.com127.0.0.1 doubleclick.net

Of course this will keep you from seeing a lot of groovy advertising.
Debian-Lenny/Sid 32/64
Desktop: Generic Core 2 Duo, EVGA 680i, Nvidia
Laptop: Generic Intel SIS/AC97
User avatar
rickh
 
Posts: 3475
Joined: 2006-06-29 02:13
Location: Albuquerque, NM USA

Postby Xylock » 2007-04-20 10:14

heh rickh, I never thought of doing that , but damn haha. cant wait to get home and implement that baby :D (my dsl drops to dialup if I've gone over a certain cap for the month... and etch release put me over that after only 5 days :oops: I hate telecom.
Using rm -rvf * to remove old backups... lazy.
Realising you were in / as root ... priceless.
Xylock
 
Posts: 43
Joined: 2007-04-11 13:28

Postby Dargor » 2007-04-20 10:20

ah, that is sneaky, good thinking.
User avatar
Dargor
 
Posts: 671
Joined: 2006-08-14 08:54
Location: New Zealand, Hamilton

Postby morax » 2007-04-20 10:44

Thanks for some of these useful tips. :)
morax
 
Posts: 25
Joined: 2007-03-22 19:07
Location: Oppdal, NO

Postby Lou » 2007-04-20 12:37

rickh wrote:
macondo
19 April 2007
This was written with the editor jpico.
Does this mean that Lou and macondo are the same person?


Yes, sorry i'll fix this.
Wheezy - Ratpoison - vimperator - no DM
KISS - Keep It Simple, Stupid
Lou
 
Posts: 1767
Joined: 2006-05-08 02:15
Location: Panama

Postby soldierboy » 2007-04-20 14:18

Actually, KDE and Gnome can be quite light-weight if you don't install the main meta packages. I took the suggestion of others and installed the core and built on it from there and currently I have a Gnome desktop that only contains what I need or want. The downside to this approach is having to do some extra configuring for a few essential components (auto-mounting USB, time-sync, etc)
soldierboy
 
Posts: 28
Joined: 2007-04-19 04:56

Postby Lou » 2007-04-20 16:28

soldierboy wrote:Actually, KDE and Gnome can be quite light-weight if you don't install the main meta packages.


The thing is, it's still over 100 MB! That's not lightweight :(
Wheezy - Ratpoison - vimperator - no DM
KISS - Keep It Simple, Stupid
Lou
 
Posts: 1767
Joined: 2006-05-08 02:15
Location: Panama

Postby Bulkley » 2007-04-20 22:30

Thanks for this Lou. I will be adopting some of it.

Another help is "orphaner --purge". Orphaner will look for no-longer used files which can be safely deleted. Do this after an upgrade.

I go through my package list and look for "transition" packages. Again, these can be safely removed. I also get rid of programs that I have not used for a very long time. As I have been using the same installation for about six years, this is important.
Bulkley
 
Posts: 4022
Joined: 2006-02-11 18:35

Postby soldierboy » 2007-04-21 00:32

Bulkley wrote:Thanks for this Lou. I will be adopting some of it.

Another help is "orphaner --purge". Orphaner will look for no-longer used files which can be safely deleted. Do this after an upgrade.

I go through my package list and look for "transition" packages. Again, these can be safely removed. I also get rid of programs that I have not used for a very long time. As I have been using the same installation for about six years, this is important.


Another is deborphan which does the same. My favorite is localepurge though, gets rid of all of the unnecessary locale files that get installed with packages. It's great to see it happen too cause it does it right after you install a package.
soldierboy
 
Posts: 28
Joined: 2007-04-19 04:56

Postby Lou » 2007-04-21 01:11

soldierboy wrote:Another is deborphan which does the same. My favorite is localepurge though, gets rid of all of the unnecessary locale files that get installed with packages. It's great to see it happen too cause it does it right after you install a package.


Still another way to dispose orphaned packages is:

$ sudo wajig purge-orphans

as for localepurge, it is superb, it knocks off 40-50 MB of unused locales the first time around :lol:
Last edited by Lou on 2007-04-25 19:00, edited 1 time in total.
Wheezy - Ratpoison - vimperator - no DM
KISS - Keep It Simple, Stupid
Lou
 
Posts: 1767
Joined: 2006-05-08 02:15
Location: Panama

Postby Lou » 2007-04-21 01:24

I forgot to clock the shutdown process, apologies.

Shutdown: 8 seconds
Wheezy - Ratpoison - vimperator - no DM
KISS - Keep It Simple, Stupid
Lou
 
Posts: 1767
Joined: 2006-05-08 02:15
Location: Panama

Postby Hevoos » 2007-04-21 11:16

What does these things do:
openbsd-inetd
rc.local ?

How do I install and use localpurge? Apt-get clean is also a great thing to do. ;)
User avatar
Hevoos
 
Posts: 69
Joined: 2007-03-30 18:04

Next

Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable
cron