Chapter 12. Finding and Fixing Problems: the pidiag Utility
2.3 Monitoring Snapshot Data Flow
Windows-based PI Server exposes the Snapshot data displayed by piartool -ss as Windows Performance Counters. These counters may be viewed with the Windows Performance Monitor or recorded to the PI Server with the OSI Performance Monitor Interface.
2.3.1 Listing Current Snapshot Information with piartool -ss
The piartool -ss command lists the current Snapshot information every 5 seconds until you type <CTRL-C>. This utility is a quick way to view the overall state of the PI System. It shows the total number of events received and sent to the archive. (The third column gives the difference in the counters over 5 second periods.)
Under normal steady state conditions, the Snapshot event count as well as archive posts should increase regularly. Events in overflow queue and Event Queue record count should be zero.
Output of piartool -ss should look similar to listing below.
$ piartool -ss
Counters for 7-Aug-03 14:35:56 Point Count: 10033 0 Snapshot Events: 1228011 0 Out of Order Snapshot Events: 130 0 Snapshot Event Reads: 392 0 Events Sent to Queue: 771952 0 Events in Queue: 0 0 Number of Overflow Queues: 0 0 Total Overflow Events: 0 0 Primary Capacity Remaining: 2540349 0
2.3 - Monitoring Snapshot Data Flow
Each of the counters in the output is explained in the following sections.
Note: The piartool utility can monitor a remote PI Server by specifying the -remote
argument after all other arguments. piartool prompts the user for remote connection information.
Point Count
The Point Count is the number of points that are currently defined in the Point Database. It is incremented when a point is created and decremented when a point is deleted.
Snapshot Events Counter
An “Event” is the fundamental PI data element. It represents a value or status of a unique data source at a specific time. Specifically an event is a Value, Timestamp, and PointID. Most events come from PI API- or PI-SDK-based interfaces. The PI Subsystems (“Applications”) PI Batch, PI Performance Equations, PI Total, and PI Alarm, as well as manual input and laboratory systems are also event sources.
Every Snapshot event increments the Snapshot Events Counter. The PI Snapshot Subsystem applies a compression algorithm to every event. The compression algorithm determines if the previous Snapshot event is passed on to the archive.
Out of Order Snapshot Events Counter
Events older than the current Snapshot event are out-of-order events. These events bypass compression and are sent directly to the archive. This counter shows the number of times this has occurred. The Archive Subsystem maintains a similar counter; see the Monitor Archive section in this chapter.
Large out of order event counts might indicate a problem with the PI Server; this may lead to poor performance. A common cause is an erroneous system clock changes of the server machine or a data source machine. To identify the tags receiving out of order data use:
piartool -ooo
This gives a list of all the tags with any out of order events since the Snapshot Subsystem started or since the out of order flags reset. To reset the flags use:
piartool -ooo -r
When the -r flag is used, only tags that received an out-of-order event since the last piartool - ooo query are listed. The utility can run repeatedly with or without the -r flag by specifying a wait time (in seconds) between repeats. This is useful for catching the offending tags as new events come in:
piartool -ooo 10
Whenever a repeat time is specified, a current timestamp appears in the output each time the utility writes data.
When using repeats, the utility is stopped with <CTRL-C>.
7-Aug-03 14:42:12> The following points had out-of-order Snapshot events: 15: pitot1 17: pitot3 18: pitot4 19: pitot5 20: pitot5run 21: pitot5ramp 22: pitot5est 23: pitot_avg 24: pitot_max 25: pitot_min 26: pitot6count 27: pitot6time 28: pitot6timeNE 29: pitot_1
7-Aug-03 14:42:22> No out-of-order Snapshot events found 7-Aug-03 14:42:32> No out-of-order Snapshot events found
Snapshots Events Read Counter
Count of all Snapshot reads. This is a simple measurement of how many Snapshot values are read by all applications.
Events Sent to Queue Counter
Events that pass compression, or are out of order are sent to the Event Queue, and thus increment this counter. Under normal operating conditions this count indicates the number of events that passed the compression test (that is, the events were different from existing events and could not be eliminated) and are being sent to the archive.
The ratio of Snapshot events to Events Sent to Queue is the system aggregate compression ratio. This ratio gives a quick view of overall system compression tuning. Ratios less then 2:1 indicate low compression; a compression tuning evaluation should be performed. Ratios greater than 10:1 indicate over compression; a compression tuning evaluation should also be performed.
Three Point Database attributes affect compression: CompDev, CompMin, and CompMax. These are known as the compression specifications.
If a point has its Compressing point attribute set to FALSE, all new events are sent to the Archive Subsystem.
Events in Queue Counter
Events passed to the EventQueue are put in First-In-First-Out order. The Events in Queue Counter is incremented when the event is put in the Queue; it is decremented when the Archive Subsystem successfully retrieves and processes an event.
When the system is shutdown, the Event Queue is preserved in the file PI\dat\pimapevq.dat. This assures no data loss when the system shuts down or when the archive subsystem is not processing events at the same rate as they come in.