For most operating systems, applications can either run when the user executes them or run in the memory as a daemon or service from the time the computer starts. Like any other software, these memory-resident programs require resources, both RAM and CPU.
Linux distributions are designed to run on a wide variety of hardware, from large enterprise servers to mobile phones. Because of this flexibility, many Linux distributions have a large quantity of services enabled by default. Several of them are not needed to run a server, and disabling them will free up resources and increase server performance.
Some of the services that are not needed on a server are:
X.org, X11, or just X – This provides the graphical interface for desktop computers. No only is this not needed, it is a big waste of resources and can even be a security risk.
BlueZ, Bluetooth – Another possible security risk and a program that is pretty useless on a server.
Wpa-supplicant – A wireless key program. Very few dedicated servers are connected wirelessly.
CUPS – Print server. A server does not need to print.
Avahi-daemon – Used for zeroconf network connections and not needed for a server.
NFS and Samba – Both are used for local networking and can be disabled.
On a Redhat-based server, disabling services can be accomplished through “setup”. As root, simply type “setup” from the command line. It will present you with a list of services. To disable one, select it and press the space bar to remove the star next to it.
On servers that do not have this graphical setup, you can use chkconfig. Run this from the command line:
/sbin/chkconfig --list | grep "3:on"
This will list currently running daemons. To disable a specific one, enter as root:
/sbin/chkconfig daemon-name off
Replace “daemon-name” with the name of the service you wish to disable.