Optimizing System Performance |
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 |
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.)
Turning Off Disk Volume High-Water Marking |
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
HP OpenVMS System Manager's Manual, Volume 2: Tuning, Monitoring, and Complex Systems
HP OpenVMS DCL Dictionary
Eliminating Disk Fragmentation |
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.
HP OpenVMS System Manager's Manual
HP OpenVMS DCL Dictionary
Specifying Default Multiblock Count |
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.
HP OpenVMS System Manager's Manual
HP OpenVMS DCL Dictionary
HP OpenVMS Record Management Services Reference Manual
HP Guide to OpenVMS File Applications
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.