HP OpenVMS Systems Documentation
Guide to OpenVMS File Applications
188.8.131.52 Using the Deferred-Write Option
If there is no language support, you can call a VAX MACRO subroutine that sets the FAB$L_FOP field, the FAB$V_DFW option.
When you select the deferred-write option, RMS delays writing a modified bucket to the disk until the buffer is needed to read another bucket into the cache or until another process needs to reference the modified bucket. If a subsequent operation references the bucket before it is flushed out to disk, then one I/O operation has been eliminated. Typically, the largest performance gains come from using the deferred-write option with sequential access because random accesses of the file usually result in several I/O operations to bring in the single records.
Not all operations on indexed files can be deferred. Any operation that causes a bucket split forces the writeback of the modified buckets to disk. (This forced writeback decreases the chances of lost information should a system failure occur.)
Using the deferred-write option improves performance if you are
performing multiple I/O operations on a bucket. Consider the following
example. The indexed file has a single key and its records are 100
bytes long. The bucket size is 3 blocks with a fill factor of 67%.
Thus, there is an average of 10 records in each bucket. A batch program
reads each record and updates part of it, beginning at the first record
in the file and moving through the records sequentially. Without the
deferred-write option, 11 disk I/O operations occur for every 10
records---one to read the bucket and one to write the bucket for each
record. With the deferred-write option, only two disk I/O operations
occur for every 10 records---one to read the bucket and
one to write the bucket after the record operations are completed.
You can improve file performance by gathering statistics on RMS activity. Then, you can use these statistics to fine-tune the file. When you have enabled the gathering of statistics, you can selectively use the Monitor utility to view them.
You normally enable statistics gathering prior to opening a file and then turn on the Monitor utility periodically to measure file performance as desired. However, the Monitor utility can begin monitoring a file even before an application opens the file.
3.6.1 Enabling RMS Statistics
Note that RMS creates a global page-file section when you initially open a file marked for statistics gathering. Excessive use of statistics gathering might exhaust resources associated with global sections, and if RMS cannot create the global page-file section, the $OPEN service returns an error. See the OpenVMS System Services Reference Manual: A--GETUAI for information about system parameters associated with global sections.
See the OpenVMS DCL Dictionary for details about using the DCL interface to
enable statistics gathering for a file. The OpenVMS Record Management Utilities Reference Manual provides
details about enabling RMS statistics for a file through the FDL
interface. Instructions for gathering RMS statistics through the
program interface are provided in the OpenVMS Record Management Services Reference Manual.
This section provides an example of how you can use RMS statistics to improve file-processing performance. In this example, the system manager suspects that an I/O bottleneck involving the file DATABASE.DAT is causing a system performance problem. To confirm the suspicion, the system manager enables statistics monitoring on the file. Note that, if the system manager does not have sole access to the file, the SET FILE command returns a file access conflict error message. You can use the /SHARE qualifier in conjunction with the /STATISTICS qualifier to enable or disable statistics on a file that is currently being accessed. However, only statistics of new accessors of the file will be measured.
The system manager invokes the Monitor utility to obtain a periodic sampling of RMS statistics that describe the processing activity related to DATABASE.DAT. The statistics relating to the operations rate, the buffer caching rate, the data rate, and the locking rate displayed on the Monitor screens provide the system manager with information for making decisions about where to place the file on disk and how to select optimal tuning parameters for the file.
Using the DCL interface, the system manager enables statistics gathering with the following command:
The SET/FILE STATISTICS command applies an application access control entry (ACE) to the specified file. The ACE does not affect access control and is only meaningful to the application assigning it.
For more information about using the SET FILE/STATISTICS command, see
the OpenVMS DCL Dictionary. The OpenVMS System Manager's Manual provides detailed information
about using the Monitor utility. For more information on performance
management, see Guide to OpenVMS Performance Management and A Comparison of System Management on OpenVMS AXP and OpenVMS VAX.
This section discusses designing file applications for an OpenVMS Cluster and the performance you can reasonably expect from the OpenVMS Cluster environment.
Processing in an OpenVMS Cluster environment offers many advantages:
For more information about OpenVMS Clusters, see OpenVMS Cluster Systems.
Shared access is one of the chief advantages of processing in an OpenVMS Cluster environment. Many applications that run on a single-node system can run on an OpenVMS Cluster with no changes.
However, applications that access shared files in an OpenVMS Cluster
incur some additional overhead for the OpenVMS Cluster synchronization;
the amount of additional overhead depends on the locking requirements
of your application.
The distributed lock manager allows several users to share files concurrently in an organized manner. RMS uses the lock manager to control file access.
The lock-mastering node controls the record and bucket locking for a given file for users on every node of the OpenVMS Cluster. Initially, it is the first node from which the file is opened. However, another node may become the lock-mastering node when a node either joins or leaves the OpenVMS Cluster.
The lock-mastering node may also change every time the file is opened. When another process opens the file (provided that the file was closed), the node on which that process resides becomes the new lock-mastering node for that file.
Lock requests issued by processes on the lock-mastering node incur less cost than lock requests issued from other nodes. Conversely, the lock-mastering node has the additional work of processing lock requests for that file for all other nodes.
RMS locks buckets and records during record operations only if the file is open for shared writing. Conversely, RMS does no locking during record operations if the file is open for shared read-only access or for exclusive access.
Lock requests for root locks (top-level or parent locks) in an OpenVMS Cluster may be slightly slower than on a single-node system. However, these locks are used when you open and close files, so the time for lock operations is only a fraction of the total time needed to open and close files.
There is no performance difference between a single-node system and an OpenVMS Cluster if the file sharing takes place on a single node of the OpenVMS Cluster. Only when sharing spans across the OpenVMS Cluster nodes does distributed locking occur.
As a result, the record locking itself may take a little longer, but because you have multiple CPUs in the OpenVMS Cluster, your application benefits from the added processing power.
Sharing files in an OpenVMS Cluster also requires enough memory for
nonpaged pool to store additional lock data structures. This
requirement, however, is dependent upon your processing load.
Sharing files in an OpenVMS Cluster environment also means sharing
resources, such as disks and other pieces of I/O hardware. When
applications on many nodes share data on one disk, OpenVMS Cluster
performance may degrade due to excessive I/O operations.
Four general recommendations about performance in an OpenVMS Cluster environment are described in the following list:
|ADD||Inserts one or more lines into the FDL definition. If the line already exists, you can replace it with your new line. Once you have inserted a line, you can continue to add lines until you are satisfied with that particular primary section. If no primary section exists to hold the secondary attribute being added, the Edit/FDL utility creates one.|
|DELETE||Removes one or more lines from the FDL definition. If you delete all of the secondary attributes in a primary section, you effectively remove the primary attribute. Once you have removed a line, you can continue to delete lines under that particular primary section.|
|EXIT||Creates the output FDL file, stores the current FDL definition in it, and terminates the Edit/FDL utility utility session. The Edit/FDL utility leaves unchanged any FDL file that it used as input. The FDL file that is created is, by default, a sequential file with variable-length records and carriage-return record attributes, and has your process's default RMS protection and ownership.|
|HELP||Displays the top level help text for the Edit/FDL utility and then continues to prompt for more keywords. Pressing the Return key in response to the "Topic?" prompt or pressing Ctrl/Z will return you to the main function prompt.|
|INVOKE||Prompts you for your choice of scripts and starts a series of logically ordered questions that help you create new FDL files or modify existing ones.|
|MODIFY||Allows you to change the value of one or more lines in the FDL definition. Once you have changed a line, you can continue to modify lines under that particular primary section.|
|QUIT||Aborts the session without creating an output FDL file. You can also press Ctrl/C or Ctrl/Y to abort the session.|
|SET||Allows you to establish defaults or to select any of the Edit/FDL utility characteristics you forgot to specify on the command line.|
|VIEW||Displays the current FDL definition.|
|?||Causes the utility to display more information. You can enter the question mark character in response to any question asked by the Edit/FDL utility. In all cases, it will result in repetition of the question. Note too, that the utility responds to an invalid response in the same manner that it responds to a question mark.|
In most cases, a command from the main menu brings up a second level menu. For instance, typing the ADD command displays the following menu:
Legal Primary Attributes ACCESS attributes set the run-time access mode of the file AREA x attributes define the characteristics of file area x CONNECT attributes set various RMS run-time options DATE attributes set the date parameters of the file FILE attributes affect the entire RMS data file KEY y attributes define the characteristics of key y NETWORK attributes set run-time network access parameters RECORD attributes set the non-key aspects of each record SHARING attributes set the run-time sharing mode of the file SYSTEM attributes document operating system-specific items TITLE is the header line for the FDL file Enter desired primary (Keyword)[FILE] :
One of the most important features of the Edit/FDL utility is that it helps you create FDL files that define indexed, relative, and sequential data files. To do this, the Edit/FDL utility provides seven scripts that guide you through an interactive session. You can choose one of these scripts at the start of a session, or you can instruct the Edit/FDL utility to automatically invoke a particular script each time that you enter the EDIT/FDL command.
Table 4-2 lists the seven scripts.
|ADD_KEY||Allows you to model or add to the attributes of a new index.|
|DELETE_KEY||Allows you to remove attributes from the highest-level index of your file.|
|INDEXED||Begins a dialog in which you are prompted for information about the indexed data file you want to create from the FDL file. The Edit/FDL utility supplies values for certain attributes.|
|OPTIMIZE||Helps you redesign an FDL file using an analysis file from the Analyze/RMS_File utility (ANALYZE/RMS_FILE/FDL). The FDL file itself is one of the inputs to the Edit/FDL utility. In effect, this script allows you to tune the parameters of your indexes using the file statistics from the FDL ANALYSIS sections produced by ANALYZE/RMS_FILE.|
|RELATIVE||Begins a dialog in which you are prompted for information about the relative data file to be created from the FDL file. The Edit/FDL utility supplies values for certain attributes.|
|SEQUENTIAL||Begins a dialog in which you are prompted for information about the sequential data file to be created from the FDL file. The Edit/FDL utility supplies values for certain attributes.|
|TOUCHUP||Begins a dialog in which you are prompted for information about how you want to change an existing index.|