Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hrURf-0007bT-HP for pgsql-bugs@arkaria.postgresql.org; Sat, 27 Jul 2019 21:41:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hrURd-00055B-Kj for pgsql-bugs@arkaria.postgresql.org; Sat, 27 Jul 2019 21:41:37 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1hrURd-00053B-BA for pgsql-bugs@lists.postgresql.org; Sat, 27 Jul 2019 21:41:37 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hrURZ-0007eK-II for pgsql-bugs@lists.postgresql.org; Sat, 27 Jul 2019 21:41:36 +0000 Received: from bruce by momjian.us with local (Exim 4.89) (envelope-from ) id 1hrURW-00041z-AV; Sat, 27 Jul 2019 17:41:30 -0400 Date: Sat, 27 Jul 2019 17:41:30 -0400 From: Bruce Momjian To: Alvaro Herrera Cc: Daniel Gustafsson , basil.bourque@gmail.com, PostgreSQL mailing lists Subject: Re: BUG #15912: The units of `autovacuum_vacuum_cost_delay` setting should be documented Message-ID: <20190727214130.bjgyv2holjng3oeb@momjian.us> References: <20190726220242.GA16906@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="m6wz5mc25st5pqev" Content-Disposition: inline In-Reply-To: <20190726220242.GA16906@alvherre.pgsql> User-Agent: NeoMutt/20170113 (1.7.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --m6wz5mc25st5pqev Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Jul 26, 2019 at 06:02:42PM -0400, Alvaro Herrera wrote: > Now you could complain that this is inconsistent with other > descriptions; for example, log_autovacuum_min_duration talks about > milliseconds, which sounds a bit archaic to me: > > Causes each action executed by autovacuum to be logged if it ran for > at least the specified number of milliseconds. Setting this to zero > logs all autovacuum actions. -1 (the default) disables logging > autovacuum actions. For example, if you set this to 250ms then all > automatic vacuums and analyzes that run 250ms or longer will be > logged. In addition, when this parameter is set to any value other > than -1, a message will be logged if an autovacuum action is skipped > due to a conflicting lock or a concurrently dropped relation. > Enabling this parameter can be helpful in tracking autovacuum > activity. This parameter can only be set in the postgresql.conf file > or on the server command line; but the setting can be overridden for > individual tables by changing table storage parameters. > > > I'm not really sure what's a good way to attack this problem, but I > doubt that focusing on just one description is a sufficient solution. Yes, I looked at this earlier in the week and had the same conclusion. I went over config.sgml and saw many inconsistencies of the same type being complained about here. I went through the file and found a number of cases using milliseconds and kilobytes that were unclear, and adjusted them. I dealt only with the cases where the base unit (seconds/bytes) was not the default unit. Patch attached. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription + --m6wz5mc25st5pqev Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="default.diff" diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index c91e3e1550..15d0a75d4c 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -947,7 +947,7 @@ include_dir 'conf.d' - Specifies the number of milliseconds that transmitted data may + Specifies duration (defaults to milliseconds) that transmitted data may remain unacknowledged before a connection is forcibly closed. A value of 0 uses the system default. This parameter is supported only on systems that support @@ -1805,7 +1805,7 @@ include_dir 'conf.d' for temporary files, such as sort and hash temporary files, or the storage file for a held cursor. A transaction attempting to exceed this limit will be canceled. - The value is specified in kilobytes, and -1 (the + The default unit is kilobytes, and -1 (the default) means no limit. Only superusers can change this setting. @@ -1893,7 +1893,7 @@ include_dir 'conf.d' - The length of time, in milliseconds, that the process will sleep + The duration (defaults to milliseconds) that the process will sleep when the cost limit has been exceeded. The default value is zero, which disables the cost-based vacuum delay feature. Positive values enable cost-based vacuuming. @@ -2018,11 +2018,11 @@ include_dir 'conf.d' - Specifies the delay between activity rounds for the + Specifies the delay (defaults to milliseconds) between activity rounds for the background writer. In each round the writer issues writes for some number of dirty buffers (controllable by the following parameters). It then sleeps for bgwriter_delay - milliseconds, and repeats. When there are no dirty buffers in the + duration, and repeats. When there are no dirty buffers in the buffer pool, though, it goes into a longer sleep regardless of bgwriter_delay. The default value is 200 milliseconds (200ms). Note that on many systems, the @@ -2781,9 +2781,10 @@ include_dir 'conf.d' Specifies how often the WAL writer flushes WAL. After flushing WAL it - sleeps for wal_writer_delay milliseconds, unless woken up + sleeps for wal_writer_delay duration (defaults + to milliseconds), unless woken up by an asynchronously committing transaction. If the last flush - happened less than wal_writer_delay milliseconds ago and + happened less than wal_writer_delay duration ago and less than wal_writer_flush_after bytes of WAL have been produced since, then WAL is only written to the operating system, not flushed to disk. @@ -2806,7 +2807,8 @@ include_dir 'conf.d' Specifies how often the WAL writer flushes WAL. If the last flush - happened less than wal_writer_delay milliseconds ago and + happened less than wal_writer_delay duration ago + (defaults to milliseconds) and less than wal_writer_flush_after bytes of WAL have been produced since, then WAL is only written to the operating system, not flushed to disk. If wal_writer_flush_after is set @@ -3659,7 +3661,7 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows Terminate replication connections that are inactive longer - than the specified number of milliseconds. This is useful for + than the specified duration (defaults to milliseconds). This is useful for the sending server to detect a standby crash or network outage. A value of zero disables the timeout mechanism. The default value is 60 seconds. With a cluster distributed across multiple geographic @@ -4111,7 +4113,7 @@ ANY num_sync ( for more details about this. @@ -8490,7 +8492,7 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir' - This is the amount of time, in milliseconds, to wait on a lock + This is the duration (defaults to milliseconds), to wait on a lock before checking to see if there is a deadlock condition. The check for deadlock is relatively expensive, so the server doesn't run it every time it waits for a lock. We optimistically assume @@ -8509,7 +8511,7 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir' When is set, - this parameter also determines the length of time to wait before + this parameter also determines the duration to wait before a log message is issued about the lock wait. If you are trying to investigate locking delays you might want to set a shorter than normal deadlock_timeout. --m6wz5mc25st5pqev--