Limitations and restrictions of dsync  Other optional parameters for disk init

Chapter 7: Initializing Database Devices

Using directio to bypass operating system buffer

The directio parameter for disk init, disk reinit, and sp_deviceattr allows you to configure Adaptive Server to transfer data directly to disk, bypassing the operating system buffer cache. directio performs IO in the same manner as raw devices and provides the same performance benefit as raw devices, but has the ease of use and manageability of file system devices. directio is a static parameter that requires a restart of Adaptive Server to take effect.

By default, the directio option is set to “false” (off) for all platforms.

The directio and dsync parameters are mutually exclusive. If a device has dsync set to “true,” you cannot set directio to “true” for this device. To enable directio for a device, you must first reset dsync to “false.”

NoteDevices used for databases for which recovery is not important (for example, tempdb), may have dsync set to “false.” For these devices, enabling directio may have an adverse performance effect, so you should carefully review device use before you enable directio.

The following creates a device named “user_disk” that uses directio to write data directly to disk:

disk init 
name = "user_disk", 
physname = "/usr/u/sybase/data/userfile1.dat", 
size = 5120, directio = true

Initializes 10MB of a disk on a UNIX operating system file:

disk reinit 
name = "user_disk", 
physname = "/usr/u/sybase/data/userfile1.dat", 
size = 5120, directio = true

By default, directio is disabled for all existing devices, and you enable it with sp_deviceattr. The syntax for sp_deviceattr is:

sp_deviceattr device_name, directio, [true | false]

For example, the following enables directio disk writes for the “user_disk” device:

sp_deviceattr user_disk, directio, true

You must reboot the server for this change to take effect.





Copyright © 2005. Sybase Inc. All rights reserved. Other optional parameters for disk init

View this book as PDF