Book Chapter

Tuning Oracle disk I/O: SCSI tuning under Linux and Unix

The following is part of a series on the different aspects of disk I/O performance and optimization for Oracle databases. Each tip is excerpted from the not-yet-released Rampant TechPress book, "Oracle disk I/O tuning," by Mike Ault. Check back to the main series page for upcoming installments.

Mike Ault

Mike Ault is one of SearchOracle.com's Oracle Internals experts. Mike is senior Oracle consultant with Burleson Consulting, and one of the leading names in Oracle technology.

To view Mike's expert responses or to ask him a question, click here.


SCSI tuning under Linux

Under Linux, the SCSI interface is tuned either by specifying parameters in the boot command of the Grub or Lilo boot file or by specifying options in the /etc/modules.conf file. Let's look at examples of both of these. The relative performance of the interface can be measured in Linux using the hdparm command with the -Tt option. Note that the IEEE1394 interface is treated as a SCSI interface in Linux. The following examples are for tuning the generic SBP2 interface, but the techniques can also be supplied to specific SCSI drivers.

First, let's look at the current settings for the interface. You get those by looking under the LUN number in the /proc/scsi/sbp2 directory. This example used LUN 0.

[root@aultlinux1 root]# cat /proc/scsi/sbp2/0
IEEE-1394 SBP-2 protocol driver (host: ohci1394)
$Rev: 601 $ James Goodwin <jamesg@filanet.com>
SBP-2 module load options:
- Max speed supported: S400
- Max sectors per I/O supported: 255
- Max outstanding commands supported: 8
- Max outstanding commands per lun supported: 1
- Serialized I/O (debug): no
- Exclusive login: no
Now we run a timing test to determine the average speed for the interface as-is (run this several times and average the results):
/dev/sda:
 Timing buffer-cache reads:  128 MB in  3.99 seconds = 32.08 MB/sec
 Timing buffered disk reads:  64 MB in  6.86 seconds =  9.33 MB/sec
[root@aultlinux1 root]# hdparm -Tt /dev/sda
Now we will set the values for the SBP2 options in the /etc/modules.conf file. We are doubling the outstanding commands to 16 and increasing the commands per LUN to 2:
alias parport_lowlevel parport_pc
alias eth0 3c59x
alias usb-controller usb-ohci
alias eth1 tulip
alias ieee1394-controller ohci1394
alias scsi_hostadapter sbp2
options sbp2 sbp2_max_outstanding_cmds=16 sbp2_max_cmds_per_lun=2
Now we reboot so the settings will take effect, then re-check our settings in /proc/scsi/sbp2/0:
[root@aultlinux1 root]# cat /proc/scsi/sbp2/0
IEEE-1394 SBP-2 protocol driver (host: ohci1394)
$Rev: 601 $ James Goodwin <jamesg@filanet.com>
SBP-2 module load options:
- Max speed supported: S400
- Max sectors per I/O supported: 255
- Max outstanding commands supported: 16
- Max outstanding commands per lun supported: 2
- Serialized I/O (debug): no
- Exclusive login: no
Our settings have been modified, now let's re-run the timing test:
[root@aultlinux1 etc]# hdparm -Tt /dev/sda

/dev/sda:
 Timing buffer-cache reads:  128 MB in  4.03 seconds = 35.36 MB/sec
 Timing buffered disk reads:  64 MB in  6.04 seconds = 11.25 MB/sec
From a simple modification, we improved SCSI speed for this device by 11.25/9.33*100= 120.6 percent. Overall, a 20% speed improvement. Subsequently we doubled, quadrupled and eventually got to a setting of 255 for the maximum outstanding commands, the performance peaked at 11.25 MB/sec with 16 as a setting. If the servers being tuned are in a cluster, all of them should have the same settings.

Tuning SCSI under Unix

SCSI tuning under Unix is dependent on the version of Unix involved and the SCSI card or mother board interface being tuned. Let's look at Sun.

On any system, Sun included, the system bus has a fixed bandwidth. If there are too many devices on the bus this will result in more traffic than the bus can handle, which then results in contention and packet loss.

In the Sun Solaris operating system, the prtdiag -v command is used to report on the system bus configuration. By adding up the reported capacities of the devices on the bus reported by prtdiag –v, and seeing if they exceed the capacity of the bus, it is possible to see if the bus is overloaded. Whenever possible, similar cards should be placed on the same board so the interrupts are directed to the same CPU (and associated caches). Table 3-1 shows some typical Sun system bus capacities:

Bus Speed Width Burst Bandwidth Sustained Bandwidth
MBus33MHz64 bit264 MB/s86 MB/s
MBus36MHz64 bit288 MB/s94 MB/s
MBus40MHz64 bit320 MB/s105 MB/s
MBus50MHz64 bit400 MB/s130 MB/s
XDBus40MHz64 bit320 MB/s250 MB/s
XDBus50MHz64 bit400 MB/s312 MB/s
UPA72MHz128 bit1.15 GB/s1 GB/s
UPA83.5MHz128 bit1.3 GB/s1.2 GB/s
UPA100MHz128 bit1.5 GB/s1.44 GB/s
Gigaplane83.5MHz256 bit2.6 GB/s2.5 GB/s
GigaplaneXB100MHz1024 bit12.8 GB/s12.8 GB/s

Figure 3-1: Typical Bus Capacities

Click to buy the book, "Oracle disk I/O tuning," by Mike Ault.


About the author

Mike Ault is a SearchOracle.com expert and a senior Oracle consultant with Burleson Consulting, and one of the leading names in Oracle technology. The author of more than 20 Oracle books and hundreds of articles in national publications, Mike Ault has five Oracle Masters Certificates and was the first popular Oracle author with his landmark book "Oracle7 administration and management." Mike also wrote several of the "Exam Cram" books, and enjoys a reputation as a leading author and Oracle consultant. Ask Mike a question today!


This was first published in August 2004

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: