1
1
<!--
2
- $PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.306 2005/03/02 19:58:54 tgl Exp $
2
+ $PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.307 2005/03/04 20:21:05 tgl Exp $
3
3
-->
4
4
5
5
<chapter Id="runtime">
@@ -1379,9 +1379,7 @@ SET ENABLE_SEQSCAN TO OFF;
1379
1379
Specifies the delay between activity rounds for the
1380
1380
background writer. In each round the writer issues writes
1381
1381
for some number of dirty buffers (controllable by the
1382
- following parameters). The selected buffers will always be
1383
- the least recently used ones among the currently dirty
1384
- buffers. It then sleeps for <varname>bgwriter_delay</>
1382
+ following parameters). It then sleeps for <varname>bgwriter_delay</>
1385
1383
milliseconds, and repeats. The default value is 200. Note
1386
1384
that on many systems, the effective resolution of sleep
1387
1385
delays is 10 milliseconds; setting <varname>bgwriter_delay</>
@@ -1393,46 +1391,97 @@ SET ENABLE_SEQSCAN TO OFF;
1393
1391
</listitem>
1394
1392
</varlistentry>
1395
1393
1396
- <varlistentry id="guc-bgwriter-percent" xreflabel="bgwriter_percent ">
1397
- <term><varname>bgwriter_percent </varname> (<type>integer </type>)</term>
1394
+ <varlistentry id="guc-bgwriter-lru- percent" xreflabel="bgwriter_lru_percent ">
1395
+ <term><varname>bgwriter_lru_percent </varname> (<type>floating point </type>)</term>
1398
1396
<indexterm>
1399
- <primary><varname>bgwriter_percent </> configuration parameter</primary>
1397
+ <primary><varname>bgwriter_lru_percent </> configuration parameter</primary>
1400
1398
</indexterm>
1401
1399
<listitem>
1402
1400
<para>
1403
- In each round, no more than this percentage of the currently
1404
- dirty buffers will be written (rounding up any fraction to
1405
- the next whole number of buffers). The default value is
1406
- 1. This option can only be set at server start or in the
1401
+ To reduce the probability that server processes will need to issue
1402
+ their own writes, the background writer tries to write buffers that
1403
+ are likely to be recycled soon. In each round, it examines up to
1404
+ <varname>bgwriter_lru_percent</> of the buffers that are nearest to
1405
+ being recycled, and writes any that are dirty.
1406
+ The default value is 1.0 (this is a percentage of the total number
1407
+ of shared buffers).
1408
+ This option can only be set at server start or in the
1409
+ <filename>postgresql.conf</filename> file.
1410
+ </para>
1411
+ </listitem>
1412
+ </varlistentry>
1413
+
1414
+ <varlistentry id="guc-bgwriter-lru-maxpages" xreflabel="bgwriter_lru_maxpages">
1415
+ <term><varname>bgwriter_lru_maxpages</varname> (<type>integer</type>)</term>
1416
+ <indexterm>
1417
+ <primary><varname>bgwriter_lru_maxpages</> configuration parameter</primary>
1418
+ </indexterm>
1419
+ <listitem>
1420
+ <para>
1421
+ In each round, no more than this many buffers will be written
1422
+ as a result of scanning soon-to-be-recycled buffers.
1423
+ The default value is 5.
1424
+ This option can only be set at server start or in the
1425
+ <filename>postgresql.conf</filename> file.
1426
+ </para>
1427
+ </listitem>
1428
+ </varlistentry>
1429
+
1430
+ <varlistentry id="guc-bgwriter-all-percent" xreflabel="bgwriter_all_percent">
1431
+ <term><varname>bgwriter_all_percent</varname> (<type>floating point</type>)</term>
1432
+ <indexterm>
1433
+ <primary><varname>bgwriter_all_percent</> configuration parameter</primary>
1434
+ </indexterm>
1435
+ <listitem>
1436
+ <para>
1437
+ To reduce the amount of work that will be needed at checkpoint time,
1438
+ the background writer also does a circular scan through the entire
1439
+ buffer pool, writing buffers that are found to be dirty.
1440
+ In each round, it examines up to
1441
+ <varname>bgwriter_all_percent</> of the buffers for this purpose.
1442
+ The default value is 0.333 (this is a percentage of the total number
1443
+ of shared buffers). With the default <varname>bgwriter_delay</>
1444
+ setting, this will allow the entire shared buffer pool to be scanned
1445
+ about once per minute.
1446
+ This option can only be set at server start or in the
1407
1447
<filename>postgresql.conf</filename> file.
1408
1448
</para>
1409
1449
</listitem>
1410
1450
</varlistentry>
1411
1451
1412
- <varlistentry id="guc-bgwriter-maxpages" xreflabel="bgwriter_maxpages ">
1413
- <term><varname>bgwriter_maxpages </varname> (<type>integer</type>)</term>
1452
+ <varlistentry id="guc-bgwriter-all- maxpages" xreflabel="bgwriter_all_maxpages ">
1453
+ <term><varname>bgwriter_all_maxpages </varname> (<type>integer</type>)</term>
1414
1454
<indexterm>
1415
- <primary><varname>bgwriter_maxpages </> configuration parameter</primary>
1455
+ <primary><varname>bgwriter_all_maxpages </> configuration parameter</primary>
1416
1456
</indexterm>
1417
1457
<listitem>
1418
1458
<para>
1419
- In each round, no more than this many dirty buffers will be
1420
- written. The default value is 100. This option can only be
1421
- set at server start or in the
1459
+ In each round, no more than this many buffers will be written
1460
+ as a result of the scan of the entire buffer pool. (If this
1461
+ limit is reached, the scan stops, and resumes at the next buffer
1462
+ during the next round.)
1463
+ The default value is 5.
1464
+ This option can only be set at server start or in the
1422
1465
<filename>postgresql.conf</filename> file.
1423
1466
</para>
1424
1467
</listitem>
1425
1468
</varlistentry>
1426
1469
</variablelist>
1427
1470
1428
1471
<para>
1429
- Smaller values of <varname>bgwriter_percent </varname> and
1430
- <varname>bgwriter_maxpages </varname> reduce the extra I/O load
1472
+ Smaller values of <varname>bgwriter_all_percent </varname> and
1473
+ <varname>bgwriter_all_maxpages </varname> reduce the extra I/O load
1431
1474
caused by the background writer, but leave more work to be done
1432
1475
at checkpoint time. To reduce load spikes at checkpoints,
1433
- increase the values. To disable background writing entirely,
1434
- set <varname>bgwriter_percent</varname> and/or
1435
- <varname>bgwriter_maxpages</varname> to zero.
1476
+ increase these two values.
1477
+ Similarly, smaller values of <varname>bgwriter_lru_percent</varname> and
1478
+ <varname>bgwriter_lru_maxpages</varname> reduce the extra I/O load
1479
+ caused by the background writer, but make it more likely that server
1480
+ processes will have to issue writes for themselves, delaying interactive
1481
+ queries.
1482
+ To disable background writing entirely,
1483
+ set both <varname>maxpages</varname> values and/or both
1484
+ <varname>percent</varname> values to zero.
1436
1485
</para>
1437
1486
</sect3>
1438
1487
@@ -3866,20 +3915,6 @@ plruby.bar = true # generates error, unknown class name
3866
3915
</listitem>
3867
3916
</varlistentry>
3868
3917
3869
- <varlistentry id="guc-debug-shared-buffers" xreflabel="debug_shared_buffers">
3870
- <term><varname>debug_shared_buffers</varname> (<type>integer</type>)</term>
3871
- <indexterm>
3872
- <primary><varname>debug_shared_buffers</> configuration parameter</primary>
3873
- </indexterm>
3874
- <listitem>
3875
- <para>
3876
- Number of seconds between ARC reports.
3877
- If set greater than zero, emit ARC statistics to the log every so many
3878
- seconds. Zero (the default) disables reporting.
3879
- </para>
3880
- </listitem>
3881
- </varlistentry>
3882
-
3883
3918
<varlistentry id="guc-pre-auth-delay" xreflabel="pre_auth_delay">
3884
3919
<term><varname>pre_auth_delay</varname> (<type>integer</type>)</term>
3885
3920
<indexterm>
0 commit comments