From 249cf070e36721a65be74838c53acf8249faf935 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Sat, 18 Mar 2017 07:43:01 -0400 Subject: Create and use wait events for read, write, and fsync operations. Previous commits, notably 53be0b1add7064ca5db3cd884302dfc3268d884e and 6f3bd98ebfc008cbd676da777bb0b2376c4c4bfa, made it possible to see from pg_stat_activity when a backend was stuck waiting for another backend, but it's also fairly common for a backend to be stuck waiting for an I/O. Add wait events for those operations, too. Rushabh Lathia, with further hacking by me. Reviewed and tested by Michael Paquier, Amit Kapila, Rajkumar Raghuwanshi, and Rahila Syed. Discussion: http://postgr.es/m/CAGPqQf0LsYHXREPAZqYGVkDqHSyjf=KsD=k0GTVPAuzyThh-VQ@mail.gmail.com --- doc/src/sgml/monitoring.sgml | 271 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 271 insertions(+) (limited to 'doc/src') diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index 9eaf43adb1a..9b50fb9c137 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -716,6 +716,12 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser point. + + + IO: The server process is waiting for a IO to complete. + wait_event will identify the specific wait point. + + @@ -1272,6 +1278,271 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser RecoveryApplyDelay Waiting to apply WAL at recovery because it is delayed. + + IO + BufFileRead + Waiting for a read from a buffered file. + + + BufFileWrite + Waiting for a write to a buffered file. + + + ControlFileRead + Waiting for a read from the control file. + + + ControlFileSync + Waiting for the control file to reach stable storage. + + + ControlFileSyncUpdate + Waiting for an update to the control file to reach stable storage. + + + ControlFileWrite + Waiting for a write to the control file. + + + ControlFileWriteUpdate + Waiting for a write to update the control file. + + + CopyFileRead + Waiting for a read during a file copy operation. + + + CopyFileWrite + Waiting for a write during a file copy operation. + + + DataFileExtend + Waiting for a relation data file to be extended. + + + DataFileFlush + Waiting for a relation data file to reach stable storage. + + + DataFileImmediateSync + Waiting for an immediate synchronization of a relation data file to stable storage. + + + DataFilePrefetch + Waiting for an asynchronous prefetch from a relation data file. + + + DataFileRead + Waiting for a read from a relation data file. + + + DataFileSync + Waiting for changes to a relation data file to reach stable storage. + + + DataFileTruncate + Waiting for a relation data file to be truncated. + + + DataFileWrite + Waiting for a write to a relation data file. + + + DSMFillZeroWrite + Waiting to write zero bytes to a dynamic shared memory backing file. + + + LockFileAddToDataDirRead + Waiting for a read while adding a line to the data directory lock file. + + + LockFileAddToDataDirSync + Waiting for data to reach stable storage while adding a line to the data directory lock file. + + + LockFileAddToDataDirWrite + Waiting for a write while adding a line to the data directory lock file. + + + LockFileCreateRead + Waiting to read while creating the data directory lock file. + + + LockFileCreateSync + Waiting for data to reach stable storage while creating the data directory lock file. + + + LockFileCreateWrite + Waiting for a write while creating the data directory lock file. + + + LockFileReCheckDataDirRead + Waiting for a read during recheck of the data directory lock file. + + + LogicalRewriteCheckpointSync + Waiting for logical rewrite mappings to reach stable storage during a checkpoint. + + + LogicalRewriteMappingSync + Waiting for mapping data to reach stable storage during a logical rewrite. + + + LogicalRewriteMappingWrite + Waiting for a write of mapping data during a logical rewrite. + + + LogicalRewriteSync + Waiting for logical rewrite mappings to reach stable storage. + + + LogicalRewriteWrite + Waiting for a write of logical rewrite mappings. + + + RelationMapRead + Waiting for a read of the relation map file. + + + RelationMapSync + Waiting for the relation map file to reach stable storage. + + + RelationMapWrite + Waiting for a write to the relation map file. + + + ReorderBufferRead + Waiting for a read during reorder buffer management. + + + ReorderBufferWrite + Waiting for a write during reorder buffer management. + + + ReorderLogicalMappingRead + Waiting for a read of a logical mapping during reorder buffer management. + + + ReplicationSlotRead + Waiting for a read from a replication slot control file. + + + ReplicationSlotRestoreSync + Waiting for a replication slot control file to reach stable storage while restoring it to memory. + + + ReplicationSlotSync + Waiting for a replication slot control file to reach stable storage. + + + ReplicationSlotWrite + Waiting for a write to a replication slot control file. + + + SLRUFlushSync + Waiting for SLRU data to reach stable storage during a checkpoint or database shutdown. + + + SLRURead + Waiting for a read of an SLRU page. + + + SLRUSync + Waiting for SLRU data to reach stable storage following a page write. + + + SLRUWrite + Waiting for a write of an SLRU page. + + + SnapbuildRead + Waiting for a read of a serialized historical catalog snapshot. + + + SnapbuildSync + Waiting for a serialized historical catalog snapshot to reach stable storage. + + + SnapbuildWrite + Waiting for a write of a serialized historical catalog snapshot. + + + TimelineHistoryFileSync + Waiting for a timeline history file received via streaming replication to reach stable storage. + + + TimelineHistoryFileWrite + Waiting for a write of a timeline history file received via streaming replication. + + + TimelineHistoryRead + Waiting for a read of a timeline history file. + + + TimelineHistorySync + Waiting for a newly created timeline history file to reach stable storage. + + + TimelineHistoryWrite + Waiting for a write of a newly created timeline history file. + + + TwophaseFileRead + Waiting for a read of a two phase state file. + + + TwophaseFileSync + Waiting for a two phase state file to reach stable storage. + + + TwophaseFileWrite + Waiting for a write of a two phase state file. + + + WALBootstrapSync + Waiting for WAL to reach stable storage during bootstrapping. + + + WALBootstrapWrite + Waiting for a write of a WAL page during bootstrapping. + + + WALCopyRead + Waiting for a read when creating a new WAL segment by copying an existing one. + + + WALCopySync + Waiting a new WAL segment created by copying an existing one to reach stable storage. + + + WALCopyWrite + Waiting for a write when creating a new WAL segment by copying an existing one. + + + WALInitSync + Waiting for a newly initialized WAL file to reach stable storage. + + + WALInitWrite + Waiting for a write while initializing a new WAL file. + + + WALRead + Waiting for a read from a WAL file. + + + WALSenderTimelineHistoryRead + Waiting for a read from a timeline history file during walsender timeline command. + + + WALSyncMethodAssign + Waiting for data to reach stable storage while assigning WAL sync method. + + + WALWrite + Waiting for a write to a WAL file. + -- cgit v1.2.3