|
Measures reported by PgWaitEvtTypTest
Wait events are invented to capture the information of system blocks or waits to perform some action like waiting for another backend process to release the heavyweight or lightweight locks, waits to access data buffer when no other process can be examining the buffer, waits to read or write the data to disk, etc. The following list describes each of the wait event types in PoatgreSQL server.
| Wait Event Type |
Description |
| Activity |
The server process is idle. This event type indicates a process waiting for activity in its main processing loop. wait_event will identify the specific wait point. |
| BufferPin |
The server process is waiting for exclusive access to a data buffer. Buffer pin waits can be protracted if another process holds an open cursor that last read data from the buffer in question. |
| Client |
The server process is waiting for activity on a socket connected to a user application. Thus, the server expects something to happen that is independent of its internal processes. wait_event will identify the specific wait point. |
| Extension |
The server process is waiting for some condition defined by an extension module. |
| IO |
The server process is waiting for an I/O operation to complete. wait_event will identify the specific wait point. |
| IPC |
The server process is waiting for some interaction with another server process. wait_event will identify the specific wait point; |
| Lock |
The server process is waiting for a heavyweight lock. Heavyweight locks, also known as lock manager locks or simply locks, primarily protect SQL-visible objects such as tables. However, they are also used to ensure mutual exclusion for certain internal operations such as relation extension. wait_event will identify the type of lock awaited; |
| LWLock |
The server process is waiting for a lightweight lock. Most such locks protect a particular data structure in shared memory. wait_event will contain a name identifying the purpose of the lightweight lock. (Some locks have specific names; others are part of a group of locks each with a similar purpose). |
| Timeout |
The server process is waiting for a timeout to expire. wait_event will identify the specific wait point. |
Since wait events are resource-drains and serious performance degraders, administrators need to keep a close eye on these wait event types, figure out how much time the PostgreSQL database server actually spends waiting for each type, and rapidly decipher why, so that measures can be initiated to minimize these events. To achieve this, you can use the PgWaitEvtTypTest. This test reports the time spent by the PostgreSQL server waiting for events of each wait event types, helps identify those wait event types with wait events that have remained active for a long time, and also reveals the number of sessions that have been impacted by the waiting. With the help of the detailed diagnostics of this test, you can also zoom into these sessions and identify the queries that they executed that may have caused wait events to occur; this way, inefficient queries can be isolated.
Outputs of the test: One set of results for each wait event type in the target database server being monitored.
Descriptor: Wait Event Type
The measures made by this test are as follows:
| Measurement |
Description |
Measurement Unit |
Interpretation |
| NumberOfWaitEventTypes |
Indicates the number of times wait events on this type occured in the target database server. |
Number |
If the value of this measure is very high, then you can drill down further using the detailed diagnosis capability (if enabled) of the eG Enterprise suite to discover which current connections may be responsible for this.
The detailed diagnosis of this measure shows that information about the PID, Waiting Username, Database name,Application name, Waiting client address, Session status, Status change time, Wait event type, Wait duration(in seconds), Query start time, and SQL text.
|
| MaxWaitTime |
Indicates the maximum wait time for this wait event type. |
Seconds |
A low value is desired for this measure.
|
| WaitingTimePercentage |
Indicates the percentage of total wait time (across wait event types) during which wait events on this type occurred. |
Percent |
Calculation = (Sum of wait time of info / Sum of wait time all info) * 100
|
|