Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

HOWTO: Speeding up Debian

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
Lou
Posts: 1739
Joined: 2006-05-08 02:15

HOWTO: Speeding up Debian

#1 Post by Lou »

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.
Devuan Jessie - IceWM - vimperator - no DM
KISS - Keep It Simple, Stupid

User avatar
hash
Posts: 159
Joined: 2007-04-14 05:59
Location: Vancouver, BC, Canada

#2 Post by hash »

compiling a custom kernel?

Its not as difficult as ppl generally believe,

http://forums.debian.net/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

rathskunk
Posts: 77
Joined: 2007-03-23 14:08
Location: Cambridge, Ontario, Canada

#3 Post by rathskunk »

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.

User avatar
rickh
Posts: 3434
Joined: 2006-06-29 02:13
Location: Albuquerque, NM USA

#4 Post by rickh »

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

Xylock
Posts: 42
Joined: 2007-04-11 13:28

#5 Post by Xylock »

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.

User avatar
Dargor
Posts: 653
Joined: 2006-08-14 08:54
Location: New Zealand, Hamilton

#6 Post by Dargor »

ah, that is sneaky, good thinking.

morax
Posts: 25
Joined: 2007-03-22 19:07
Location: Oppdal, NO

#7 Post by morax »

Thanks for some of these useful tips. :)

Lou
Posts: 1739
Joined: 2006-05-08 02:15

#8 Post by Lou »

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.
Devuan Jessie - IceWM - vimperator - no DM
KISS - Keep It Simple, Stupid

soldierboy
Posts: 28
Joined: 2007-04-19 04:56

#9 Post by soldierboy »

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)

Lou
Posts: 1739
Joined: 2006-05-08 02:15

#10 Post by Lou »

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 :(
Devuan Jessie - IceWM - vimperator - no DM
KISS - Keep It Simple, Stupid

Bulkley
Posts: 6383
Joined: 2006-02-11 18:35
Has thanked: 2 times
Been thanked: 39 times

#11 Post by Bulkley »

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.

soldierboy
Posts: 28
Joined: 2007-04-19 04:56

#12 Post by soldierboy »

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.

Lou
Posts: 1739
Joined: 2006-05-08 02:15

#13 Post by Lou »

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.
Devuan Jessie - IceWM - vimperator - no DM
KISS - Keep It Simple, Stupid

Lou
Posts: 1739
Joined: 2006-05-08 02:15

#14 Post by Lou »

I forgot to clock the shutdown process, apologies.

Shutdown: 8 seconds
Devuan Jessie - IceWM - vimperator - no DM
KISS - Keep It Simple, Stupid

User avatar
Hevoos
Posts: 69
Joined: 2007-03-30 18:04

#15 Post by Hevoos »

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. ;)

Lou
Posts: 1739
Joined: 2006-05-08 02:15

#16 Post by Lou »

Hevoos wrote:What does these things do:
openbsd-inetd
rc.local ?
google.com/linux
How do I install and use localpurge? Apt-get clean is also a great thing to do. ;)
apt-get install localepurge
man localepurge
google for 'debian + localepurge'
search this forum for 'localepurge'
Devuan Jessie - IceWM - vimperator - no DM
KISS - Keep It Simple, Stupid

User avatar
Pobega
Posts: 833
Joined: 2007-01-04 04:30
Location: New York

#17 Post by Pobega »

Display manager: For those of you that find gdm is too slow for your system, may I recommend wdm? WDM is a very light display manager based on the WINGs widget set, and it blends with Window Maker (For those of you who use it). WDM has all the configuration options of GDM/KDM, though they're located in the /etc/X11/wdm folder and there are no graphical programs to configure them.

Speeding up boot: Although it's been mentioned before, one program that I use all of the time to speed up my system was completely left in the dust. sysv-rc-conf is a very useful program to switch what runs and what doesn't at different runlevels. The userface is the most simple console userface ever, navigate using the arrow keys and toggle the selected item with the space bar. Check out it's manual page, and read the documentation located at /usr/share/doc/sysv-rc-conf/README for more information on using sysv-rc-conf.

Lightweight file manager: Have you ever missed Nautilus? Well, pcmanfm is a file manager available in the Debian repositories that is a sure-fire way to relive your experiences with GNOME and Nautilus. PcManFM is a very fast and highly customizable file manager. It's user interface is like a hybrid between Thunar and Nautilus, and is quicker than the both of them.

Located in the file /usr/share/doc/pcmanfm/README.Debian is a HowTo on how to replace Nautilus with PcManFM in a GNOME environment; Very useful for those who want to speed up their install but can't live without GNOME!


That's all I have for now, although I'll definitely be posting back with more soon, when I remember everything I've done to tweak my system.
Jabber: pobega@gmail.com
Pronunciation: Poh - Bay - Guh

Lou
Posts: 1739
Joined: 2006-05-08 02:15

#18 Post by Lou »

Very good! Now you're talking!

Although, IMHO, you need a DM (display manager) like you need another hole in the head. 'update-alternatives' can take care of that, or a simple editing of the .xinitrc. DMs are heavy and can be a headache if badly configured.
But hey, that's only my opinion.
Devuan Jessie - IceWM - vimperator - no DM
KISS - Keep It Simple, Stupid

User avatar
Pobega
Posts: 833
Joined: 2007-01-04 04:30
Location: New York

#19 Post by Pobega »

Lou wrote:Very good! Now you're talking!

Although, IMHO, you need a DM (display manager) like you need another hole in the head. 'update-alternatives' can take care of that, or a simple editing of the .xinitrc. DMs are heavy and can be a headache if badly configured.
But hey, that's only my opinion.
I don't use a DM myself, but if I'm helping a friend customize an install on an older computer I usually lean towards WDM; It is as lightweight as XDM, without having to spend hours configuring it, and it comes with all of the options of GDM.
Last edited by Pobega on 2007-04-21 19:50, edited 1 time in total.
Jabber: pobega@gmail.com
Pronunciation: Poh - Bay - Guh

pcalvert
Posts: 1939
Joined: 2006-04-21 11:19
Location: Sol Sector
Has thanked: 1 time
Been thanked: 2 times

#20 Post by pcalvert »

Pobega wrote: I don't use a DM myself, but if I'm helping a friend customize an install on an older computer I usually learn towards WDM; It is as lightweight as XDM, without having to spend hours configuring it, and it comes with all of the options of GDM.
I tried WDM on Sarge, but didn't like it. For one thing, it had a clunky feel to it; but the main reason is that I didn't see any option that would allow me to drop to a console instead of starting a window manager.

Phil

Post Reply