summaryrefslogtreecommitdiff
path: root/src/backend/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils')
-rw-r--r--src/backend/utils/misc/guc.c46
-rw-r--r--src/backend/utils/misc/postgresql.conf.sample6
-rw-r--r--src/backend/utils/resowner/resowner.c9
3 files changed, 33 insertions, 28 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index e2ce29ed9a..b9486e8663 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.253 2005/03/01 20:23:34 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.254 2005/03/04 20:21:06 tgl Exp $
*
*--------------------------------------------------------------------
*/
@@ -77,7 +77,6 @@ extern bool Log_disconnections;
extern DLLIMPORT bool check_function_bodies;
extern int CommitDelay;
extern int CommitSiblings;
-extern int DebugSharedBuffers;
extern char *default_tablespace;
static const char *assign_log_destination(const char *value,
@@ -1231,15 +1230,6 @@ static struct config_int ConfigureNamesInt[] =
},
{
- {"debug_shared_buffers", PGC_POSTMASTER, STATS_MONITORING,
- gettext_noop("Interval to report shared buffer status in seconds"),
- NULL
- },
- &DebugSharedBuffers,
- 0, 0, 600, NULL, NULL
- },
-
- {
{"bgwriter_delay", PGC_SIGHUP, RESOURCES,
gettext_noop("Background writer sleep time between rounds in milliseconds"),
NULL
@@ -1249,21 +1239,21 @@ static struct config_int ConfigureNamesInt[] =
},
{
- {"bgwriter_percent", PGC_SIGHUP, RESOURCES,
- gettext_noop("Background writer percentage of dirty buffers to flush per round"),
+ {"bgwriter_lru_maxpages", PGC_SIGHUP, RESOURCES,
+ gettext_noop("Background writer maximum number of all pages to flush per round"),
NULL
},
- &BgWriterPercent,
- 1, 0, 100, NULL, NULL
+ &bgwriter_lru_maxpages,
+ 5, 0, 1000, NULL, NULL
},
{
- {"bgwriter_maxpages", PGC_SIGHUP, RESOURCES,
- gettext_noop("Background writer maximum number of pages to flush per round"),
+ {"bgwriter_all_maxpages", PGC_SIGHUP, RESOURCES,
+ gettext_noop("Background writer maximum number of LRU pages to flush per round"),
NULL
},
- &BgWriterMaxPages,
- 100, 0, 1000, NULL, NULL
+ &bgwriter_all_maxpages,
+ 5, 0, 1000, NULL, NULL
},
{
@@ -1395,6 +1385,24 @@ static struct config_real ConfigureNamesReal[] =
},
{
+ {"bgwriter_lru_percent", PGC_SIGHUP, RESOURCES,
+ gettext_noop("Background writer percentage of LRU buffers to flush per round"),
+ NULL
+ },
+ &bgwriter_lru_percent,
+ 1.0, 0.0, 100.0, NULL, NULL
+ },
+
+ {
+ {"bgwriter_all_percent", PGC_SIGHUP, RESOURCES,
+ gettext_noop("Background writer percentage of all buffers to flush per round"),
+ NULL
+ },
+ &bgwriter_all_percent,
+ 0.333, 0.0, 100.0, NULL, NULL
+ },
+
+ {
{"seed", PGC_USERSET, UNGROUPED,
gettext_noop("Sets the seed for random-number generation."),
NULL,
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
index 86640efa7d..74a029e657 100644
--- a/src/backend/utils/misc/postgresql.conf.sample
+++ b/src/backend/utils/misc/postgresql.conf.sample
@@ -99,8 +99,10 @@
# - Background writer -
#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
+#bgwriter_lru_percent = 1.0 # 0-100% of LRU buffers scanned in each round
+#bgwriter_lru_maxpages = 5 # 0-1000 buffers max written per round
+#bgwriter_all_percent = 0.333 # 0-100% of all buffers scanned in each round
+#bgwriter_all_maxpages = 5 # 0-1000 buffers max written per round
#---------------------------------------------------------------------------
diff --git a/src/backend/utils/resowner/resowner.c b/src/backend/utils/resowner/resowner.c
index 5f1f99f703..f3063ed9d9 100644
--- a/src/backend/utils/resowner/resowner.c
+++ b/src/backend/utils/resowner/resowner.c
@@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/resowner/resowner.c,v 1.9 2004/12/31 22:02:50 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/resowner/resowner.c,v 1.10 2005/03/04 20:21:06 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -200,12 +200,7 @@ ResourceOwnerReleaseInternal(ResourceOwner owner,
* that would indicate failure to clean up the executor correctly ---
* so issue warnings. In the abort case, just clean up quietly.
*
- * XXX this is fairly inefficient due to multiple BufMgrLock
- * grabs if there are lots of buffers to be released, but we
- * don't expect many (indeed none in the success case) so it's
- * probably not worth optimizing.
- *
- * We are however careful to release back-to-front, so as to
+ * We are careful to do the releasing back-to-front, so as to
* avoid O(N^2) behavior in ResourceOwnerForgetBuffer().
*/
while (owner->nbuffers > 0)