RMS global buffers for a VMS system's indexed files. Global buffering can be used to save disk i/o to the system disk. 1) Brief description of global buffering. Global buffers are system-wide as opposed to the normal per-process ones. They can be very effective for indexed files being accessed by many processes. When the first $CONNECT to a file occurs on a given VAX, if the FAB field FAB$W_GBC (global buffer count) is non-zero, RMS creates a system page-file global section to contain that number of buffers. For indexed files a buffer holds one RMS bucket. When the last $DISCONNECT to a file on a given VAX occurs, the system global section is deleted. See the "Guide to VMS File Applications" and the "RMS Manual" for further details. 2) Using global buffering. To make a file a permanent candidate for global buffering one uses SET FILE/GLOBAL_BUFFERS on the file. To make a file's global buffers permanent on a running system, the file must be $OPENed & $CONNECTed by a permanent process. At Anglia College's Cambridge campus we use a permanent detached system process to open the files (the process has many other functions too). The files are opened for write-access with full sharing. This has the additional effect of preventing anyone locking the files completely (without sharing). The following SYSGEN parameters are relevant (and need to be checked when adding global buffering): GBLSECTIONS GBLPAGES GBLPAGFIL RMS_GBLBUFQUO 3) Example - our system indexed files & buffer sizes. Max Approx Record Bucket Global File Records Size Size Buffers SYSUAF 3000 1412 6 40 RIGHTSLIST 9000 64 3 80 VMSMAIL_PROFILE 2500 2048 5 40 GROUPS 800 2363 5 40 (database of user groups) CONFIGURATION 4 76 3 3 (system config. info) COMMS_PROC_LINES 350 256 1 80 (Gandalf & terminal server ports) (The bucket sizes were determined by the Optimize script of EDIT/FDL. We use this automatically each month on SYSUAF, RIGHTSLIST & VMSMAIL_PROFILE.) 4) Example - a data sample. (Sampled at 12-MAY-1989 13:10) VAX 11/780 ---------- VAX 8200 ------------ Refcnt Hits Misses Refcnt Hits Misses SYSUAF 5 76990 5371 3 101392 7446 RIGHTSLIST 5 278964 23087 4 464304 44890 VMSMAIL_PROFILE 2 27833 121 1 31172 144 GROUPS 1 32611 2680 1 27374 1939 CONFIGURATION 1 2000 2 1 1905 2 COMMS_PROC_LINES 3 166135 7118 2 151031 6802 Interactive login limit = 40 on both VAXes. Typical number of concurrent users on each = 20-25. A hit means that the required record was in the global section, a miss means that it wasn't and the record (bucket) had to be read from disk. Refcnt shows the current number of $CONNECTions to the file. As data buckets are fetched for indexed files rather than single records, adjacent records are available in system memory after reading a record. This is presumably one reason why the SYSUAF and RIGHTSLIST buffering is so successful in our educational environment in which classes of users (with adjacent UAF records) log-in at about the same time. One has to be wary of scanning the whole of these files sequentially during normal working hours as that would flush the active records out of the global buffer cache. We do such housekeeping activity overnight (and no doubt the miss counts are higher than they would otherwise be because of this periodic scanning). 5) Measuring the performance of global buffers. [I haven't tried the VMS V5.0 MONITOR RMS facility yet.] The sample data above was produced by the detached system process, which calls a site-supplied Executive-mode system service to inspect RMS' statistics. This is an example Macro code fragment, to be run in Executive-mode, which finds the RMS global buffer header (GBH) given an open FAB. ; Inspired by Bruce Ellis' Get_Hit program on the US VAX SIG 1987C tape. .library /sys$library:lib.mlb/ $impdef .link /sys$system:rmsdef.stb/ .link /sys$system:sys.stb/ (...) ; R5 contains the address of a FAB for an open file with global buffers movzwl fab$w_ifi(r5),r6 ; ifi moval g^pio$gw_iioimpa,r7 ; find image i/o impure area cmpw r6,imp$w_num_ifabs(r7) ; valid ifi? bgtru 100$ ; no movl imp$l_ifabtbl(r7),r7 ; find ifab table beql 100$ ; none? movl (r7)[r6],r7 ; find ifab beql 100$ ; none? movl ifb$l_gbh_ptr(r7),r7 ; find gbh beql 100$ ; none? (...) The global buffer header contains the following fields (amongst others): gbh$l_miss -- misses gbh$l_hit -- hits gbh$l_usecnt -- use count (reference count)