Before installing Linux on the system, there are several things worth considering that might help optimize the performance of the operating system and the applications that run on it later. These areas include the following:
* Placing partitions
* Using multiple hard drives
* Selecting file systems
* Converting file systems
* Configuring RAID
Partition Placement
At a minimum, Linux requires a root and a swap partition. Where these and other frequently accessed partitions reside on disks ultimately impacts system performance. Following are some of the recommendations for placement of the root, swap, and other frequently accessed partitions that take advantage of the disk geometry:
* Use separate partitions for root, swap, /var, /usr, and /home.
* Most drives today pack more sectors on the outer tracks of the hard drive platter than on the inner tracks, so it's much faster to read and write data from the outer tracks. Lower-numbered partitions are usually allocated at the outer tracks (for example, /dev/hda1 is closer to the drive's outer edge than /dev/hda3), so place partitions that require frequent access first.
* The first partition should be the swap partition (to optimize memory swap operations).
* The next partition should be /var because log entries are frequently written to /var/log.
* The next partition should be /usr, because base system utilities and commands are placed in /usr.
* The root and /home partitions can reside near the end of the drive.
Now that we have considered how best to place the most frequently used partitions on a hard drive, we will look at how to take advantage of your multiple hard drivesif you have more than one in your system.
Using Multiple Hard Drives
Most systems today have more than one hard drive. If your system has only one drive, and if performance is really important to you (which is why you are reading this book in the first place!), you may need to seriously consider adding more drives to your system to improve performance. To take full advantage of multiple drives, you'll need to do the following:
* Place frequently accessed partitions on the faster drives.
* If the drives are relatively equal in performance, place frequently used partitions on alternate drives. For example, place /var on one drive and /usr on another drive. The swap partition should be on its own drive.
* Consider using RAID if you have multiple drives with relatively equal performance. (This will be discussed in more detail later.)
* Place each drive as the master device on its own I/O channel (for example, IDE) to maximize bus throughput. You will need to modify the file system table (/etc/fstab) after moving drives across I/O channels because the device name will change. If the drive contains the root or /boot partition, you need to edit the grub /boot/grub/menu.lst file as well.
When using multiple hard drives, you need to make some decisions in modifying the file system table. In the next section, we'll discuss selecting file systems.
Selecting File Systems
In addition to the original ext2 file system, new enterprise Linux distributions, such as RHEL 3, RHEL 4, and SLES 9, also support journaled file system technology, such as ext3 and ReiserFS. XFS is also included in several Linux distributions but may not be fully supported. Table 1.1 shows the general advantages and disadvantages of each type of file system.
Table 1.1. File System Types
File System Type Comment
ext3 Easy to upgrade from existing ext2 file system
ReiserFS Best performance with small files; fully supported by major enterprise distributions
XFS Best performance, especially with large files
Some Linux distributions, such as Red Hat and SUSE, also include the IBM JFS (Journaled File System), which is designed for high-performance e-commerce file servers and is used on many IBM enterprise servers supporting high-speed corporate intranets. The selection of file system(s) ultimately depends on the role and the expected workload the system is supposed to handle. Careful planning before installation is highly recommended. Making the right decisions during installation can save you headaches later on.
Several mkfs and mount options might yield file system performance improvements under specific circumstances. See Chapter 11, "File System Tuning," for a complete discussion of tuning file systems for improved performance on Linux.
Tuesday, March 10, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment