Optimizing Services


One of the most basic (and most frequently overlooked) tasks in optimizing the performance of a Linux system is to scrutinize the services it's running. Put very simply, the more services you have running, the slower the system will perform.

SUSE Linux is a true multitasking operating system. It's capable of running many process at the same time on a single CPU. However, the process of suspending one running process and running another one places a heavy load on the system CPU. The more times this happens, the slower the system runs. You can monitor how frequently this happens using the vmstat utility from the shell prompt. Sample output from vmstat is shown in Figure 32.1.

Figure 32.1. Using vmstat to view system performance.


Notice under the System heading that there are two columns: in and cs. The in column displays the number of interrupt requests (either hardware or software generated) the CPU has processed each second. The cs column displays the number of context switches the CPU has had to deal with each second.

Note

An interrupt is a signal received by the CPU indicating that something (usually hardware) in the system needs its attention. A context switch occurs when the CPU has to suspend one running process and run another. Both of these events are CPU intensive.


A certain number of these events is unavoidable. For example, every time you move the mouse or type a key on the keyboard, you generate an interrupt request. However, the number of these events, especially context switches, can be reduced by running only those services that you actually need.

When your system was installed, the installation program made many assumptions about what services should be automatically run at boot. Most of these services are necessary for your system to run properly. However, some of them aren't. To see what's running on your system, open YaST and navigate to the System, System Service (runlevel) module, as shown in Figure 32.2.

Figure 32.2. Viewing services configuration in YaST.


For example, notice in Figure 32.2 that the Postfix MTA (Mail Transfer Agent) is configured to automatically start at runlevels 3 and 5. Postfix is a popular email daemon that is widely implemented by many organizations to provide a powerful mail solution.

However, on your personal SUSE Linux system, there's a pretty good chance that you don't need it, especially if you're using an external ISP for email services. In this case, you can stop the Postfix MTA and configure it to not start at boot, thereby reducing the load on your CPU. In this example, you can stop the service by entering rcpostfix stop at the shell prompt. Then you can use the Runlevel Editor in YaST to disable Postfix at boot.

Caution

Don't get too carried away shutting down services. You might be tempted to stop services that you don't recognize. Most of these services actually are needed for your system to run properly. Only disable a service after you have thoroughly researched what it does and are confident that it isn't required.




SUSE Linux 10 Unleashed
SUSE Linux 10.0 Unleashed
ISBN: 0672327260
EAN: 2147483647
Year: 2003
Pages: 332

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net