Contents
Abstract
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 server's speed. The number of active services and the way routine tasks are scheduled also affects performance.
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
step during the installation. See Раздел “Installation Settings” (Глава 1, Installation with YaST, ↑Содержание) for details.Depending on the server's range of applications 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 partition 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
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 maintain 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:
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.
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.
This pattern is only needed when you want to print from the machine.
A running X Window system eats up many resources 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.
The default installation starts a number of services (the number varies with the installation scope). Since each service consumes resources, it is recommended to disable the ones not needed. Run
+ + + 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 dropdown to disable the service for the running session. To permanently disable it, use the drop-down.The following list shows services started after a default installation of openSUSE that may not be needed:
Loads the Advanced Linux Sound System. Disable if you do not need sound.
A daemon for the audit system. Disable if you do not use Audit.
Handles cold plugging of Bluetooth dongles. Disable if you do not have Bluetooth.
A printer daemon. Disable if you do not have access to a printer.
Enables the execution of *.class or *.jar Java programs. Disable if you do not run Java applications.
Services needed to mount NFS file systems. Disable if not needed.
Services needed to mount SMB/CIFS file systems from a Windows server. Disable if not needed.
Shows the splash screen on start-up. Usually not needed on a server
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.
openSUSE ships with a number of different file systems, including BrtFS, Ext3, Ext2, ReiserFS, and XFS. Each file system has its own advantages and disadvantages.
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
.
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 network 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 dialog when editing or adding a partition with the
YaST Partitioner.
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:
A process from the idle scheduling class is only granted disk access, when no other process has asked for disk I/O.
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.
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.