HP OpenVMS Systems Documentation
Guide to OpenVMS File Applications
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.
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:
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.|
This command bypasses the main menu to directly display the menu for the selected script.
Example 4-1 shows a sample session with the Edit/FDL utility.
|Example 4-1 Sample Edit/FDL Utility Session|
OpenVMS FDL Editor Add to insert one or more lines into the FDL definition Delete to delete one or more lines from the FDL definition Exit to leave the FDL Editor after creating the FDL file Help to obtain information about the FDL Editor (1) Invoke to initiate a script of related questions Modify to change existing line(s) in the FDL definition Quit to abort the FDL Editor with no FDL file creation Set to specify FDL Editor characteristics View to display the current FDL Definition (2) Main Editor Function (Keyword)[Help] : INVOKE Script Title Selection Add_Key modeling and addition of a new index's parameters Delete_Key removal of the highest index's parameters Indexed modeling of parameters for an entire Indexed file (3) Optimize tuning of all indexes' parameters using file statistics Relative selection of parameters for a Relative file Sequential selection of parameters for a Sequential file Touchup remodeling of parameters for a particular index (4) Editing Script Title (Keyword)[-] : INDEXED (5) Target disk volume Cluster Size (1-1Giga) : 3 (6) Number of Keys to Define (1-255) : 1 Line Bucket Size vs Index Depth as a 2 dimensional plot Fill Bucket Size vs Load Fill Percent vs Index Depth (7) Key Bucket Size vs Key Length vs Index Depth Record Bucket Size vs Record Size vs Index Depth Init Bucket Size vs Initial Load Record Count vs Index Depth Add Bucket Size vs Additional Record Count vs Index Depth (8) Graph type to display (Keyword)[Line] : LINE (9) Number of Records that will be Initially Loaded into the File (0-1Giga)[-] : 100000 (10) (Fast_Convert NoFast_Convert RMS_Puts) Initial File Load Method (Keyword)[Fast] : FAST (11) Number of Additional Records to be Added After the Initial File Load (0-1Giga) : 0 (12) Key 0 Load Fill Percent (50-100) : 100 (13) (Fixed Variable) Record Format (Keyword)[Var] : VARIABLE (14) Mean Record Size (1-32229)[-] : 80 (15) Maximum Record Size (0,80-32229) : 0 (16) (Bin2 Bin4 Bin8 Int2 Int4 Int8 Decimal String Collated Dbin2 Dbin4 Dbin8 Dint2 Dint4 Dint8 Ddecimal Dstring Dcollated) Key 0 Data Type (Keyword)[Str] : STRING (17) Key 0 Segmentation desired (Yes/No)[No] : NO (18) Key 0 Length (1-255)[-] : 9 (19) Key 0 Position (0-32220) : 0 (20) Key 0 Duplicates allowed (Yes/No)[No] : NO (21) File Prolog Version (0-3) : 3 (22) Data Key Compression desired (Yes/No)[Yes] : YES (23) Data Record Compression desired (Yes/No)[Yes] : YES (24) Index Compression desired (Yes/No)[Yes] : YES *| 9| 8| Index 7| 6| Depth 5| 4| 3| 3 3 2| 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1| 1 1 1 1 1 1 1 1 +- + - - - + - - - - + - - - - + - - - - + - - - - + - - - - + - + (25) 1 5 10 15 20 25 30 32 Bucket Size (number of blocks) PV-Prolog Version 3 KT-Key 0 Type String EM-Emphasis Flatter ( 3) DK-Dup Key 0 Values No KL-Key 0 Length 9 KP-Key 0 Position 0 RC-Data Record Comp 0% KC-Data Key Comp 0% IC-Index Record Comp 0% BF-Bucket Fill 100% RF-Record Format Variable RS-Mean Record Size 80 LM-Load Method Fast_Conv IL-Initial Load 100000 AR-Added Records 0 (Type "FD" to Finish Design) (26) Which File Parameter (Mnemonic)[refresh] : FD (27) Text for FDL Title Section (1-126 chars)[null] : FDL_SESSION_EXAMPLE (28) Data File file-spec (1-126 chars)[null] : EXAMPLE.DAT (29) (Carriage_Return Fortran None Print) Carriage Control (Keyword)[Carr] : CARRIAGE_RETURN Emphasis Used In Defining Default: ( Flatter_files ) Suggested Bucket Sizes: ( 3 3 27 ) (30) Number of Levels in Index: ( 2 2 1 ) Number of Buckets in Index: ( 72 72 1 ) Pages Required to Cache Index: ( 216 216 27 ) Processing Used to Search Index: ( 168 168 766 ) (31) Key 0 Bucket Size (1-63) : 3 (32) Key 0 Name (1-32 chars)[null] : SSNUM (33) Global Buffers desired (Yes/No)[No] : NO (34) The Depth of Key 0 is Estimated to be No Greater than 2 Index levels, which is 3 Total levels. (35) Press RETURN to continue (^Z for Main Menu) OpenVMS FDL Editor Add to insert one or more lines into the FDL definition Delete to delete one or more lines from the FDL definition Exit to leave the FDL Editor after creating the FDL file (36) Help to obtain information about the FDL Editor Invoke to initiate a script of related questions Modify to change existing line(s) in the FDL definition Quit to abort the FDL Editor with no FDL file creation Set to specify FDL Editor characteristics View to display the current FDL Definition (37) Main Editor Function (Keyword)[Help] : EXIT (38) DISK$:[FOX.RMS]FDL_SESSION_EXAMPLE.FDL;1 40 lines