Distributing I/O

From InterBase
Jump to: navigation, search

Go Up to Hardware Configuration


Disk device I/O is orders of magnitude slower than physical memory accesses or CPU cycles. There is a delay while the disk device seeks the data requested. While an application is waiting for data it has requested from a disk device, it is advantageous for the application to spend the time executing other tasks. One appropriate way to do this is to spread multiple data requests over multiple devices. While one disk is preparing to return data, the application requests another disk to start seeking another set of data. This is called distributed I/O or parallel I/O.

This section describes ways you can persuade InterBase to distribute I/O over multiple disk devices.


Using RAID

You can achieve up to a ten times performance improvement by using RAID.

RAID (redundant array of inexpensive disks) is a hardware design that is intended to give benefits to performance and reliability by storing data on multiple physical disk devices. It is transparent for software applications to use RAID, because it is implemented in the operating system or at the hardware level. InterBase uses operating system I/O interfaces, so InterBase supports RAID as would any other application software.

Disk striping (included in RAID levels 0, 3, or 5) provides performance benefits by distributing I/O across multiple disks.

Hardware RAID is faster than software RAID or software disk mirroring. RAID implemented with software provides only protection from hard disk failure; it is actually slower than operating without RAID.


Using Multiple Disks for Database Files

Similarly to RAID, you can distribute files of a multifile InterBase database among multiple physical disk drives.

For example, if you have a server with four physical disks, C:, D:, E:, and F:, and a 10GB database, you can create your database to take advantage of parallel I/O with the following database creation statement:

CREATE DATABASE 'C:\data\bigdata1.ib' PAGE_SIZE 4096
FILE 'D:\data\bigdata2.ib' STARTING AT PAGE 1000000
FILE 'E:\data\bigdata3.ib' STARTING AT PAGE 2000000
FILE 'F:\data\bigdata4.ib' STARTING AT PAGE 3000000;


Using Multiple Disk Controllers

If you have so much disk activity on multiple disks that you saturate the I/O bus, you should equip the server with multiple disk controllers, and connect the multiple drivers to the controllers as evenly as possible.

For example, if you have sixteen disk devices hosting database files, you might benefit from using four disk controllers, and attaching four disks to each controller.


Making Drives Specialized

A database server makes heavy use of both the virtual memory page file and of temporary disk space of the operating system. If possible, equip the server with multiple disks and configure the virtual memory file, temporary directory, and database files on separate physical disk devices. This can use parallel I/O to the fullest advantage.

For example, on Windows, you could locate the operating system files and pagefile.sys on C:, the temporary directory and infrequently-used files on D:, and database files on drives E: and higher.

Change the location of the virtual memory file with Control Panel|System|Performance|Virtual Memory.

Change the location of the InterBase temporary directory by either specifying a system environment variable INTERBASE_TMP, or editing the ibconfig file and specifying the path of the appropriate directory as a value for the TMP_DIRECTORY entry.

See Also

Advance To: