Monitoring Performance Counters
PSQL Server for Windows provides performance counters for use with the Windows Performance Monitor. (The PSQL performance counters are supported only on Windows Vista or later Windows operating systems.) The performance counters measure state or activity of the database engine, which allows you to analyze performance of your application. Windows Performance Monitor requests the current value of the performance counters at specified time intervals.
PSQL provides data only for display by the Performance Monitor and cannot modify the counter properties. Performance Monitor controls the following:
The counter values reflect all calls into the database engine regardless of their source. That is, the MicroKernel Engine, Relational Engine, native Btrieve applications, utilities, and so forth, all contribute to the counter values. Counter values are collected for all files. Counters on a per-file basis are not currently supported.
Note that the use of performance counters is an advanced feature intended primarily for application developers and other technical staff. Refer to the Microsoft documentation for details about the Windows Performance Monitor and on the use of counters in general.
Registration During Installation
By default, the PSQL installation registers the PSQL performance counters with Performance Monitor. The counters are available for use after installation completes.
Note that response to customer needs may result in additional PSQL collector sets or counters being installed that are not discussed in this chapter. If so, refer to the description of the collector set or counter provided in Windows Performance Monitor. See Add Sets or Individual Counters To Monitor.
Data Collector Sets
A data collector set organizes multiple counters into a single component that can be used to review or log performance. PSQL provides the following data collector sets.
PSQL MicroKernel Btrieve Operations
These counters are useful for characterizing the behavior of client applications in terms of the Btrieve API. The counters report the types of operations being processed by the database engine at a given point in time.
See also Btrieve API Operations in Btrieve API Guide.
 
See Btrieve API Operations in Btrieve API Guide for the various Get and Step operations.
PSQL MicroKernel Cache
The database engine uses a two-level memory cache system to increase performance of data operations. The two caches are called Level 1 (L1) Cache and Level 2 (L2) Cache.
The more frequently the engine must read a page from disk to complete a user request, the lower the performance. These counters can be used collectively to view how successfully the database engine avoids disk reads and to determine if any changes need to be made to the cache size settings.
The best performance occurs when all data is stored in the L1 Cache. Because of the sizes of data files, however, the L1 cache cannot always hold all of the data pages, so the database engine also uses a second level cache. Pages in the L2 Cache are stored in a compressed format, allowing for more pages to fit in memory. Consequently, it is lower performing that the L1 Cache, but higher performing than the database engine reading the pages from disk.
See also To calculate the ideal size of the database memory cache.
 
The L2 Cache is one component of the setting for Max MicroKernel Memory Usage. That setting specifies the maximum proportion of total physical memory that the database engine is allowed to consume, which includes L1 Cache, L2 Cache, and all miscellaneous memory usage by the database engine.
If the setting for Max MicroKernel Memory Usage is non-zero, the L2 Cache sizes itself to stay within the memory limit of the setting. The L2 Cache monitors memory consumption of the system and resizes itself as needed. The memory used by the L2 Cache may also be swapped out by the operating system.
PSQL MicroKernel I/O
The counters in this set are useful for understanding the interactions of the database engine and data read and written to physical storage. The pages reported by the counters are data file pages. These counters do not report data for pages in files used for archival logging or for transaction logging.
See also Pages in PSQL Programmer's Guide.
PSQL MicroKernel Locks and Waits
Client requests may be delayed by waiting for a resource to become available. These counters give insight into the types of database resources on which a client request may have to wait until the resource is available. As such, these counters may provide insight into the behavior of the database engine when multiple clients access it. A value close to or equal to the number of clients may indicate collisions for the same resources. Any corrective actions that can be done to alleviate these collisions may improve responsiveness.
The counters Waits on Page Buffers and Waits on Page Reads are waits on a global resource. All of the other counters in this grouping apply to multiple clients, but each client may be waiting on resources that differ from client to client.
See also Data Integrity and Supporting Multiple Clients, both in PSQL Programmer's Guide.
 
PSQL MicroKernel Transactions
These counters are useful for understanding the behavior of client applications in terms of transactions. For example, a few long-lasting transactions that involve many changes cause a different behavior than many short-lived transactions.
See also Begin Transaction (19 or 1019), End Transaction (20), and Abort Transaction (21) in Btrieve API Guide, and MicroKernel Engine Fundamentals in PSQL Programmer's Guide.
 
Using Windows Performance Monitor
This section provides some rudimentary instructions on using Windows Performance Monitor to get started with the PSQL performance counters. Refer to the Microsoft document for complete details on using Windows Performance Monitor.
The following steps assume that the PSQL performance counters have been registered with Windows Performance Monitor by the PSQL installation.
1
Start Windows Performance Monitor. The steps vary depending on the operating system, but generally the utility can be started from Control Panel --> Administrative Tools. You may also try the command “perfmon” in the Run window (Start --> Run).
2
3
1
a.
b.
To view a description of the counter, ensure that the Show description option is selected.
2
Click Add, then OK.
1
2
You may need to adjust the Scale to display two or more counters on the same graph that have vastly different ranges. The counter value is multiplied by the Scale value before the data is graphed. For example, assume that one counter outputs values of 53 and 99, and a second counter outputs 578 and 784. You may want to set the Scale for the first counter to 10 so that its output is 530 and 990. This lets you look at the data from both counters more comparably (530, 990, 578, and 784).
3
Click OK.
Note that the scale on the display changes from its original value (“1” in this example) to the new value (“10” in this example):
4
On the “Graph” tab, set the desired values for Maximum and Minimum of the “Vertical scale.”
You may want to change the vertical scale if what is being graphed is very small (or very large) so you can easily see when the values change. For example, if the counter values are always under 20, you may want to change the vertical scale to be Maximum 20 and Minimum 0.
5
Click OK.