Linux performance tips
To improve performance, especially on an under-powered personal
workstation.
These were done on RedHat Fedora.
- Turn off unneeded services/daemons.
Use 'ntsysv' or the gnome desktop Main menu->System Settings->Server Settings->Services to deselect services. The services you need:
- anacron (runs scheduled jobs)
- iptables (only if you want a personal firewall)
- network (only if you want to connect to a network)
- pcmcia (only if you use the PC card slot)
- random (it's recommended but maybe unnecessary). Update: gone from
Fedora 3.
- syslog (for logging, I don't know if it's required). messagebus
also needed.
- cpuspeed (to slow down CPU on laptop).
- readahead (pre-loads config files)
- acpid (for power management, laptops only? really needed?)
- xfs (X won't start without it)
ntsysv doesn't kill running services, it's selections take effect the
next boot. The gnome Service Configuration can also terminate running
services. KDE has a similar app.
Manually deselecting services: delete the Snnservice file in
/etc/rc.d/rc5.d/
Manually stopping service process:
/etc/rc.d/init.d/service_name stop
- Run scheduled tasks less frequently.
cron/anacron runs scheduled
jobs based on files in /etc/cron.daily/. The worst is the slocate.cron
file which builds a database of all files and typically starts soon
after you've booted and ties up the disk for many minutes. This doesn't need daily
running on a personal system; move the file to the cron.weekly or even
cron.monthly directory:
mv /etc/cron.daily/slocate.cron /etc/cron.weekly/
-
Let the prelink scheduled job run. prelink does some manipulation
with the shared libraries so they load faster, thus programs start
faster.
-
Reduce the number of mingetty terminals from 6 to 1 or 0.
mingetty is
a virtual text-mode terminal. Accessible by ctrl-alt-f1
etc. (ctrl-alt-f7 is the X terminal). Not needed and unlikely to be
used.
To see their running processes:
ps aux | grep mingetty
will show six of them running (corresponding to ctrl-alt
f1-f6). If they're killed they come back. Need to edit /etc/inittab
and put a # in front of lines
1:2345:respawn:/sbin/mingetty tty1
Takes effect next boot.
-
Install more RAM.
-
Don't run a bloated desktop like gnome or kde.
Try the fvwm2 window
manager instead. It will have to downloaded (1.2MB RPM file plus the
9KB libstroke RPM) from
fvwm.org, installed (rpm -i fvwm.....), and configured
into the login setup. (I can't figure out how to use it with gdm so
this setup uses kdm.)
-
Edit /etc/X11/xdm/Xsession to add this as another choice in the case
statement after line 108:
fvwm)
exec -l $SHELL -c "$SSHAGENT /usr/share/apps/switchdesk/Xclients.fvwm"
;;
(Notice it's similar to the surrounding choices.)
-
Add a line to /etc/sysconfig/desktop
DISPLAYMANAGER="KDE"
-
Edit the /usr/share/apps/switchdesk/Xclient.fvwm file so that the
pathname in it is: /usr/bin/fvwm2 (i.e. remove the X11R6 component).
-
Kill the running gdm process. Or reboot.
fvwm can be configured to look better...
Fedora 3 provides xfce window manager instead. Version 4 is better
than the provided version 3 (menus, hotkeys can replace mousing, and can run xplanet on desktop).
-
Triage on extremely under-powered system: don't run X, run in
text-mode only.
'telinit 3' will switch to runlevel 3 which is
text-mode. Runlevel 5 is the default X-based mode. The line in
/etc/inittab that looks like:
id:5:initdefault:
controls which runlevel the system boots up in. Change the 5 to a 3
so subsequent boots are in runlevel 3 (text-mode only).
Can do anything non-graphical.
-
Recompile the kernel so it's lean and mean, tailored to your system's
hardware and applications. I don't know how much performance this adds.