Previous Page | Next Page

Optimizing System Performance

External I/O under OpenVMS

The following guidelines apply to reading and writing OpenVMS native files using SAS. For several of the suggestions, the larger your files, the more performance gain for your entire SAS job. These suggestions parallel several of the SAS data set I/O suggestions.


Allocating File Space Appropriately

Job type

SAS procedures and DATA steps that write external files.

User

SAS programmer.

Usage

The ALQ= and DEQ= options are specified as part of the FILENAME or FILE statement.

Benefit

Specifying appropriate values can decrease elapsed time up to 50 percent and reduce disk fragmentation.

Cost

You will experience performance degradation when ALQ= and DEQ= values are incompatible with file size.

SAS allocates disk space for external files based on the value of ALQ=. It then extends the file if needed, based on the value of DEQ=. By default, the ALQ= value is 0 (indicating that the minimum number of blocks required for the given file format is used) and the value for DEQ= is 0 (telling OpenVMS RMS to use the process's default value). For more information about specifying the ALQ= and DEQ= options, see FILENAME Statement: OpenVMS and FILE Statement: OpenVMS.

Every time a file must be extended, the system must search the disk for free space. This requires I/Os. When this is done repeatedly for large files, performance degrades with a possible increase in disk fragmentation. By setting larger ALQ= and DEQ= values for large files, this overhead will be reduced. Optimal I/O will occur when ALQ= is equal to the size of the file. Because this is not always feasible, it is better to underestimate the value for ALQ= and set a larger DEQ= value. This allocates enough space for a smaller file, while extending it occasionally to meet the demands of a larger file. Allocating too much space can be costly if /HIGHWATER_MARKING is set on the disk. (For more information, see Turning Off Disk Volume High-Water Marking.)


References for Allocating File Space


Turning Off Disk Volume High-Water Marking

Job type

Jobs that write external files.

User

System manager.

Usage

Use the /NOHIGHWATER_MARKING qualifier when initializing disks. For active disks, issue the DCL command SET VOLUME/NOHIGHWATER_MARKING.

Benefit

Elapsed time can be improved by up to 40 percent. Direct I/Os are reduced.

Cost

There is no performance penalty. However, for security purposes, some OpenVMS sites might require this OpenVMS high-water marking feature to be set.

SAS uses the random access method when opening external files. This means that allocated disk space does not have to be processed in a sequential method. /HIGHWATER_MARKING is a safeguard that clears disk space by writing zeros to the disk space before it is allocated to overwrite the contents of former files. To do this, the entire space that is allocated has to be overwritten. Overwriting the disk space requires some amount of elapsed time and I/O operations to complete. If the data that is stored on the disk is not of a truly confidential nature, then a performance gain can be achieved by disabling high-water marking on this disk.

Two DCL commands can be used independently to disable high-water marking on a disk. When initializing a new volume, use the following to disable the high-water function:

$ initialize/nohighwater $DKA470 mydisk

To disable volume high-water marking on an active disk, use a command similar to the following:

$ set volume/nohighwater $DKA200


References for Turning Off Disk Volume High-Water Marking


Eliminating Disk Fragmentation

Job type

Any jobs that access common external files frequently.

User

System manager.

Usage

You will need to devote a disk to frequently accessed files or keep your disks defragmented.

Benefit

The savings on elapsed time depend on the current state of the disk, but the time can be reduced by up to 40 percent.

Cost

The cost to the user is the time and effort to better manage disk access rather than letting the OpenVMS environment do all of the work. For the system manager, this might involve regularly defragmenting disks or obtaining additional disk drives.

On a defragmented disk, all blocks of a file are physically contiguous, so after one I/O operation the disk head is well positioned for the next I/O operation. Split I/O operations (where multiple physical I/O operations are required to satisfy a single I/O request that is issued from program control) are rare on a defragmented disk, which decreases elapsed time to perform I/O.

Where possible, dedicating a disk drive to frequent defragmentation can provide performance benefits. Use this disk to store commonly accessed SAS external files. In some situations, adding an inexpensive SCSI drive to the configuration might allow the system manager to maintain a clean, defragmented environment more easily than maintaining a large disk farm. Files that are maintained on this defragmented SCSI disk might perform better than heavily fragmented files on larger disks.

Defragmenting a disk means using the OpenVMS backup utility after regular business hours, when disk activity is likely to be minimal, to perform an image backup of a disk. Submit the following command sequence to create a defragmented copy of the source disk on the destination disk, using the files from the source disk:

$ mount/foreign 'destination-disk'
$ backup/image 'source-disk' 'destination-disk'

When the image backup operation is complete, dismount the destination disk and remount it using a normal mount operation (without the /FOREIGN qualifier) so that the disk can be used again for I/O operations. SAS does not recommend the use of dynamic defragmenting tools that run in the background of an active system because such programs can corrupt files.


References for Eliminating Disk Fragmentation


Specifying Default Multiblock Count

Job type

Jobs that write large external files.

User

SAS programmer.

Usage

The MBC= option (multiblock count) is specified as part of the FILENAME or FILE statement.

Benefit

Elapsed time can be improved by 25 to 35 percent on jobs that output large external files.

Cost

Increasing multiblock count can slightly increase the requirements for memory.

By default, SAS uses the default value for your process for the multiblock count, which is specified by the RAB$B_MBC field in the OpenVMS RMS Record Access Block (RAB) data structure. You can use the MBC= external I/O option to specify the size of the I/O buffers that OpenVMS RMS allocates for writing or reading an external file. The MBC= option controls how many 512-byte pages of memory are reserved to perform file access. When you increase the buffer size, you use more memory.

We recommend a value of approximately 32 blocks for the MBC= option when you are writing a very large external file (over 100,000 blocks). You might see improvement in elapsed time up to 35 percent. Only minimal gains in performance will occur when you specify the MBC= option for reading an external file.

Note:   You can use the MBC= option to affect a particular file. If you want to specify a default multiblock count for your process that will affect all external files in your SAS program, use the DCL SET RMS_DEFAULT command.  [cautionend]


References for Specifying Default Multiblock Count

Previous Page | Next Page | Top of Page