index f82fbc877def92e787b15238d52547f65d4bb9f0..b4a84616f54ac08e3a191174f116dad70a7419f9 100644 (file)
<!--
-$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.288 2004年10月15日 16:50:29 momjian Exp $
+$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.289 2004年10月17日 22:01:49 tgl Exp $
-->
<Chapter Id="runtime">
<varname>bgwriter_maxpages</varname> reduce the extra I/O load
caused by the background writer, but leave more work to be done
at checkpoint time. To reduce load spikes at checkpoints,
- increase the values.
+ increase the values. To disable background writing entirely,
+ set <varname>bgwriter_percent</varname> and/or
+ <varname>bgwriter_maxpages</varname> to zero.
</para>
</sect3>
index b9d8fc3ad53d06746d5f7071732f949422660771..c96c635d0a6c67b2bac466b9f46c159ac1d571aa 100644 (file)
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.180 2004年10月16日 18:57:23 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.181 2004年10月17日 22:01:50 tgl Exp $
*
*-------------------------------------------------------------------------
*/
*
* This is called at checkpoint time to write out all dirty shared buffers,
* and by the background writer process to write out some of the dirty blocks.
- * percent/maxpages should be zero in the former case, and nonzero limit
- * values in the latter.
+ * percent/maxpages should be -1 in the former case, and limit values (>= 0)
+ * in the latter.
+ *
+ * Returns the number of buffers written.
*/
int
BufferSync(int percent, int maxpages)
int num_buffer_dirty;
int i;
+ /* If either limit is zero then we are disabled from doing anything... */
+ if (percent == 0 || maxpages == 0)
+ return 0;
+
/*
* Get a list of all currently dirty buffers and how many there are.
* We do not flush buffers that get dirtied after we started. They
index 5f3ac94bd50a0fcc3602984a6deb8638b09aec79..5b5a2a309f648cd5b55307383326400a65982280 100644 (file)
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.244 2004年10月16日 19:08:38 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.245 2004年10月17日 22:01:51 tgl Exp $
*
*--------------------------------------------------------------------
*/
NULL
},
&BgWriterDelay,
- 200, 10, 5000, NULL, NULL
+ 200, 10, 10000, NULL, NULL
},
{
NULL
},
&BgWriterPercent,
- 1, 1, 100, NULL, NULL
+ 1, 0, 100, NULL, NULL
},
{
NULL
},
&BgWriterMaxPages,
- 100, 1, 1000, NULL, NULL
+ 100, 0, 1000, NULL, NULL
},
{
index 59004a73c058d1f89801b9fb674a117b74fd60ff..3aed76a411ee03c153390345a56d69562370f696 100644 (file)
# - Background writer -
-#bgwriter_delay = 200 # 10-5000 milliseconds
-#bgwriter_percent = 1 # 1-100% of dirty buffers
-#bgwriter_maxpages = 100 # 1-1000 buffers max at once
+#bgwriter_delay = 200 # 10-10000 milliseconds between rounds
+#bgwriter_percent = 1 # 0-100% of dirty buffers in each round
+#bgwriter_maxpages = 100 # 0-1000 buffers max per round
#---------------------------------------------------------------------------