Chapter 9. General System Resource Management

Contents

9.1. Planning the Installation
9.2. Disabling Unnecessary Services
9.3. File Systems and Disk Access

Tuning the system is not only about optimizing the kernel or getting the most out of your application, it begins with setting up a lean and fast system. The way you set up your partitions and file systems can influence the servers speed. The number of active services and the way routine tasks are scheduled also affects performance.

9.1. Planning the Installation

A carefully planned installation ensures that the system is basically set up exactly as you need it for the given purpose. It also saves considerable time when fine tuning the system. All changes suggested in this section can be made in the Installation Settings step during the installation. See Section “Installation Settings” (Chapter 1, Installation with YaST, ↑Reference) for details.

9.1.1. Partitioning

Depending on the server's range of application and the hardware layout the partitioning scheme can influence the machine's performance (although to a lesser extend only). It is beyond the scope of this manual to suggest different partion schemes for particular workloads, however, the following rules will positively affect performance. Of course they do not apply when using an external storage system.

  • Make sure there always is some free space available on the disk, since a full disk has got inferior performance

  • Disperse simultaneous read and write access onto different disks by, for example:

    • using separate disks for the operating system, the data, and the log files

    • placing a mail server's spool directory on a separate disk

    • distributing the user directories of a home server between different disks

9.1.2. Installation Scope

Actually, the installation scope has no direct influence on the machine's performance, but a carefully chosen scope of packages nevertheless has got advantages. It is recommended to install the minimum of packages needed to run the server. A system with a minimum set of packages is easier to mainatain and has got less potential security issues. Furthermore, a tailor made installation scope also ensures no unnecessary services are started by default.

openSUSE lets you customize the installation scope on the Installation Summary screen. By default, you can select or remove preconfigured patterns for specific tasks, but it is also possible to start the YaST Software Manager for a fine-grained package based selection.

One or more of the following patterns selected for installation by default may not be needed in all cases:

GNOME Desktop Environment

A server seldomly needs a full-blown desktop environment. In case a graphical environment is needed, a more economical solution such as as icewm or fvwm may also be sufficient.

X Window System

When solely administrating the server and its applications via command line, consider to not install this pattern. However, keep in mind that it is needed to run GUI applications from a remote machine. If your application is managed by a GUI or if you prefer the GUI version of YaST, keep this pattern.

Print Server

This pattern is only needed when you want to print from the machine.

9.1.3. Default Runlevel

A running X Window system eats up many ressources and is seldomly needed on a server. It is strongly recommended to start the system in runlevel 3 (Full multi-user with network, no X). You will still be able to start graphical applications from remote or use the startx command to start a local graphical desktop.

9.2. Disabling Unnecessary Services

The default installation starts a number of services (the number varies with the installation scope). Since each service consumes ressources, it is recommended to disable the ones not needed. Start YaST+System+System Services (Runlevel)+Expert Mode to start the services management module. When using the graphical version of YaST you can click on the column headlines to sort the service list. Use this to get an overview of which services are currently running or which services are started in the server's default runlevel. Mark a service with the mouse to see its description. Use the Start/Stop/Refresh dropdown to disable the service for the running session. To permanently disable it, use the Set/Reset drop-down.

The following list shows services started after a default installation of openSUSE that may not be needed:

alsasound

Loads the Advanced Linux Sound System. Disable if you do not need sound.

auditd

A daemon for the audit system. Disable if you do not use Audit.

bluez-coldplug

Handles coldplugging of bluetooth dongles. Disable if you do not have bluetooth.

cups

A printer daemon. Disable if you do not have acces to a printer.

java.binfmt_misc

Enables the execution of *.class or *.jar Java programs. Disable if you do not run Java applications.

nfs

Services needed to mount NFS file systems. Disable if not needed.

smbfs

Services needed to mount SMB/CIFS file systems from a Windows server. Disable if not needed.

splash / splash_early

Shows the splash screen on start-up. Usually not needed on a server

9.3. File Systems and Disk Access

Hard disks are the slowest components in a computer system and therefore often the cause for a bottleneck. Using the file system that best suits your workload helps to improve performance. Using special mount options or prioritizing a process' I/O priority are further means to speed up the system.

9.3.1. File Systems

openSUSE ships with a number of different file systems, including Ext3, Ext2, ReiserFS, and XFS. Each file system has its own advantages and disadvantages.

9.3.1.1. NFS

NFS (Version 3) tuning is covered in detail in the NFS Howto at http://nfs.sourceforge.net/nfs-howto/. The first thing you should experiment with when mounting NFS shares is increasing the read write blocksize to 32768 by using the mount options wsize and rsize.

9.3.2. Disabling Access Time (atime) Updates

Whenever a file is read on a Linux file system, its access time (atime) is updated. As a result, each read-only file access in fact causes a write. On a journaling file system it is even two write operations since the journal will be updated, too. It is recommended to turn this feature off when you do not need to keep track of access times. This is possibly true for file and Web servers as well as for a netwok storage.

To turn off access time updates, mount the file system with the noatime option. To do so, either edit /etc/fstab directly, or use the Fstab Options dialog when editing or adding a partition with the YaST Partitioner.

9.3.3. Prioritizing Disk Access with ionice

The ionice command lets you prioritize disk access for single processes. This enables you to give less I/O priority to non time-critical background processes with heavy disk access such as backup jobs. On the other hand ionice lets you raise I/O priority for a specific process to make sure this process has always immediate access to the disk. You may set the following three scheduling classes:

Idle

A process from the idle scheduling class is only granted disk access, when no other process has asked for disk I/O.

Best effort

By default, every process will be granted I/O priority from this class. Priority within this class can be adjusted to a level from 0 to 7 (with 0 being the highest priority). By default, a process will be granted a priority corresponding to their CPU nice level.

Real-time

Processes in this class are always granted disk access first. Fine-tune the priority level from 0 to 7 (with 0 being the highest priority). Use with care, since it can starve other processes.

For more details and the exact command syntax refer to the ionice(1) man page for ionice.