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.
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 <email@example.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: noNow 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/sdaNow 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=2Now 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 <firstname.lastname@example.org> 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: noOur 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/secFrom 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|
|MBus||33MHz||64 bit||264 MB/s||86 MB/s|
|MBus||36MHz||64 bit||288 MB/s||94 MB/s|
|MBus||40MHz||64 bit||320 MB/s||105 MB/s|
|MBus||50MHz||64 bit||400 MB/s||130 MB/s|
|XDBus||40MHz||64 bit||320 MB/s||250 MB/s|
|XDBus||50MHz||64 bit||400 MB/s||312 MB/s|
|UPA||72MHz||128 bit||1.15 GB/s||1 GB/s|
|UPA||83.5MHz||128 bit||1.3 GB/s||1.2 GB/s|
|UPA||100MHz||128 bit||1.5 GB/s||1.44 GB/s|
|Gigaplane||83.5MHz||256 bit||2.6 GB/s||2.5 GB/s|
|GigaplaneXB||100MHz||1024 bit||12.8 GB/s||12.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!