Using the Command Line Version of the Buffer Pool Monitor (NATBPMON)

This document covers the following topics:

See also Natural Buffer Pool which provides general information on the buffer pool and explains how to start the buffer pool.

Warning:
This utility should not be generally accessible to all users of Natural, because its use can cause damage to the work of other users of the buffer pool.

Invoking the NATBPMON Utility

You can invoke the NATBPMON utility either for the default buffer pool NATBP or for another existing buffer pool.

Start of instruction setTo invoke the NATBPMON utility

  1. Invoke the Command Prompt window of Windows.

  2. Go to the Natural bin directory which contains the file natbpmon.exe.

  3. If the default buffer pool NATBP is to be used, enter the following command in the Command Prompt window:

    NATBPMON

    Or:
    If another buffer pool is to be used, enter the following command in the Command Prompt window:

    NATBPMON BP=buffer-pool-name

    The following prompt appears:

    NATBPMON>

NATBPMON Commands

The following commands can be entered at the NATBPMON prompt:

Command Description
CLEAR This is the same as the ZERO command.
CORPSES Displays the list of corpses. A corpse is an object that has been deleted, but was still being used in the buffer pool when its deletion took place. Once this object is no longer used, it will automatically disappear from the list of corpses.

Note:
The column cusr which is shown with the DIR command indicates if an object is being used.

DELETE {pattern|[*]} Deletes an object from the buffer pool. All objects can be deleted from the buffer pool by using an asterisk (*). A pattern is used to specify a collection of objects, similar to current operating systems which allow the specification of a class of files with wildcards. For further information, see Specifying a Pattern.
DIR {pattern|[*]} Displays a directory containing all objects in the buffer pool. For further information, see the sections Specifying a Pattern and Displaying the Objects in the Buffer Pool.
DUMP Used for error analysis.

Important:
Do not use this command unless you are requested to do so by Software AG Support.

EXIT Exits the NATBPMON utility.
FIN Exits the NATBPMON utility. This is the same as the EXIT command.
HELP Displays a list of all available commands of the NATBPMON utility.
PARAM Displays the buffer pool settings. For further information, see Displaying the Buffer Pool Settings.
QUIT Exits the NATBPMON utility. This is the same as the EXIT command.
SHUTDOWN Shuts down the buffer pool. No new processes will be able to use the buffer pool once this command has been issued. The NATBPMON utility is able to run with a buffer pool which has the shutdown status "pending"; all commands of the NATBPMON utility are available in this case.

Note:
To start the buffer pool after shutdown, you can use the utility NATBPSRV.

STATUS Displays statistical information about the buffer pool. For further information, see Statistical Information About the Buffer Pool.
SWAP Only available for a read-only buffer pool. Tags a read-only buffer pool as "obsolete". All Natural sessions attached to such a buffer pool will detach from that buffer pool and attach to the alternate buffer pool.
WHO Displays a list of all users who are using the buffer pool. The following statistics are displayed: a number that the NATBPMON utility automatically assigns to each buffer pool user (index) and the user ID, terminal ID and process ID of the process using the buffer pool (tid).
WRITE Writes a buffer pool object onto the disk. You are prompted to specify an index and a file name.

Note:
The column "indx" which is shown with the DIR command shows the index numbers.

ZERO Resets to 0 all counters that are displayed by the STATUS command.

Displaying the Objects in the Buffer Pool

The DIR command displays a list of objects. This list contains the following information:

Column Explanation
indx A number that the NATBPMON utility automatically assigns to an object when it is loaded into the buffer pool.
cusr The current number of users that are using an object in the buffer pool.
pusr The peak number of concurrent activations of an object in the buffer pool.
nusg The number of times an object has been activated in the buffer pool.
g
Specifies whether an object is being loaded into the buffer pool from the system file. Has one of the following values:
0 The object is not being loaded.
1 The object is being loaded.
size Specifies the size (in bytes) of an object in the buffer pool.
gpv The version number of the generated program.
key
Specifies the following information about an object:
D Database ID.
F File number.
L The library in which the object is located.
N The name of the object. Numbers and the at sign (@) indicate chunks of FILEDIR.SAG for the currently loaded library.
K The kind of object (G=generated object module; S=source; D=part of FILEDIR.SAG; R=resource).
T The object type (which is blank when D is shown in the K field).

When the DIR command is issued, all objects in the pool will be displayed in a notation similar to the following:

indx:    index of the element  
 cusr:    current number of concurrent users  
 pusr:    peak number of concurrent users  
 nusg:    number of usages  
 g   :    set if object is generating
 gpv :    version of generated program

indx | cusr | pusr |  nusg  |  g  |  size  |  gpv  |  key
-----+------+------+--------+-----+--------+-------+---------------------------------------------------
 1   |  0   |  1   |    4   |  0  |   920  |       |  (D=99 F=101 L="DEMO" N="SEL-MAP" K='G' T='M') 
 2   |  1   |  7   |    2   |  0  |  3096  |       |  (D=99 F=101 L="DEMO" N="EMWND" K='G' T='P') 
 3   |  4   |  9   |    4   |  0  |   604  |       |  (D=99 F=101 L="DEMO" N="HDR" K='G' T='P') 
 4   |  2   |  3   |    7   |  0  |   412  |       |  (D=99 F=101 L="RPA" N="MMUPROG1" K='G' T='P') 
 5   |  0   |  1   |    5   |  0  |   372  |       |  (D=99 F=101 L="RPA" N="MMUPROG2" K='G' T='P') 
 6   |  0   |  5   |    4   |  0  |   372  |       |  (D=99 F=101 L="RPA" N="MMUPROG3" K='G' T='P')

Specifying a Pattern

A pattern can be specified with the commands DIR and DELETE. The examples in this section apply to the DIR command.

To select some objects, it is possible to restrict the values of certain key fields by specifying a matching pattern expression.

To restrict the allowed field values of a given field, the following pattern notation must be used:

name=expression

You can specify multiple patterns by separating them with a comma.

The specified patterns must all match their corresponding fields in order to accept the entire key.

The expression accepts the specification of the wildcard characters "*" and "?".

The character "*" matches any or no occurrences of a sequence of characters, and the wildcard character "?" matches exactly one specific character.

Examples

To select all objects of type P in the sample above, the following command would be used:

DIR T=P

To select all programs in the demo library, the following command would be used:

DIR T=P, L=DEMO

To select all objects containing an M in their name, the following command would be used:

DIR N=*M*

Displaying the Buffer Pool Settings

The following settings are displayed with the PARAM command:

Active since ..............: 27-JAN-2016  2:54:12, Version 8.3(837) BP version 1
Last time cleared .........: 27-JAN-2016  2:54:12

Bpid ......................: NATBP
Readonly ..................: no
Shmkey ....................: Global\NAT83BPMEM_0x18371111008
Semkey ....................: Global\NAT83BPMEM_0x18371111008
Memsize ...................:  104857600
Maxusers ..................:         20
Bpid Buffer pool ID.
Readonly Indicates whether this is a special buffer pool which only allows read access.
Shmkey Unique name used to create a buffer pool or to connect to a buffer pool.
Semkey Unique name used to synchronize accesses to the buffer pool memory.
Memsize Size of the available shared memory.
Maxusers Maximum number of users that can have simultaneous access to the buffer pool.

See Buffer Pool Assignments in the Configuration Utility documentation.

Statistical Information About the Buffer Pool

The following statistics are displayed with the STATUS command:

Active since ...........: 18-JAN-2016 11:57:32, Version 8.3(837) BP version 1
Last time cleared ......: 18-JAN-2016 11:57:32
Bpid ...................: NATBP
Allocated memory (b) ...:      19142488 Max users ............:            50
Smallest allocation ....:            32 Current users ........:             1
Largest allocation .....:       4707272 Peak users ...........:            27
Free memory (b) ........:       1829032 Dead users purged ....:            15
Smallest free ..........:           136
Largest free ...........:         52952

Dormant objects ........:          1378 Smallest object (b) ..:           108
Active objects .........:             0 Largest object (b) ...:         83890
Generating objects .....:             0 Total object sizes ...:      13577572
Obsolete objects .......:             0

Attempted locates ......:     197948090 Stored objects .......:             0
Attempted fast locates .:     103794754 Loaded objects .......:       2323293
Successful fast locates.:     100344415 Activated objects ....:     190326501
Percent ................:         96.68 Aborted loads ........:        328152

Dormant objects purged .:         63731 Peak parallel activations:         10
Object reusage factor ..:         81.92
General Information
Active since Date and time when the buffer pool was started, the version number and the internal version (BP version) of the buffer pool.
Last time cleared Date and time when the buffer pool was most recently cleared.
Bpid Buffer pool ID.
Memory Allocation
Allocated memory (bytes) Total of all allocated memory.
Smallest allocatio Smallest amount of allocated memory.
Largest allocation Largest amount of allocated memory.
Free memory (bytes) Total of all free memory.
Smallest free Smallest amount of contiguous free memory.
Largest free Largest amount of contiguous free memory.
User Statistics
Max. users Maximum number of users that can have simultaneous access to the buffer pool. See Buffer Pool Assignments in the Configuration Utility documentation.
Current users Number of users currently using the buffer pool.
Peak users Peak number of users that have been using the buffer pool.
Dead users purged Number of inactive users that have been deleted from the buffer pool. This number should be close to 0 (zero). An increment of this number indicates that entries for buffer pool users (i.e. Natural sessions) were canceled or killed unconditionally. Each time an entry for such a user is identified by the buffer pool manager, this number is incremented and cleanup is performed to remove residuals which have been left in the buffer pool by a canceled session.
Object Use Statistics
Dormant objects Number of available, but inactive objects. These objects are in the buffer pool, but are not being used. They are available for later use and will become active objects as soon as a buffer pool user requests their availability.
Active objects Number of active objects. These objects are currently in use by one or more buffer pool users.
Generating objects Number of objects that are currently being loaded into the buffer pool. These objects will become available as soon as the load operation completes.
Obsolete objects Number of objects that are to be deleted from the buffer pool, but are still being used. These objects can be displayed by using the CORPSES command. An obsolete object is removed from the buffer pool as soon as all users who activated this object have released this object. In a production environment, this number should be 0 (zero). A value other than zero indicates that objects were deleted either using the DELETE command of NATBPMON or became obsolete because new objects were created (for example, due to a CATALOG command).
Object Size Statistics
Smallest object (bytes) Size of smallest object in the buffer pool.
Largest object (bytes) Size of largest object in the buffer pool.
Total object sizes Total size of all objects in the buffer pool.
Locate Statistics
Attempted locates Number of successful and failed object locates. This number tells you how many times the buffer pool manager was asked to locate an object in the buffer pool.
Attempted fast locates Number of attempted activations with known slot. This is the number of object activations when the former location of an object was known. It is highly probable that an object can be found in the same place in the buffer pool when it is reactivated.
Successful fast locates Number of successful fast locates.
Percent Percentage of successful fast locates.
Object Loading Statistics
Stored objects The number of objects stored in the buffer pool. This is the number of objects that were stored into the buffer pool and which were not loaded from the system file.
Loaded objects The number of objects loaded from the system file. Each time an object is not found in the buffer pool, it is loaded from the system file. This number is increased each time an object is successfully loaded into the buffer pool.
Activated objects The number of activated objects. Activation is the process of marking an object which is found in the buffer pool as "in use" by a buffer pool user.
Aborted loads The number of load operations that were aborted due to memory shortages within the buffer pool, or due to an error when loading an object into the buffer pool. This number should not vary in a noticeable way.
General Loading Statistics
Dormant objects purged The number of unused objects deleted from the buffer pool to make room for newly loaded ones.
Peak parallel activations The maximum number of parallel activations of one of the objects in the buffer pool.
Object reusage factor Average number of times an object was reactivated. This number is the ratio of the number of object activations to the number of objects loaded into the buffer pool.