IBM Support

IBM i Wait Accounting

News


Abstract

IBM i Wait Accounting

Content

Wait Accounting is the patented technology built into the IBM® i operating system that tells you what a thread or task is doing when it appears that it is not doing anything. When a thread or task is not executing, it is waiting. Wait accounting, a concept exclusive to IBM i, is a very powerful capability for detailed performance analysis.

The following resources are available to introduce you to the concept of IBM i Wait Accounting:

Wait Accounting in Collection Services

Beginning in IBM i 6.1, Collection Services reports wait accounting data for jobs, threads, and tasks in the following files:

  • QAPMJOBWT
  • QAPMJOBWTG
  • QAPMJOBWTD

QAPMJOBWT

7.4 Knowledge Center Documentation for QAPMJOBWT

The QAPMJOBWT database file contains information about thread and task wait conditions. The purpose of this file is to account for the time a thread or task spends waiting and to provide some indication as to the type of wait. Since the reasons for a wait are too numerous to handle individually, they are grouped into sets of functionally related waits (also known as wait buckets). For each group, both the number of waits and time spent waiting are reported.

One record is written to the QAPMJOBWT file for each job, thread, or task that consumed CPU during the interval. If a job, thread, or task did not consume any CPU because it was in a wait condition for the entire interval, then a record is written into the QAPMJOBWTG file for the interval instead.

Typically, an individual record in the QAPMJOBWT file contains data for a single thread or task that consumed CPU during the interval. However, tasks and secondary threads that both start and end in an interval and have a lifespan that is shorter than the reporting threshold are not individually reported. For short lifespan secondary threads, data is accumulated by job and one record representing all short lifespan secondary threads for a job is written to QAPMJOBWT. For short lifespan tasks, data is accumulated by resource affinity domain and one record representing all short lifespan tasks for a resource affinity domain is written to QAPMJOBWT. To learn more about how Collection Services reports short lifespan threads and tasks, visit www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/rzahx/rzahxshortlifespanthreadsandtasks.htm

QAPMJOBWT File Format

Field Name Description Attribute
INTNUM Interval number: The nth sample database interval based on the start time specified in the Create Performance Data (CRTPFRDTA) command. PD (5,0)
JWTDE System task identifier. This field can be used to join to field JBTDE in file QAPMJOBMI to obtain additional information about the thread or task associated with this record. X (8)
JWCURT

Current Wait Time: The amount of time, in microseconds, the thread or task has been waiting in the wait condition it was in at collection sample time (the in-progress wait at collection sample time). This time should be less than the collection sample interval because the thread or task has to both wait and consume CPU during the interval for a record to be written into the QAPMJOBWT file

B (9,0)
JWCURE Reserved. B (9,0)
JWCURB Current Counter Set (bucket): The identifier for the wait group the thread or task was waiting in at collection sample time. B (4,0)
JWDSEQ Description sequence number: Identifies the QAPMJOBWTD records associated with this wait data. B (4,0)
JWCT01 Count 1. The number of times the thread or task encountered wait conditions associated with wait group 1. B (9,0)
JWTM01 Time 1. The amount of time, in microseconds, the thread or task spent waiting on waits associated with wait group 1 during the interval. B (9,0)
JWCTnn JWTMnn Count and time are repeated for up to 32 counter sets per record.


QAPMJOBWT Implementation Details

  • The current wait time in field JWCURT will be equal to the wait time in field JWTMnn (where nn is the bucket specified in JWCURB for the in-progress wait) when the current wait was the only wait encountered for that bucket during the entire interval. JWCTnn (where nn is the bucket specified in JWCURB for the in-progress wait) will be zero when the in-progress wait was the only wait encountered for that bucket during the entire interval.
  • The current wait time in field JWCURT will be different than the wait time in field JWTMnn (where nn is the bucket specified in JWCURB for the in-progress wait) when multiple waits occurred during the interval for bucket nn. In this case, field JWCTnn will be non-zero. JWCTnn will contain the number of wait conditions that were encountered for bucket nn during the interval. JWTMnn will contain the total wait time spent waiting on all waits encountered for bucket nn, including the time for the current wait (JWCURT).

QAPMJOBWTG

7.4 Knowledge Center Documentation for QAPMJOBWTG

The QAPMJOBWTG database file contains information about thread and task wait conditions that were not available in the QAPMJOBWT file. The purpose of this file is to account for the time a thread or task encounters long-lasting wait conditions. A long-lasting wait is one where the thread or task was in the same wait condition during the whole interval and therefore did not consume any CPU during the interval.

One record is written to the QAPMJOBWTG file for each job, thread, or task that did not consume any CPU during the interval.

QAPMJOBWTG File Format

Field Name Description Attribute
INTNUM Interval number: The nth sample database interval based on the start time specified in the Create Performance Data (CRTPFRDTA) command. PD (5,0)
JWTDE System task identifier. This field can be used to join to field JBTDE in file QAPMJOBMI to obtain additional information about the thread or task associated with this record. X (8)
JWCURE Reserved. B (9,0)
JWCURT Current Wait Time: The total time, in microseconds, the thread or task has spent in the current wait since the wait began. B (18,0)
JWCURINT Current Wait Time this interval: The time, in microseconds, the thread or task has spent waiting in the current wait during this interval. B (9,0)
JWDSEQ Description sequence number: Identifies the QAPMJOBWTD records associated with this wait data. B (4,0)
JWCURB

Current Counter Set (bucket): If this field is non-zero and positive, it contains the identifier for the wait group the thread or task was waiting in at collection sample time. If this field is zero, wait state information is not available for this job (for example, for the job which has terminated in this interval). In rare cases a value of -1 indicates the data was not obtainable when sampled.

B (4,0)

QAPMJOBWTD

7.4 Knowledge Center Documentation for QAPMJOBWTD

The QAPMJOBWTD database file contains the description of the counter sets found in file QAPMJOBWT.

One record will be written for each active counter set when the first instance of wait data is encountered (normally at the beginning of the collection). Multiple instances of this data are possible during service activities.

QAPMJOBWTD File Format

Field Name Description Attribute
DTETIM Interval date (yymmdd) and time (hhmmss): The date and time of the sample interval providing these descriptions. Normally this is the first interval in the *MGTCOL object. C (12)
DTECEN Century digit: where 0 indicates 19XX and 1 indicates 20XX. C (1)
JWDSEQ Description sequence number: This provides a unique identifier for a set of descriptions. This value is used in file QAPMJOBWT field JWDSEQ to associate counter data with a set of descriptions. Each time updated descriptions are written to this file, this field will contain a new value for that set of descriptions. B (4,0)
JWTNUM Total number of wait counter sets reported. B (4,0)
JWSNBR Counter set number described by this record. B (4,0)
JWDESC Description of the type of data reported in the JWCTnn and JWTMnn fields.
Note: This field is in Unicode.
G (50)

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Component":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
31 January 2020

UID

ibm11171648