|Document revision date: 15 July 2002|
The deferred-write option is a run-time option that can improve performance. It is the default operation for some high-level languages and can be specified by clauses in other high-level languages.
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.
3.6 Monitoring RMS Performance
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.
In all cases, the following restrictions apply to statistics gathering:
You can enable statistics gathering in one of three ways:
RMS attributes: File statistics enabled
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.
3.6.2 Using RMS Statistics
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:
$ SET FILE/STATISTICS DATABASE.DAT
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.
Having enabled RMS statistics, the system manager runs the application and then uses the DCL interface to periodically display the statistics using the following command:
$ MONITOR RMS/FILE=DATABASE.DAT/ITEM=CACHING
The Monitor utility responds with information displays similar to the following:
VAX/VMS Monitor Utility RMS CACHE STATISTICS on node MENASH 28-FEB-1994 16:03:59 (Index) MENASH$DUA0:[TOREP]DATABASE.DAT;1 Active Streams: 60 CUR AVE MIN MAX Local Cache Hit Percent 40.00 59.86 38.00 80.00 Local Cache Attempt Rate 59.81 59.26 56.07 60.55 Global Cache Hit Percent 87.54 81.38 57.43 100.00 Global Cache Attempt Rate 23.36 14.88 7.47 23.85 Global Buf Read I/O Rate 0.00 1.21 0.00 2.91 Global Buf Write I/O Rate 0.00 0.00 0.00 0.00 Local Buf Read I/O Rate 12.14 8.84 4.67 13.08 Local Buf Write I/O Rate 29.90 29.63 28.97 29.90
If this display represents a period of activity that the system manager or application developer wants to optimize, then the following observations can be derived:
$ MONITOR MONITOR RMS/FILE=DATABASE.DAT/ITEM=ALL
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.
3.7 Processing in an OpenVMS Cluster Environment
This section discusses designing file applications for an OpenVMS Cluster and the performance you can reasonably expect from the OpenVMS Cluster environment.
In this document, discussions that refer to OpenVMS Cluster environments apply to systems that include only VAX nodes and OpenVMS Cluster systems that include at least one Alpha node unless indicated otherwise.
Processing in an OpenVMS Cluster environment offers many advantages:
For more information about OpenVMS Clusters, see OpenVMS Cluster Systems.
3.7.1 OpenVMS Cluster Shared Access
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.
126.96.36.199 Locking Considerations
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.
The lock-requesting node is any node in the OpenVMS Cluster other than the lock-mastering node for a given file.
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.
188.8.131.52 I/O Considerations
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.
3.7.2 Performance Recommendations
Four general recommendations about performance in an OpenVMS Cluster environment are described in the following list:
After you have designed your file, you need to create it. First you must specify the file characteristics you selected during the design phase. Then you need to create the actual file with those characteristics and to protect it (decide who has access to the file). Lastly, you need to put records in the file, or "populate" it.
This chapter describes the process of creating and populating files.
You can specify the characteristics you need to create a file in two ways.
If you use VAX MACRO or BLISS--32, you can specify file characteristics by including OpenVMS RMS (hereafter referred to as RMS) control blocks in your application program.
If you use a high-level language, you can use the File Definition Language (FDL), a special-purpose language that is used to write specifications for data files. Of course, you also have the option of using FDL with VAX MACRO or BLISS--32.
The following sections describe how you can specify file-creation
characteristics by using RMS control blocks or by creating FDL files.
4.1.1 Using RMS Control Blocks
You can establish characteristics for the file you create by using an
RMS file access block (FAB) and extended attribute blocks (XABs). These
control blocks allow you to take the defaults that RMS provides or to
override the defaults and define the characteristics that suit your
184.108.40.206 File Access Block
The FAB is made up of fields that describe various file characteristics and contain the following file-related information:
The FAB lets you use both the creation-time characteristics and the run-time characteristics of RMS. You must define one FAB for each file your program opens or creates.
For more information about the FAB, see the OpenVMS Record Management Services Reference Manual.
220.127.116.11 Extended Attribute Blocks
Extended attribute blocks (XABs) are optional control blocks that contain supplementary file-attribute information. The following is a partial list of XABs that can be used to provide supporting file information:
Like FABs, XABs allow you to use both the creation-time characteristics and the run-time characteristics of RMS.
With XABs, you can define various file attributes beyond those specified in the associated FABs.
For more information about the extended attribute blocks, see the
OpenVMS Record Management Services Reference Manual.
4.1.2 Using File Definition Language
FDL provides a way to create data files using special text files called FDL files. FDL files are written in a file definition language, which permits you to specify appropriate attributes and values for the file.
You create and modify FDL files using the Edit/FDL utility (EDIT/FDL). The Edit/FDL utility contains built-in design algorithms to help you optimize data file design. The Edit/FDL utility recognizes correct FDL syntax and informs you immediately of syntax errors. (You can use a text editor or the DCL command CREATE to create an FDL file, but you must then follow the validity rules listed in the OpenVMS Record Management Utilities Reference Manual.)
You can also use the Analyze/RMS_File utility to create FDL files from existing data files. FDL files created in this manner contain special analysis sections that you can use with the Edit/FDL utility to tune your data files.
You can use the Create/FDL utility and the Convert utility to create data files from the specifications in the FDL files. Note that the Convert utility processes relative files by sequentially reading records from the input file, then writing them to the output file. As a result, the relative record numbers (RRN) change when the input file contains deleted or unused records.
By using an FDL file to create a data file from a high-level language,
you can specify most of the creation-time characteristics that are
available with RMS control blocks (FABs and XABs). However, to use all
of the connect-time features, including wildcard characters, you must
use the RMS control blocks.
18.104.22.168 Using the Edit/FDL Utility
You can use the Edit/FDL utility in two ways: with a terminal dialog (interactively) or without one (noninteractively).
If you use the Edit/FDL utility noninteractively, you can execute only the OPTIMIZE script. The OPTIMIZE script lets you optimize an existing FDL file without an interactive session. For more information, see Section 10.3.
Alternatively, if you use the Edit/FDL utility interactively, you can use all the scripts, each of which has a series of menus. When you invoke the Edit/FDL utility, it displays a main menu. To select a menu item, you only need to enter the first letter of the item because each selection has a unique first letter.
Table 4-1 summarizes the Edit/FDL utility commands.
|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.|
Ctrl/Z is equivalent to the EXIT command if you use it at the main menu level. If you use it from any other level, Ctrl/Z returns you to the main menu level.
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.|
|privacy and legal statement|