Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitee33fe8

Browse files
author
Neil Conway
committed
Significant improvements to the documentation for the new cost-based
vacuum delay feature, including updating the docs for Tom's recentimprovements. There is still more work to be done here: for example,adding some more information on the practical use of cost-basedvacuum delay to the "maintenance" section would probably be a goodidea.
1 parent11acc1f commitee33fe8

File tree

1 file changed

+95
-71
lines changed

1 file changed

+95
-71
lines changed

‎doc/src/sgml/runtime.sgml

Lines changed: 95 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.239 2004/02/1705:45:17 neilc Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.240 2004/02/1706:28:05 neilc Exp $
33
-->
44

55
<Chapter Id="runtime">
@@ -992,83 +992,107 @@ SET ENABLE_SEQSCAN TO OFF;
992992
</sect3>
993993

994994
<sect3 id="runtime-config-resource-vacuum-cost">
995-
<title>CostBased Vacuum Delay</title>
995+
<title>Cost-Based Vacuum Delay</title>
996996

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>
997+
<para>
998+
During the execution of <command>VACUUM</command>,
999+
<command>VACUUM FULL</command> and <command>ANALYZE</command>,
1000+
the system mantains an internal counter that keeps track of the
1001+
cost of the various I/O operations that are performed. When the
1002+
accumulated cost reaches a limit
1003+
(specified by <varname>vacuum_cost_limit</varname>), the backend performing
1004+
the operation will sleep for a while (specified by
1005+
<varname>vacuum_cost_naptime</varname>). Then it will reset the
1006+
counter and continue execution.
1007+
</para>
10101008

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>
1009+
<para>
1010+
The intent of this feature is to allow administrators the reduce
1011+
the I/O impact of these commands on concurrent database
1012+
activity. There are some situations in which it is not very
1013+
important that maintainence commands like
1014+
<command>VACUUM</command> and <command>ANALYZE</command> finish
1015+
quickly; however, it is usually very important these these
1016+
commands do not significantly interfere with the ability of the
1017+
system to perform other database operations. Cost-based vacuum
1018+
delay provides a way for administrators to achieve this.
1019+
</para>
10191020

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>
1021+
<para>
1022+
This feature is disabled by default. To enable it, set the
1023+
<varname>vacuum_cost_naptime</varname> variable to a reasonable
1024+
value.
1025+
</para>
10311026

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>
1027+
<variablelist>
1028+
<varlistentry>
1029+
<term><varname>vacuum_cost_page_hit</varname> (<type>integer</type>)</term>
1030+
<listitem>
1031+
<para>
1032+
The cost for vacuuming a buffer found in the shared buffer
1033+
cache. It represents the cost to lock the buffer pool, lookup
1034+
the shared hash table and scan the content of the page. The
1035+
default value is 1.
1036+
</para>
1037+
</listitem>
1038+
</varlistentry>
10421039

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>
1040+
<varlistentry>
1041+
<term><varname>vacuum_cost_page_miss</varname> (<type>integer</type>)</term>
1042+
<listitem>
1043+
<para>
1044+
The cost for vacuuming a buffer that has to be read from
1045+
disk. This represents the effort to lock the buffer pool,
1046+
lookup the shared hash table, read the desired block in from
1047+
the disk and scan its content. The default value is 10.
1048+
</para>
1049+
</listitem>
1050+
</varlistentry>
10521051

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>
1052+
<varlistentry>
1053+
<term><varname>vacuum_cost_page_dirty</varname> (<type>integer</type>)</term>
1054+
<listitem>
1055+
<para>
1056+
The extra cost added when vacuum modifies a block that was
1057+
previously clean. It represents the extra I/O required to
1058+
flush the dirty block out to disk again. The default value is
1059+
20.
1060+
</para>
1061+
</listitem>
1062+
</varlistentry>
1063+
1064+
<varlistentry>
1065+
<term><varname>vacuum_cost_limit</varname> (<type>integer</type>)</term>
1066+
<listitem>
1067+
<para>
1068+
The accumulated cost that will cause the backend to briefly
1069+
nap. The default value is 200.
1070+
</para>
1071+
</listitem>
1072+
</varlistentry>
10711073

1074+
<varlistentry>
1075+
<term><varname>vacuum_cost_naptime</varname> (<type>integer</type>)</term>
1076+
<listitem>
1077+
<para>
1078+
The length of time in milliseconds that a backend will nap
1079+
when the cost limit has been exceeded. There are certain bulk
1080+
operations that hold critical locks and should therefore
1081+
complete as quickly as possible. Because of that it is
1082+
possible that the cost actually accumulates far higher than
1083+
this limit. To compensate for this, the final naptime is
1084+
calculated as <varname>vacuum_cost_naptime</varname> *
1085+
<varname>accumulated_balance</varname> /
1086+
<varname>vacuum_cost_limit</varname> with a maximum of
1087+
<varname>vacuum_cost_naptime</varname> * 4.
1088+
</para>
1089+
1090+
<para>
1091+
The default value is 0, which disables the cost-based vacuum
1092+
delay feature.
1093+
</para>
1094+
</listitem>
1095+
</varlistentry>
10721096
</variablelist>
10731097
</sect3>
10741098
</sect2>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp