Skip to content

Commit f884090

Browse files
Jan WieckJan Wieck
authored andcommitted
Documentation for vacuum_cost config options.
Jan
1 parent 8787bc8 commit f884090

File tree

1 file changed

+82
-1
lines changed

1 file changed

+82
-1
lines changed

doc/src/sgml/runtime.sgml

Lines changed: 82 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.236 2004/02/03 17:34:02 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.237 2004/02/13 12:25:09 wieck Exp $
33
-->
44

55
<Chapter Id="runtime">
@@ -990,6 +990,87 @@ SET ENABLE_SEQSCAN TO OFF;
990990

991991
</variablelist>
992992
</sect3>
993+
994+
<sect3 id="runtime-config-resource-vacuum-cost">
995+
<title>Cost Based Vacuum Delay</title>
996+
997+
<variablelist>
998+
<varlistentry>
999+
<term><varname>vacuum_cost_page_hit</varname> (<type>integer</type>)</term>
1000+
<listitem>
1001+
<para>
1002+
During a default <command>VACUUM</command> (not
1003+
<command>FULL</command>) the system maintains and internal counter
1004+
accumulating the cost of various operations performed. When the
1005+
accumulated cost reaches a limit, the backend performing the
1006+
<command>VACUUM</command> will sleep for a while, reset the
1007+
accumulator and continue. The intention is to lower the IO impact
1008+
of <command>VACUUM</command>.
1009+
</para>
1010+
1011+
<para>
1012+
The variable <varname>vacuum_cost_page_hit</varname> is the cost
1013+
for vacuuming a buffer found inside the shared buffer cache.
1014+
It represents the cost to lock the buffer pool, lookup the
1015+
shared hash table and to actually scan the block content.
1016+
</para>
1017+
</listitem>
1018+
</varlistentry>
1019+
1020+
<varlistentry>
1021+
<term><varname>vacuum_cost_page_miss</varname> (<type>integer</type>)</term>
1022+
<listitem>
1023+
<para>
1024+
The cost for vacuuming a buffer that has to be read from disk.
1025+
This represents the effort to lock the buffer pool, lookup the
1026+
cache directory, reading the block from disk and scanning the
1027+
content.
1028+
</para>
1029+
</listitem>
1030+
</varlistentry>
1031+
1032+
<varlistentry>
1033+
<term><varname>vacuum_cost_page_dirty</varname> (<type>integer</type>)</term>
1034+
<listitem>
1035+
<para>
1036+
This extra cost is added when vacuum modifies a block that was
1037+
clean before. It represents the extra IO required to flush the
1038+
dirty block out to disk again.
1039+
</para>
1040+
</listitem>
1041+
</varlistentry>
1042+
1043+
<varlistentry>
1044+
<term><varname>vacuum_cost_limit</varname> (<type>integer</type>)</term>
1045+
<listitem>
1046+
<para>
1047+
This is the cost limit that must be reached or exceeded before
1048+
the <command>VACUUM</command> will nap.
1049+
</para>
1050+
</listitem>
1051+
</varlistentry>
1052+
1053+
<varlistentry>
1054+
<term><varname>vacuum_cost_naptime</varname> (<type>integer</type>)</term>
1055+
<listitem>
1056+
<para>
1057+
The time im milliseconds the <command>VACUUM</command> will
1058+
nap when the cost limit has been reached or exceeded.
1059+
There are certain bulk operations that hold critical
1060+
locks and should therefore perform
1061+
as quickly as possible. Because of that it is possible that the
1062+
cost actually accumulates far higher than this limit. To compensate
1063+
for this, the final naptime is calculated as
1064+
<varname>vacuum_cost_naptime</varname> *
1065+
<varname>accumulated_balance</varname> /
1066+
<varname>vacuum_cost_limit</varname> with a maximum of
1067+
<varname>vacuum_cost_naptime</varname> * 4.
1068+
</para>
1069+
</listitem>
1070+
</varlistentry>
1071+
1072+
</variablelist>
1073+
</sect3>
9931074
</sect2>
9941075

9951076
<sect2 id="runtime-config-wal">

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy