Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fesyc-0005LH-VK for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Jul 2018 02:11:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fesya-0001fT-RL for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Jul 2018 02:11:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fesyZ-0001fL-92 for pgsql-hackers@lists.postgresql.org; Mon, 16 Jul 2018 02:11:00 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fesyS-0002Cr-Dp for pgsql-hackers@postgresql.org; Mon, 16 Jul 2018 02:10:58 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 5AB0321B90; Sun, 15 Jul 2018 22:10:48 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 15 Jul 2018 22:10:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=c3HfYRqcG9KaJuDE5kCrTun74L072Fh6MHP60sV1c0o=; b=kSZseM8d MErQfZ4zDLZvJIDpD8rp9/Us7k+Tt9Vu3uU8i0mrjFhAxjAQwGWm2WpRuAaw31Z5 G2kAaNwTGVxEsq2EliDg5AA/pB33vPCpOAZuTD8HJ2+cl9YuBkxyjV0zHVk+zn/a IlgHoutnvvuHZFl88cW5X5DKWPRu98L5xlMW0omCO7A2DTLeNf792gb0/I1Pev9B TTs82g43OX+ecRIKqjdHEllKop0bIusoo6RaDhz/FlfcsNR3SPwz5IMexL022vDJ C5QSYgVRaQ1dUcLY24UJxb8q/0vRCj3chXKpYoATb52uyhbRQXo3OoZPkXCK1oKS Fh7aIV+f7T7e1A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=c3HfYRqcG9KaJuDE5kCrTun74L072 Fh6MHP60sV1c0o=; b=P+yp6fLHyzclfpj8pmxaUNavAixR/tgVNdZ2f8JvMacuV uGEpjCVitJ7EH9ZBaME6WT8mZDGgKFka2FvLWn39WnU1Ke/nGZgo4+2ZgudVMXbO LG+EZUQ8ZzQaI+S9T55ULC11Vw97SeJC95E7aP995hm58tMkjpyQOzDhpfDOQhZh Of4/aPhUhNkpt4WMk0opHVHyAwREeH4PRf5Z/yaVBOxg6PepNR0MyK89E7XLLTzi bsqrfZ/qBjXHl3VAOO8eWjRVSU0ez7lC/ZFGD8VhNGxTdc0XWQAbSJnro0uTv/+i 0DC8Z3iUQ3e4yFEDWoT7sheGm0zERmyDQ8Iwwn07Q== X-ME-Proxy: X-ME-Sender: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 534D7E405A; Sun, 15 Jul 2018 22:10:45 -0400 (EDT) Date: Mon, 16 Jul 2018 11:10:36 +0900 From: Michael Paquier To: Postgres hackers Cc: Peter Geoghegan , Alvaro Herrera , Tom Lane , Julien Rouhaud , Robert Haas Subject: Refactor documentation for wait events (Was: pgsql: Add wait event for fsync of WAL segments) Message-ID: <20180716021036.GA2853@paquier.xyz> References: <14633.1531149383@sss.pgh.pa.us> <20180709182433.wysgm7rizw2xkp4i@alvherre.pgsql> <20180709214112.GA1661@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="0ntfKIWw70PvrIHh" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --0ntfKIWw70PvrIHh Content-Type: multipart/mixed; boundary="+HP7ph2BbKc20aGI" Content-Disposition: inline --+HP7ph2BbKc20aGI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 13, 2018 at 04:57:59PM -0500, Robert Haas wrote: > On Mon, Jul 9, 2018 at 4:41 PM, Michael Paquier wro= te: >> Another idea that I have here, is to rework the page for monitoring >> stats so as we create one sub-section for each system view, and also one >> for the table of wait events. For the wait events, we could then >> completely remove the first category column which has morerows and >> divide the section into on table per event category. >=20 > +1 from me. I think I proposed that before. Attached is a proof of concept of that. I have divided the "Viewing Statistics" section into a subset for each catalog, and each wait event type gains its sub-section as well. There is a bit more to do with the indentation and some xreflabels, but I think that this is enough to begin a discussion. Thoughts? -- Michael --+HP7ph2BbKc20aGI Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="wait-event-doc-refactor.patch" Content-Transfer-Encoding: quoted-printable diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index 0484cfa77a..ebb5ee3ba3 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -549,8 +549,9 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 1= 1:34 0:00 postgres: ser into the kernel's handling of I/O. =20 - - + + pg_stat_activity +
<structname>pg_stat_activity</structname> View =20 @@ -731,7 +732,7 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 1= 1:34 0:00 postgres: ser wait_event text Wait event name if backend is currently waiting, otherwise NUL= L. - See for details. + See the set of wait events below for details. @@ -831,13 +832,14 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss = 11:34 0:00 postgres: ser =20 -
- <structname>wait_event</structname> Description + + LWLock wait events +
+ LWLock <structname>wait_event</structname> Description =20 - + - Wait Event Type Wait Event Name Description @@ -845,7 +847,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 1= 1:34 0:00 postgres: ser =20 - LWLock ShmemIndexLock Waiting to find or allocate space in shared memory. @@ -1126,8 +1127,26 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss = 11:34 0:00 postgres: ser Waiting to allocate or exchange a chunk of memory or update counters during Parallel Hash plan execution. + + +
+ + + + Lock wait events + + Lock <structname>wait_event</structname> Description + + + + + Wait Event Name + Description + + + + - Lock relation Waiting to acquire a lock on a relation. @@ -1168,12 +1187,29 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss= 11:34 0:00 postgres: ser Waiting to acquire an advisory user lock. - BufferPin BufferPin Waiting to acquire a pin on a buffer. + + +
+
+ + + Activity wait events + + Activity <structname>wait_event</structname> Description + + + + + Wait Event Name + Description + + + + - Activity ArchiverMain Waiting in main loop of the archiver process. @@ -1229,8 +1265,26 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss = 11:34 0:00 postgres: ser WalWriterMainWaiting in main loop of WAL writer process. + + +
+
+ + + Client wait events + + Client <structname>wait_event</structname> Description + + + + + Wait Event Name + Description + + + + - Client ClientRead Waiting to read data from the client. @@ -1263,12 +1317,29 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss= 11:34 0:00 postgres: ser Waiting for any activity when processing replies from WAL = receiver in WAL sender process. - Extension Extension Waiting in an extension. + + +
+
+ + + IPC wait events + + IPC <structname>wait_event</structname> Description + + + + + Wait Event Name + Description + + + + - IPC BgWorkerShutdown Waiting for background worker to shut down. @@ -1404,8 +1475,25 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss = 11:34 0:00 postgres: ser SyncRepWaiting for confirmation from remote server during synchro= nous replication. + + +
+
+ + + Timeout wait events + + Timeout <structname>wait_event</structname> Description + + + + + Wait Event Name + Description + + + - Timeout BaseBackupThrottle Waiting during base backup when throttling activity. @@ -1417,8 +1505,25 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss = 11:34 0:00 postgres: ser RecoveryApplyDelayWaiting to apply WAL at recovery because it is delayed. + + +
+
+ + + IO wait events + + IO <structname>wait_event</structname> Description + + + + + Wait Event Name + Description + + + - IO BufFileRead Waiting for a read from a buffered file. @@ -1713,8 +1818,12 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat= _activity WHERE wait_event i (2 rows) + + =20 -
+ + pg_stat_replication +
<structname>pg_stat_replication</structname> View @@ -1961,8 +2070,11 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat= _activity WHERE wait_event i as missing data, zero or continue to display the last known value. + =20 -
+ + pg_stat_wal_receiver +
<structname>pg_stat_wal_receiver</structname> View @@ -2071,8 +2183,11 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat= _activity WHERE wait_event i one row, showing statistics about the WAL receiver from that receiver's connected server. + =20 -
+ + pg_stat_subcription +
<structname>pg_stat_subscription</structname> View @@ -2144,8 +2259,11 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat= _activity WHERE wait_event i not running), and additional rows for workers handling the initial data copy of the subscribed tables. + =20 -
+ + pg_stat_ssl +
<structname>pg_stat_ssl</structname> View @@ -2213,9 +2331,11 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat= _activity WHERE wait_event i pid column to get more details about the connection. + =20 - -
+ + pg_stat_archiver +
<structname>pg_stat_archiver</structname> View =20 @@ -2271,8 +2391,11 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat= _activity WHERE wait_event i The pg_stat_archiver view will always have a single row, containing data about the archiver process of the cluster. - -
+ + =20 + + pg_stat_bgwriter +
<structname>pg_stat_bgwriter</structname> View =20 @@ -2358,8 +2481,11 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat= _activity WHERE wait_event i The pg_stat_bgwriter view will always have a single row, containing global data for the cluster. + =20 -
+ + pg_stat_database +
<structname>pg_stat_database</structname> View @@ -2495,8 +2621,11 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat= _activity WHERE wait_event i The pg_stat_database view will contain one row for each database in the cluster, showing database-wide statistics. + =20 -
+ + pg_stat_database_conflicts +
<structname>pg_stat_database_conflicts</structname> View @@ -2559,8 +2688,11 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat= _activity WHERE wait_event i This view will only contain information on standby servers, since conflicts do not occur on master servers. + =20 -
+ + pg_stat_all_tables +
<structname>pg_stat_all_tables</structname> View @@ -2702,8 +2834,11 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat= _activity WHERE wait_event i contain the same information, but filtered to only show user and system tables respectively. + =20 -
+ + pg_stat_all_indexes +
<structname>pg_stat_all_indexes</structname> View @@ -2798,8 +2933,11 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat= _activity WHERE wait_event i heap fetches are avoided by means of an index-only scan. + =20 -
+ + pg_statio_all_tables +
<structname>pg_statio_all_tables</structname> View @@ -2879,8 +3017,11 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat= _activity WHERE wait_event i contain the same information, but filtered to only show user and system tables respectively. + =20 -
+ + pg_statio_all_indexes +
<structname>pg_statio_all_indexes</structname> View @@ -2940,8 +3081,11 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat= _activity WHERE wait_event i contain the same information, but filtered to only show user and system indexes respectively. + =20 -
+ + pg_statio_all_sequences +
<structname>pg_statio_all_sequences</structname> View @@ -2987,8 +3131,11 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat= _activity WHERE wait_event i one row for each sequence in the current database, showing statistics about I/O on that specific sequence. + =20 -
+ + pg_stat_user_functions +
<structname>pg_stat_user_functions</structname> View @@ -3042,6 +3189,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_= activity WHERE wait_event i that function. The parameter controls exactly which functions are tracked. + =20 =20 @@ -3259,7 +3407,7 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid, pg_stat_get_backend_wait_event_type(integ= er) text Wait event type name if backend is currently waiting, other= wise NULL. - See for details. + See for details. =20 @@ -3267,7 +3415,7 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid, pg_stat_get_backend_wait_event(integer) text Wait event name if backend is currently waiting, otherwise N= ULL. - See for details. + See for details. =20 --+HP7ph2BbKc20aGI-- --0ntfKIWw70PvrIHh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAltL/psACgkQnvQgOdby QH1TRw//RhojwT/nQFHsyrEGc5hwI1BigTzIncya3SGM4SVfxlC4Jmnu+Whccgq9 Fsx3tOY5xwQ9VBZe1LVTaCekdICAqbXw8k9joqnvn0jtuFzAAD7XQYwMyDJgrALj CGTcN/iBPs+BujbS3oAVUxhhGGdxO9I5Vhu2aWXaiN7PvbKY/eafG4ikuxMTvU0A X5t5h2CvVSKTZTTBXrzRy/mIaozYhFG3is8NlvdpqgsIZArpSPiB3oAN8J1KlOja UAbWfhDHTlcXHaISsWtBRdir51pUkd2HDQQO05mZXGKs3IEMwvaISPGG+Ecsw37s vIQtXxfYpbxxgCVRwN1RUY99TFzThojiq63dtilpQcw7wwrDDR3cQ/lGltduxlHT Mz9v18V7wGFBNrerLP72L6tLDfPAYdHkEzNCkkw2TVcv/CUbtkdVfhq6jWrUfb4L /nIK7rLu1+kDIs8FmwoSQtcP7wQWS43P7jqj/L7We3YNh5EMhyI/emAdtrs+2rzj R4hVyOGkdIEuPNRUY4/rNq4+wD4sySZrTpoTTz1QymIH6woG1EbtUidAiembWgh8 vXkbBcAs+2WAbioRfVd1Geo8kluXhrirwFStRo2t5KJdhyXqonspVA1j2vKPm2P9 qu2u1GCQq4tDL+U/HQjiyQeUnEHEW6TBt1n5mEDtyOZ6uMZUOKM= =zquz -----END PGP SIGNATURE----- --0ntfKIWw70PvrIHh--